Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

indicators freeze waiting for the counter to read data

I am using a NI-6014 multifunction board with labview 7.1 .
In my project i use all the board inputs and outputs and the counter to measure a flow sensor frequency (detect edges) connected to PFI 9/CTR 0 GATE.
Clock is the sample clock for the analog I/O
The counter works well alone . All the other signals work well alone.
The program is simple as a few tasks are created and inside a loop the data is read and displayed.
The problem arise when the counter is mixed with the other tasks then if there is no pulses the read waits until the timeout (10 sec normal) the problem is that the indicators of all the signals freeze until there are results in the counter.
 
1) How can I make the indicators run normally (as without the counter)
2) How can I trap the error generated by the timeout in order for the program to continue measuring even if there are no pulses from the flow sensor.
 
Thanks in advance,
 
Henry
0 Kudos
Message 1 of 3
(2,810 Views)

Hi Henry,

What it sounds like is occurring is that the Read VI for the counter is waiting until there is enough data to read before it moves on.  Due to the nature of a While Loop it must have all of the code execute within it before it will move on to the next iteration.  In your case this sounds like a bad thing though because you need to have some more data that you need to continue processing.

Typically when doing data acquisition it is a good idea to have all of the tasks within a single loop.  However, if this doesn't work for you then you might want to try placing your Counter Task within a separate, but parallel, loop.  That would allow some of your code to continue to execute even if the counter operation times out.

If this doesn't work for you, then you might want to consider posting a simplified version of your code so that we could take a look and see what else may be going on.

Regards,

0 Kudos
Message 2 of 3
(2,803 Views)

Thanks for your help It works well with the counter read VI in an independent while.

 

Henry

0 Kudos
Message 3 of 3
(2,795 Views)