10-01-2014 04:54 PM
Hi,
I need an advice regarding the following timing problem.
I have a state machine.
In one of the states I have to sample a DigIn for 2.4 seconds.
The samples have to be grouped in 12 groups of 0.2sec each.
Then I have to check how many times a DigHigh occurred in each of the 12 groups.
I am not sure how to accomplish that.
Can somebody please give me an advice?
Thank you in advance for all your suggestions.
(I am using LabVIEW 2009)
10-01-2014 06:25 PM
Were it me, I would rely on my hardware to do the timing, and 0.2s worth of data 12 times. The output will be a nice pretty 2d array, already bunched for processing.
10-02-2014 04:29 PM
Thank you. I agree that once I get the array all will be a piece of cake.
Still, however, I am looking for a way for the software to accomplish the timing.
Any suggestions would be appreciated.
Thank you in advance.
10-02-2014 04:34 PM
10-02-2014 04:38 PM
I am using NI USB 6509.
10-02-2014 05:18 PM
10-02-2014 05:38 PM
You are right.
I am reading a DigIn inside a For Loop and would like to get as many samples during each of the 0.2 sec periods as possible.
Can you please give me an advice how I could achieve the best accuracy possible (for the hardware) and get the 2D array containing all 12 x 0.2 sec periods? I am sorry I can not post a sample vi but I will have no access to LabView before tomorrow.
Thank you in advance.
10-02-2014 06:49 PM
10-02-2014 07:42 PM
Which of your timing requirements is more important to you? Is the 0.2s window more important or is that a way to split 2.4s?
If you're more interested in the 2.4s, I'd consider processing the data as a collective after the full duration rather than splitting it up into 12 iterations. You will be running on software timing. That means you're going to deal with the OS inserting time as it sees fit. You'll get closer to a solid block of 2.4s by going with one logging period than you will by using 12 logging periods. If that isn't a concern, running 12 times will certainly make processing the data afterwards easier.
10-03-2014 10:16 AM
Hi,
I created a simple vi (the DigIn is replaced by a Random Num generation and instead of 12 x 0.2 periods it is running 5 x 0.2 sec periods).
Is there a better way to time the inside while loop?
Also I have no explanation why instead of 1 sec. the total time reads 0.8 sec. (5 x 0.2 sec = 1 sec.)