LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Record data every X iteration of the while loop

Hi there,

 

I am controlling two serial VISA in one loop. it makes it more convinient as I am recording data into an aray, which is then sent into a excel file.

 

My problem is that my loop is looping every 500ms... over two weeks of acquisition I would get over 2 500 000 collums. So I would sample every, say 20s. Would you have a way to do it ?

 

here is my VI. 

 

Flo

0 Kudos
Message 1 of 5
(3,733 Views)

I can't open your VI as I only have LV2014, but there are a couple of possible ways to do this:

 

1) Create a timer (e.g. FGV or the Elapsed Time Express VI) and then only write the data if the time has elapsed (with the auto-reset set to True so it happens every 20s)

2) Use the iteration counter or a count on a shift register and log the data after every n-th iteration of the loop


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 5
(3,714 Views)

Hi, I'm Nick, Applications Engineer at NI.

 

You should follow Sam_Sharp's advice on that. To illustrate his second point better, I have put together a simple VI demonstrating the functionality. Have a look at it, you should be able to incorporate something similar in your code.



----------------------------------------------------------------------------------------
Everything has an End, and you get to it only if you keep on
-E. Nesbit
0 Kudos
Message 3 of 5
(3,675 Views)

that solution doesn't work for my application. Instead I share my variable with a third VI which collect every data and builds arrays in a loop timed at 5000ms. That works fine 🙂

 

Flo

0 Kudos
Message 4 of 5
(3,669 Views)

Flow-w, how do you collect the data and put it into array.? 

Can you share that part of your vi. 

0 Kudos
Message 5 of 5
(3,375 Views)