01-15-2009 11:40 AM
This is a bit confusing. Do you want to record data for 30 seconds, 1 time, every 8 hours? Or do you want to record data every 30 seconds for 8 hours.
examples
Case 1: 7 hours 59.5 minutes pass...then record 30 seconds of straight data
Case 2: 30 seconds, record...30 seconds, record, etc. for 8 hours.
01-15-2009 11:46 AM
that will be 30 secs of data 1 time every 8 hrs not every 30 sec( that will be too much for me )
any ideas
thanks
01-15-2009 02:07 PM
I am using 2 elapsed time vi's , please see attached
ideas:
1) I can use a case structure but the 8hrs timer gives out a boolean only when elapsed
and instantly changes to false, if some how i can make that boolean to be true for 30 secs and do my operation
and change back to false while the 8hrs timer resets at its time
2) I can use the get start time of hrs timer and add 30 sec to it and give it to 30 sec timer's "set start time " and
do my operation within that 30 secs and wait for 8hrs again
but, i am unable to do any of these, may be because both are in the same while loop or something, even if put a
while loop around the 30 sec timer and stop the loop when time up, its not working, it still resets,
i need something that can start a while loop (programatically) not when we press the run button,
3) if we make the 30 sec timer a subvi and put in a case structure and contol its running.....?
an help???
01-15-2009 04:38 PM
Hi freemason,
It would be easiest to use an inner while loop for the 30 second logging within your main while loop. The outer loop will check to see if the 8 hours have elapsed, and if they have enter your inner while loop (use a case structure for this logic). Set your inner loop to run for 30 seconds and then exit.
01-15-2009 04:44 PM
the problem is , i want this to repeat every 8 hrs, the inner loop should start again after another 8 hrs,
how can i programmatically control a while loop ? start and stop a while loop whenever i wish , not by clicking the main run button, instead a start/stop boolean button inside the vi while the vi is running
01-16-2009 11:40 AM
If you want to control the loop programmatically, it will need to be contained in another outer loop which waits for your button press before entering the inner loop. If your application doesn't have a main outer loop, it would just exit.
The inner loop will restart after 8 hours if the outer loop has an 8 hour delay in it and you don't terminate it.
01-20-2009 02:13 AM
the solution.vi has a small problem. when the timer elapses the value is true only for that instant and it turns false immediately after ex :3 secs, so it should write the values into spreadsheet at that instance only, but this vi waits until the next elapse time and writes all values that run during non-elapsed time.
specifically, i have a boolean that will stay true for 3 secs then turn back false, so during those 3 seconds only it should write, but , its writing all times just that the array wont show filling up until next elapse time
any possible solution
01-21-2009 10:48 AM