Logging Notes


Recommended Posts

I am trying to figure out how to add notes to a logging file.  I have a device with a motor that needs to be turned on periodically and want to log a few channels while it is running, but before the motor turns on I want to have a popup window with a few edit boxes in which certain notes can be entered (the date, the time, the name of the person turning it on, etc.) and be added to the log.  I've created a string channel for each edit box and set the timing on them to 0 since I don't care about them until the motor is turned on.  The problem is that the notes are only logged if they are entered after the logging has started.  If I enter the notes before the logging starts nothing is logged except for the channel names.  I though it had to do with the timing so I tried changing the timing of the channels but then it only logs 0s, and I've tried to use the read() command but that too only logs 0s.  How should I go about getting these notes into the log file?  Also, would this kind of periodic logging be better served by using an export set?


Thanks a bunch

Link to comment
Share on other sites

Since the logging set isn't running, the data isn't logged.  DAQFactory doesn't queue the data to be logged when the logging set isn't running.  There's no reason too.  The assumption is that if the logging set isn't running then you don't want anything to be logged.

You have a couple choices:


1) create a separate logging set for your notes.

2) set the timing of your input channels to 0, start the logging set, do your notes, then reset the timing of your input channels so that data taking starts.  This way, the logging set is running when you create the notes, but there's no other data coming from your channels that might end up in the logging set.  Using myChannel.timing = 0 repeated for each channel, then channel.restart() to having the timing changes take affect.

3) manually open the logging file and insert your notes before starting the logging set using the File. functions.   You'll likely need 5.90.9 or newer since earlier versions keep the logging file locked against opening.

Link to comment
Share on other sites

  • 1 month later...

Thanks for the help.  I took option 3 from above because we needed the notes and channel data in the same file and using the File. functions to organize the data keeps the log file cleaner looking.  One more thing we would like to do is to password protect or lock a copy of the log files so that there is a record of all the logs that cannot be edited or altered in anyway.  I couldn't find anything in the user manual or in the forum on this, which leads me to believe it would have to be done external to DAQfactory, but I figured I'd ask just to make sure.  Also, if this is not possible with DAQfactory, do you have any advice on how to lock these files?  From my understanding Windows will not allow individual folders or files to be password protected, and even though it wouldn't be technically locked I found that DAQfactory cannot write log files to a hidden folder either.  


Thanks again for the help.

Link to comment
Share on other sites

Yeah, that would likely be a windows thing, and a bit challenging in fact.  You can create files that are read only for some users, or even not accessible by some users.  The problem is that it can't include the person that creates the file, as they would need write access, and so whoever uses DAQFactory would have write access to the file.


There are a couple options:

1) encrypt the file.  This doesn't actually protect it though

2) use a database.  You can create the ODBC connection as an admin and control the rights to the database table in MySQL (or whatever database).  MySQL at least has the ability to grant the right to create new records, but not to edit or delete existing ones.  So, you can create such a user, use that for the ODBC connection, then DAQFactory would only have the ability to create new records, not edit or delete (and optionally, not even view).  This would be my preferred method

3) use DAQFactory to email the records to some external location and have that location store the data.  You could automate this with another copy of DAQFactory since DAQFactory supports POP3 retrieval of emails.  


As I said, I would probably use #2 with MySQL.

Link to comment
Share on other sites


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