LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

counter stops vi from working

Hello,

 

I’m using a ni USB 6215 with labview 8.2, the problem i have is related to counters. I’m using two counters to measure two different shaft speeds as well as 3 analogue inputs. The problem i found was when the shaft is not turning or turning very slow that the vi does not take any readings.

It basically freezes until the shaft start running.

If I do not wire a time out value to the DAQ this error occures.

Fehler -200284 ist bei DAQmx Read (Counter 1D DBL 1Chan NSamp).vi:1 aufgetreten

How can i runn the vi constantly even when the safts are not turning


Can somebody help me with this problem?

Thank you for your help in advance

 

Regards

Fred

0 Kudos
Message 1 of 4
(2,619 Views)

Handle the error, this is an expected error, you are reading counts, and when the shaft (encoder?) is not turning no counts come in, so there are no points to read in the counter.  To deal with this you want a timeout.  If you get a timeout, your read should be 0 counts and the error should be cleared.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 4
(2,615 Views)

Hello Paul,

 

This stops it form sending the error code, but the data collection is not going on until a pulse comes.

All the analogue results wait until a value larger than zero is measured on the counters.

 I attached the vi

Thanks for your help so far.

 

Regards,

Fred

0 Kudos
Message 3 of 4
(2,602 Views)
Consider Multithreading this application.  your tasks are sequential so if one task hangs, your whole application will hang otherwite your timeout mush be short enough that you dont block your other timed daq tasks.  That is if you are waiting for the shaft movement you will miss the ai reads and risk buffre over-runs. 
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 4
(2,581 Views)