LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital Frequency 1 Ctr

Hi,
 
I am trying to use Measure Dig Frequency Low Freq. 1 Ctr. vi to calculate the frequency from the second counter. The first counter is used for the encoder, and the source of the encoder is connected to the gate of second counter.  When I run the program, the frequency reading is correct, however when I stop the program it takes a long time and then it gives the error "timeout expired".  I have to add this part to my full program which is big, and I can not carry this error. Does anybody know how to solve this problem? Thanks,
 
Azadeh
0 Kudos
Message 1 of 6
(3,212 Views)
I'm a little confused by your description, but I think you want CTR0 to generate a signal and CTR1 to read the signal.  So you'd wire CTR0_OUT to CTR1_GATE to use the 'second' counter as the measurement counter.  CTR_SRC is used for wiring the timebase.  Confirm proper operation using the example VI Gen Dig Pulse Train-Continuous.

There's good info in the example VI's documentation (File->VI Properties->Documentation) as well your hardware's user manual (see the M-series user guide chapter 7 for counter info at :http://www.ni.com/pdf/manuals/371022f.pdf

Using the above wiring, your program works just fine on my PCI-6221.

You'll get a timeout error if you stop generating a signal before hitting your stop button.  This is the expected behavior.

Message Edited by Jonnie 5 on 08-01-2006 04:09 PM



2006 Ultimate LabVIEW G-eek.

Message 2 of 6
(3,203 Views)
... and on second thought - it should be stopping for 10 seconds (the default timeout value on the Read VI).  You can set this lower, but you'll still need to have a handler for the error.  This is only true if there is no signal on your measurement counter.


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 3 of 6
(3,196 Views)

Thanks for the answer. You are right, I get the error since the signal generating stops in the program before hitting stop button or the program starts and the signal generates after some certain period of time. Is there anyway that when the signal is not generating during entire run, the program doesn’t give an error?

 

Thanks,

Azadeh

0 Kudos
Message 4 of 6
(3,190 Views)
I don't believe so.  but as long as you handle the timeout error programmatically, it won't make a difference.  The timeout is a specific error code ( -200474), so just make a case handler for this and reset it to null error.

I attached a quick example of this (LV8)


2006 Ultimate LabVIEW G-eek.

Message 5 of 6
(3,186 Views)
Thanks a lot, it was a great help.
0 Kudos
Message 6 of 6
(3,179 Views)