asaikk Posted February 10, 2012 Share Posted February 10, 2012 What would be the script for hourly logging, that is, to creat a new log-file hourly? Link to comment Share on other sites More sharing options...
AzeoTech Posted February 10, 2012 Share Posted February 10, 2012 You can do it in an event, or just a low priority sequence. In a sequence it'd be something like: while(1) logging.myLog.strFileName = "c:\data\myData_" + formatDateTime("%y%m%d_%H",systime()) + ".csv" delay(1) endwhile That would create a new file every hour where the date and hour is part of the file name. Link to comment Share on other sites More sharing options...
asaikk Posted February 10, 2012 Author Share Posted February 10, 2012 Thank you for the quick response. On some reference, the script for daily logging is written below; <logging.log.strFileName = "c:\mydata_" + formatdatetime("%y%m%d",systime()) + ".csv"> compared with above, the one for hourly logging you mentiioned (below) is somewhat non-similar. <logging.log.strFileName = "c:\mydata_" + formatdateTime("%y%m%d_%H") + ".csv"> Would you please explain the meanings of the commands below? "%y%m%d" "%y%m%d_%H" systime() Link to comment Share on other sites More sharing options...
AzeoTech Posted February 10, 2012 Share Posted February 10, 2012 I'm sorry, I typed it in wrong. There should be a ,systime() in the function similar to your script. The %H means the current hour of the day. %y is year, %m is month, %d is day. This and other codes are described in section 4.12.11 in the user's guide. Link to comment Share on other sites More sharing options...
asaikk Posted February 10, 2012 Author Share Posted February 10, 2012 Thank you for your comment. I will look up it on the Guide for more detail. Link to comment Share on other sites More sharing options...
asaikk Posted February 10, 2012 Author Share Posted February 10, 2012 I installed the sequence of hourly log below on the DAQ Factory Express, but it does not work. --------------------------------------------------------------------------------------------- while(1) logging.log.strFileName = "C:\aa onlinesoft\datalogger\HourlyLog" + formatdatetime("%y%m%d_%H",systime()) + ".csv" delay(1) endwhile --------------------------------------------------------------------------------------------- On the "Sequence Summary" window, this "HourlyLog" is shown to be "RUNNING", (see the attached figure). What could be wrong? Link to comment Share on other sites More sharing options...
AzeoTech Posted February 11, 2012 Share Posted February 11, 2012 First, is your logging set named "log"? I think the parser actually might have a problem with that because log() is a function for doing logarithm. So, first you might consider renaming your logging set. Second, does the file name change to something like HourlyLog120210_15.csv? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.