I want to write a vi that should be able to acquire datas for several days. It should create an own Spreadsheet-file for each day. I thought the best way to realize this is to use 2 nested while-loops. The outer one should stop if the acquisition is over (if a destined time is reached or an error occured). The inner while-loop should stop, if the day is over (00:00) or if a destined time (that I could set before the start of the acquistion) is reached. Now I have problems to create the stop-condition for the inner loop. The sample-rate of the acquistion could be lower the 1 per second, so I could not check if the actual time is equal to 00:00. Maybe some of you have a tip for me.
First of all i would suggest using a state machine for that application, having a state for errors and another one for the aquisition, and so on. For the aquisition time, you could use millisecond timer value, but be careful with it, as long as it will return to zero after 49 days, when reaches the maximum value, so take care of that. Hope this helps
> First of all i would suggest using a state machine for that > application, having a state for errors and another one for the > aquisition, and so on. For the aquisition time, you could use > millisecond timer value, but be careful with it, as long as it will > return to zero after 49 days, when reaches the maximum value, so take > care of that. > Hope this helps
Unfortunately I have no experiences with state machines in labview. Are there any examples on the ni-website? Could I use state machines with labview 5.0?
There is a simple state machine template in the templates sub-directory of LabVIEW 6. Basically you make a case in the case structure for each state you want.
Yes, there are examples, look at this direction or do a search in developer zone for state machine, http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&E192B16F681EDE8D862567E0007C1047&cat=FECB7F7F4713C936862567E0007AA860 and of course, you can use them in LV 5.0, as long as i use them with that version. Good luck
Do not compare the actual time to 00:00. Instead, prior to the start of the acquisition, use the Get Date/Time in Seconds. Now, during the acquisition state, do the same thing and subtract the start time from the current time. If it is greater than or equal to 24 hours, stop the acquisition.
I think the best way for this is to get the day of month using the "Seconds to Date/Time" function (when you unbundle by name, this is one of the choices)at the beginning of the test (outside the while loop), then just watch for the day of month to change (inside the while loop when they are no longer equal).
Of course, you could always watch for minute and hour to become zeroes.