LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Holding readings for certain period of time

LabVIEW beginner here. I'm logging particle count data generated every second from two identical instruments, one upstream of a substrate and the other downstream; they are labelled alpha and beta respectively in the attached VI. The counts plus penetration (beta/alpha) are written to measurement file once a second accordingly. This works fine so far but I need to correct for the aerosol transit time (=10 seconds) between the two instruments, so that the alpha reading at t=0 is paired with the beta reading at t=10s. How do I hold/delay the alpha reading for this time?
0 Kudos
Message 1 of 6
(2,830 Views)
I do not have the buffer VI, I am trying to understand your program a bit.  So are you going to still log data for the first 10 secs?  Or will the program run 10s then start logging data.  It seems that your intention is to take 1 sample roughly every second.  How exact are these timing intervals... is it sufficient to count 10 iterations then release the data?  These answers affect the implementation of your sample and hold
as an observation, if you develop an error in your serial reads your program will run merrily on its way because you are not error checking every iteration.  You should implement shift registers to circle the errors back.  Merge your errors inside the while loop and feed to a shift register, and split to the error in inputs.  Also it would be wise to OR that with your stop, so your program stops if an error is encountered.   

Paul
Message 2 of 6
(2,821 Views)
Ok attached a slight upgrade with a 10 element circular buffer.  This presumes that your meas. data is being taken once a sec, and that is fine.  There is a case statement that tells you when you have valid data after 10 iterations.  There are other ways of doing this.  So depends on what you are doing.  I have also implemented the recommendation on the error clusters AND got rid of some of the Cohersion.  I have upgraded my 8.2 version to 8.2.1, so I saved as version 8.  Hopefully it still opens and works.

Paul
Message 3 of 6
(2,812 Views)

Paul,
Thanks for your reply. Readings are taken once a second. The first ten beta readings are obselete so the intention is to read the first ten alpha readings so that the first penetration (beta/alpha) value won't be logged until after 10s (matching alpha at t=0 with beta at t=10, alpha t=1 and beta t=11 etc). I will look through the shipped examples for a buffer VI to look at unless you have a specific recommendation.
I was thinking through the serial read errors concurrently (but learning as I go - this is my first VI) so thank you for clarifying what needs to be done.

0 Kudos
Message 4 of 6
(2,810 Views)
Sorry didn't see your 2nd reply before posting mine - many thanks for the updated VI!
0 Kudos
Message 5 of 6
(2,808 Views)
Ok, I think this is more the implementation you want.  I also fixed a bug I created in your VI and finished the exit terminal strategy.

Paul
0 Kudos
Message 6 of 6
(2,800 Views)