Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency measurement with PCI6624, timout problem at startup, i.e measure 0 Hz.

I want to use my PCI 6624 for measuring of frequency signals from a gear flow meter. The problem is that when I start running the VI there is no pulses from the flow meter and the VI stops to run and I get a Timeout error message. I.e is it possible to measure 0 Hz with the 6624 input used for frequency measurement?
With hardware from IOtech and Daisylab I don`t have this kind of problem.
 
                                    /Thanks in advance
0 Kudos
Message 1 of 10
(6,510 Views)

Hi,

When do you expect the acquire the pulses? One simple solution would be to just increase the timeout value or set it to -1, i.e. infinite.

If you have some sort of triggering pulse which precede the acquisition you could wait for that before you enter the read vi part of your code.

Thanks,

Pelle S
Account Manager
National Instruments Sweden
0 Kudos
Message 2 of 10
(6,482 Views)

Having similar problem,

Did you manage to resolve the issue?

I have attached the the solution given by NI for error code 200474, if its any use. The problem I have just found with this Vi is that if one channel has no signal it forces the other channel to grind to a halt. This problem has existed for me on the cards being used in this project PXI-6289 and PXI-6236, also other DAQ cards used in a different project earlier in the year.

It seems to be a serious flaw in the application of the NI DAQ cards to general purpose data logging where counter signals might not be connected by the end user or they are very low frequency and the whole system hangs.

 

Labview Version 8.5
Labview Version 8.6
Labview Version 2014
0 Kudos
Message 3 of 10
(6,397 Views)

Can't look at the code now because I don't have LV near my network PC.  However there is a fairly simple workaround for this kind of situation.  Basically, make the timeout work *for* you rather than against you.

Calling DAQmx Read with a long timeout (or a -1 for an infinite timeout!) implies that you really want the next measurement even if you have to wait a long time for it.  You could instead choose to call DAQmx Read with a pretty short timeout and then detect whether the timeout occurred.  (You'd probably have to catch the error out cluster, verify that the error is the timeout you half-expected, and then erase the error).  When the timeout occurs, you'll know your freq is getting down there fairly close to 0.  In many apps, you could probably set a timeout of, say, 0.25 seconds.  Then you can get real measurements down to about 4 Hz, and any freq less than that can just be assigned as 0 freq.

-Kevin P.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 10
(6,391 Views)
Kevin. 
Interesting!

Do you have any idea how accurate the timeout spec is?  With pulses to the Gate I can measure them with an oscilloscope to see that the
measurement period is what I want.  Is there any proof that the timeout period is accurate and repeatable?

-Craig
0 Kudos
Message 5 of 10
(6,383 Views)
Hi Kevin
 
Thanks for that. Basically I think the Vi I have posted does as you suggest. The only problem with the Vi used is that if one channel has no signal, 0Hz it stops the other channel. Seperate loop for each channel did not alter things and the channel without an input signal stopped the other channel. I assume that the CTC inputs are multiplexed so if both channels are being scanned and one has no input the multiplexer stops and hangs the other channel? This feature must apply to all of NI's DAQ boards?
 
I did a search and found a posting by someone who has a similar problem and (I think) you suggested to use a property node to check if the CTC channel had any samples. If 0 samples then not to execute the DAQmx read. I have had a bash at this suggestion and got something to work which I will tidy up and post later today for comments.
 
Thanks Jack
Labview Version 8.5
Labview Version 8.6
Labview Version 2014
0 Kudos
Message 6 of 10
(6,363 Views)
I had a similiar problem.  When the frequency drops to zero everything simply locks up.  I modified the previous example to work for me, hopefully it will work for you.  I stopped the counter when that -200474 error occurs, it's then cleared, and the task will automatically restart itself when called.  The 8.5 version replaces the shift register with a feedback node.
Download All
Message 7 of 10
(6,257 Views)
forget that last message, I posted that in the wrong thread! In fact the thread I was in was over a year old, so I guess it won't do much to post it in there
0 Kudos
Message 8 of 10
(6,253 Views)

Hi Johnnyt

Thanks for the Vi, I had just got back to this problem and found your solution so time saved. Implemented it on 4 counter channels and it works a dream. 

With regard to my earlier posts on this subject they were/are current as the post was at the end of 2007.

Thanks again,

Jack

Labview Version 8.5
Labview Version 8.6
Labview Version 2014
0 Kudos
Message 9 of 10
(6,201 Views)

This example has been a great help to me already but I'd like to take it a step further.  Is there a way to log (to a TDMS measurement file) the frequency data that is measured?  I'm sure there is a way, I just don't know what that way is.  I tried using the express VI Write to Measurement File but when I import the TDMS file into Excel, I get a new worksheet (tab) for every single data point - not exactly what I had intended.  I hope to save the frequency value at evenly spaced time intervals.

 

Thanks you in advance!

0 Kudos
Message 10 of 10
(4,720 Views)