Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency from Counter Measurement

I've been struggling with this problem for about a week now.  I am trying to get a frequency reading from a RM Young 27106D which is a propeller anemometer with a photochopper transducer, max 300Hz.  I'm feeding the signal to a NI USB 6341.  I need to be able to constantly monitor the frequency output.  I've tried several daqmx sample but I am at a loss.  Reading the X series user manual it looks like a sample clocked buffered frequency measurement is the best bet for my application.  I'm not sure how to implement the solution or even wire the board.  Right now I have the output from the sensor on PFI 9 which I understand to be counter 0.  How do I implement the sample clock to get a reading?

 

Thanks in advance.

LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 1 of 13
(6,366 Views)

Hello MeCoOp,

 

From reading your post, it looks like you want to read a buffer frequency measurement from your RM Young 27106D propeller anemometer. In order to complete this measurement, you will need to use the example called Meas Dig Freq-Buffered-Ext Clk- Arm Start-Cont.vi. In order to use this example, you have to provide a clock in order to acquire the frequency measurements. The counter can't provide the sample clock because X Series counters do not have the ability to divide down a timebase to produce an internal counter sample clock. In order to get this clock, you will need to use the example called Gen Dig Pulse Train-Continuous.vi.

 

If you combine these two examples, you will be able to complete the acquistion. I have also attached an example I created that combines the VIs and has step by step instructions how it works. I have tested this example with a Simulated USB-6341 so it should work for you.


Jim St
National Instruments
RF Product Support Engineer
0 Kudos
Message 2 of 13
(6,334 Views)

Hi Jim,

 

I am trying to monitor the frequency from my engine crankshaft encoder, which gives 1 signal per revolution.  I used your VI, but LabVIEW kept telling me that there is something wrong with my channel setup.  I used ctr0 for both "counter" and "counter clock", and PFI3 as the "Frequency Input Terminal."  Could you help me on the terminal selection?  Or is there other issue? Thank you very much.

 

The device I have is USB-6251 (Mass Termination), and the channels should be fine since I could use them to do signal triggering or generation.

 

Bobby

0 Kudos
Message 3 of 13
(6,108 Views)

Hi Bobby,

 

From your description, I won't be able to provide much information how to resolve this issue without the error message. Could you post on this page?

 

It would also be good to check your connections on the board and the signal from the engine. You said that your signal from the engine is on PFI3 so your signal is connected to pin 43? Also, is your engine sending a TTL signal (0 to 5V)? 

 


Jim St
National Instruments
RF Product Support Engineer
0 Kudos
Message 4 of 13
(6,106 Views)

Hi Jim,

 

I do not have the device around now to chech the error message, but the signal is indeed TTL from 0 to 5V.  I expect my signal varies from about 10 Hz to 100Hz(the most extreme case).  My understanding from your VI is that I need to connect my TTL singal from the engine to the "Frequency Input Terminal", and the "Counter Clock" will generate a pulse train as sampling clock for the frequency measurement by the "Counter".   The names are somewhat confusing to me.  My guess is that I could use one of the counter outs (USB-6251 only has PFI12 (pin 2) as ctr0 out and PFI13 (pin 40) as ctr1 out) for "Counter Clock", but I am not sure which other two terminals I could/should pick as the "Frequency Input Terminal" and "Counter".  Other potential issues may be how to set up the sampling rate and the samples to read: should I do it according to the signal I want to measure or the pulse train generated by the counter out?

 

To extend this application, I wonder if I could use a external pulse train as the "ticks", which is like the pulse train generated by the "Counter Clock".  For example, my encoder also provides very fine TTL signals from 7200 HZ to 72000 Hz with respect to the frequency mentioned above.  Will this do the work?  I apologize for my confusion of the names and concepts since I am very new to signal processing.

 

Thanks for the help,

Bobby

0 Kudos
Message 5 of 13
(6,098 Views)

Hi Jim,

 

The error message is "Error -200300 occurred at DAQmx Start Task.vi:2."  The Counter is set to "Dev1/ctr1", the Frequency Input Terminal is set to "Dev1/PFI4", and the Counter Clock is set to "Dev1/ctr0."  I connected my to-be-measured signal to pin 41(PFI4) and wired pin 2(PFI12) as the ctr0 out to pin 42(PFI 3).  My Sampling Rate and Samples to Read were both 100000.  Max and Min Hz were 1000 and 10, respectively.

 

Could you please help me on the channel identification?  The pull-down selections are quite ambiguous as well as the descriptions.  There are some typos that 1a) to 6a) appear twice but no b)'s.

 

I use USB-6251 mass termination with SCB-68.

 

Thank you very much,

Bobby

0 Kudos
Message 6 of 13
(6,046 Views)

Hi bobbylee,

 

Can you try using the Mead Dig Frequency-Buffered-Cont-High Freq 2 Ctr.vi example from the Example Finder (Help > Find Examples...)?  You will need to change the Measurement Method pin of the DAQmx Create Channel VI to Low Frequency with 1 Counter.  If you select Dev1/ctr0 you will need to connect your input signal to PFI 9.  If you select Dev1/ctr1 you will need to connect your input signal to PFI4.  I simulated the hardware you're using and was able to run the VI without receiving an error.  Let me know how it works.

Regards,

Jared R.
Precision DC Product Support Engineer
National Instruments
0 Kudos
Message 7 of 13
(6,029 Views)

Hi Jared,

 

Thanks for the help.  I did try and it worked only if I chose "Implicit" from DAQmx timing(sample clock).vi.  How could I apply sample clock with an external source?  I changed to Sample Clock(Analog/Counter/Digital), but the vi showed this message when I started:

 

Error -200300 occurred at DAQmx Start Task.vi:3

 

I have attached my setup snapshot.  Please ignore the chart since it is the leftover from using "Implicit."

 

Thanks, 

Bobby

0 Kudos
Message 8 of 13
(6,025 Views)

Hi bobbylee,

 

Can I ask why you want to use an external sample clock?  If you are just trying to monitor the frequency of your 10 Hz - 100 Hz digital signal, Implicit Timing should work fine.  If you can provide more details about the requirements of your application I may be able to recommend a method for you to use.

Regards,

Jared R.
Precision DC Product Support Engineer
National Instruments
0 Kudos
Message 9 of 13
(6,008 Views)

bobbylee,

 

The error you are seeing (-200300) occurs because M Series devices do not support sample clock timing for frequency measurement. This was a hardware feature that was implemented for X Series devices and is not present on M Series devices.  As Jared suggested, you should see if implicit timing can work for your application.

 

Implicit timing means that the device will acquire a sample as soon as a period of the signal you are measuring is complete...  That is, the timing of your samples is dictated by the signal you are measuring.

 

Hope that helps,
Dan

0 Kudos
Message 10 of 13
(6,002 Views)