LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Taking readings at certain time intervals

Hey,

 

I'm trying to write a code to take pulse count readings to interpret to flow measurements. For some reason the counter is not reseting like its suppose to. I was wondering if anyone knew how to setup a program that allows me to take a count reading at e.g. t0=1s then t1=20s and the number that I need would be the difference between the readings at t1 and  t0.

 

Thanks.

Amir.

0 Kudos
Message 1 of 7
(3,003 Views)

Can you post the VI that you made for that ( Post it in LV 8.6)... It will be easier to give a solution... Smiley Wink

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 7
(3,002 Views)
0 Kudos
Message 3 of 7
(2,999 Views)

It isn't quite clear to  me what you want to do. However shift registers sounds like they will be your friend.

See the attached - I have used shift registers to subtract the latest value from the previous value each time the loop runs. This seems to be what you needed?

 

Ian

0 Kudos
Message 4 of 7
(2,990 Views)

Keep in mind that using the "Wait Until Next ms Multiple" as you are, you are guarantee to have the first iternation (t0 to t1) shorter than the rest. If your delay is 20 sec, then the first iteration could be anything from 0 ms delay up to 20 sec delay.

 

Is that the problem you are seeing?

Omar
0 Kudos
Message 5 of 7
(2,970 Views)
I guess..because for some reason the counter is not resetting so I'm getting random numbers instead of the expected flow rate.
0 Kudos
Message 6 of 7
(2,956 Views)

"for some reason the counter is not resetting"

 

Are you asking about the Code Interface Node not getting reset?

Is the CLOAD32.vi suppose to reset the counter?

Does the Code Interface Node return any errors?

 

If your problem is inside the Code Interface Nodes, we would not have any idea how that works without info about your node.

 

Does the count from your Code Interface Node start at 0 (zero) and steadley count up with each iteration or is it random?

 

What are some values for each iteration?

 

The loop iteration [i] starts at zero (0) so your Flow Rate (lpm) calculation is off by one iteration.

This might not be a problem, but the next interation will not have the correct time interval to calculate flow rate due to how "Wait Until Next ms Multiple" work the first time. The first time your interval WILL NOT be the interval you entered, but something less.

 

 

Omar
0 Kudos
Message 7 of 7
(2,944 Views)