Logging File Name


kmatthews

Recommended Posts

How can i set up my logging file name to be changed to a specific name at the beginning of each day. And also can i log the date in the spread sheet. I'm saving as csv file.

What program are you using to do the logging?

I'm using daqfactory express. In the logging set i am creating a csv file to use in excel. We are going to use this for machine runtime and speed logging hoping to create a new file at the beginning of each day or shift if possible. Therefore if we could somehow change file names according to time of day that would be good.

Link to comment
Share on other sites

The easiest way is to put something like the following line in the Event of one of your channels, preferable the channel with the fastest acquisition speed:

logging.mylogging.strFileName = "c:\mydata_" + formatdatetime("%y%m%d",systime()) + ".csv"

This will set the logging file name every time the channel gets a new value. However, the filename will remain the same until the day changes over because the formatdatetime() function will return the same thing. Replace "mylogging" with your logging set name.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.