LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Counter Read & Timeout issue

I am using a DAQmx in the mode ( Counter DBL 1 samp ) to read and display a frequency input as RPM.

However when there is no rpm input ( the motor is stopped ) the Counter read VI throws up a Time out fault. How to prevent this from happening ? What I want to happen is :

Like any Analog voltage channel, just display "0" when there is no frequency input. Setting the Time out to any value is not possible as there is no fixed pattern of when the motor will stop or start.

One method I had devised is to put the whole thing inside a True/False case and enable the true case only when the motor is running. The other machine functions will however continue uninterrupted in another timed loop. But what I am not clear in this case is this :

Suppose the case is True and RPM readout is happening. Suddenly I decide to stop the process and select the False case and if the DAQmx Read VI is in the middle of a read, will it complete that cycle or keep hanging ?


Any better suggestions to achive what I want is most welcome.


Thanks

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 6
(4,364 Views)
I am attaching a slightly refined VI where the analog out and RPM out are set to zero when the user selects Stop Acquiring RPM. But not sure if this will work, as my function generator is presently in my lab and hence could not try out.


Raghunathan.
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 2 of 6
(4,361 Views)
Try the meathod in the attached VI.

It looks at the error cluster and clears the timeout error if it's there. The output will be 0 when it sees this error. Make sure and specify a short timeout so your program will not hang waiting for the timeout.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 3 of 6
(4,352 Views)
Hello Edwin,

>> It looks at the error cluster and clears the timeout error if it's there. The output will be 0 when it sees this error. <<

Yes thats exactly what I was looking for. The problem is solved.

Regards

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 4 of 6
(4,343 Views)
I think a simpler method to try is to set the duplicate count prevention property (I am assuming you have an M Series or TIO board). If you set this property to true it will behave like Analog Voltage Channels. The property is a channel property and is found at CI>>General>>More>>Advanced>>Duplicate count prevention.

Hope this helps out.

StuartG
0 Kudos
Message 5 of 6
(4,322 Views)

@stuart G wrote:
... (I am assuming you have an M Series or TIO board).

Hope this helps out.

StuartG




Hello Stuart,

For this particular application I will also use a 6024 - E series card. However your idea does look OK when using the M-Series.

Thanks


Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 6 of 6
(4,315 Views)