LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to spreadsheet at regular intervals and optional manual interval selections

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.

0 Kudos
Message 11 of 18
(1,217 Views)

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

0 Kudos
Message 12 of 18
(1,215 Views)

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???

0 Kudos
Message 13 of 18
(1,198 Views)

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.

Regards,

Jeremy_B

Applications Engineer
National Instruments
0 Kudos
Message 14 of 18
(1,179 Views)

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

0 Kudos
Message 15 of 18
(1,177 Views)

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.

Regards,

Jeremy_B

Applications Engineer
National Instruments
0 Kudos
Message 16 of 18
(1,158 Views)

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

0 Kudos
Message 17 of 18
(1,143 Views)
See attached.  I used an inner loop within the true case to run until 3 seconds has elapsed, then it will exit and after another 30 seconds the true case will be triggered again.
Regards,

Jeremy_B

Applications Engineer
National Instruments
0 Kudos
Message 18 of 18
(1,115 Views)