Export InfluxDB Data to CSV File

Home / FactoryTalk Optix / Alarms, Trending, and Data Loggers

Description
Record your machine status data on each cycle to CSV file, thank you to FactoryTalk Optix and InfluxDB. With the use of a PLC Tag to trigger the DataLog feature!

Contributed by Xavier Florensa – YouTubeLinkedInGitHub


Transcript
(00:01) hi everybody in this video I will show you how to store machine data on each cycle to a CSV file it’s a typical application and we will do it thanks to factory talk optics and through influx DB who has a functionality to save the data in CSV so first of all let’s see the demo here we have our factory optics application running and here we have our PLC program running in logic logic echo so here we have three PLC tags changing as a sine wave we want to store as soon as the trigger changes from zero to one so here
(01:06) for instance I make this change state from one to zero if I go to my influx DV database I find this the three values and I get I can send well you have the data this is depending on the scale you use let me do it again we go here yeah we can see the data okay let me store more data once again me store another set of data let me store another set of
(02:16) data now we can go to our database and see this evolution three values start and once you’re ready you just click on this button CSV and you have your CSV file here you can see you have all the variables and different time stamps and let’s see how is it done here we have the application where you have um data store in in FL TV locally running locally this port to use an organization name and a bucket the token we are not using SSL
(03:26) okay then you have a data logger with variables to lock those three variables that you have from the PLC you have the variables here the internet driver to the one to the two okay what’s important is to make the trigger for the data log because in the data logger we have the sampling known waiting for a trigger the trigger is done through a variable that is linked to another T the PLC called trigger remember this P this PC attack and as soon as it changes we have here an
(04:32) event that each time it changes to one you execute a method that is cataloger lock okay and this is all i hope you enjoyed this video i would like to comment that this video is inspired by another video where this is done through SQL video from Daniel Fandam and you can find it in case you want to do it in SQL but if you do want to do it in in flux DB you can use this tutorial so thank you very much