NI Home > Community > NI Discussion Forums
Reply
Member
Roger_Isaksson
Posts: 1
0 Kudos

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
Active Participant
PelleS
Posts: 339
0 Kudos

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

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
District Sales Manager
National Instruments Sweden
Member
jack1
Posts: 122
0 Kudos

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

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 2013
Active Participant
Kevin_Price
Posts: 1,916
0 Kudos

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

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.

Member
CBJohnson
Posts: 12
0 Kudos

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

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
Member
jack1
Posts: 122
0 Kudos

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

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 2013
Member
johnnyt
Posts: 30

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

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.
Member
johnnyt
Posts: 30
0 Kudos

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

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
Member
jack1
Posts: 122
0 Kudos

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

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 2013
Member
evMark
Posts: 1
0 Kudos

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

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!