Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9401 counter setup

Hello All.

Sorry for the simple question but I am at a loss.

I am using NI 9401 on  cDaq 9189.

I am using the example code "Counter - Read Pulse Duty Cycle and Frequency (Continuous).vi" - attached to this message/

And I am having hard time to configure it.

What is the difference between: "Pulse Frequency Terminal" and "External Clock Source"?

For the counter I wish to use: "NI9401counter/ctr0"

for the setting that is shown in the screenshot:

gilmaor1_0-1653236921022.png

I get the following error message:

hat your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.

Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<92>

 

Clearly I am missing a very basic thing here.

How do I make it work?

Thanks!

Gil,

0 Kudos
Message 1 of 9
(2,277 Views)

The main thing I'd recommend is to change the version of DAQmx Timing (use the drop-down selector) to "Implicit".  That means that sample timing is "implicit" in the signal being measured, which is true for frequency measurement.

 

After that, you may want to brush up on the distinctions between Finite and Continuous Sampling.  Since you're looking to read an array of measurements each loop iteration for an indefinite time, you should probably choose Continuous Sampling.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 2 of 9
(2,257 Views)

Hi,

Kevin, Thanks for your reply.

The solution you have suggested did not solve my problem.

It is rather frustrating since I thought that reading frequency  will be rather. easy.

How Do I get the bear minimum frequency reading?

Thanks!

Gil,

0 Kudos
Message 3 of 9
(2,216 Views)

Need more details:

 

- Latest code

- Desired behavior

- Actual behavior

- Any specific error codes / messages

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 4 of 9
(2,201 Views)

Hi kevin.

Thanks for for your help.

 

I have attached the code that I am using. this is the example code from NI examples..

My system configuration is:

NI-cDaq 9189 with NI-9401 C-Series.

 

I want to measure frequency about 70Hz,currently I am using pulse generator for testing.

It appears That I am not an expert of measuring frequency using labview.

I do not  know how to setup the example code to work.

Is there a step by step tutorial for configuring this.

Please see my attached code.

with this code and configuration I get the following error:

Possible reason(s):

Some or all of the samples requested have not yet been acquired.
To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger, make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.

Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<27>

 

The error occurs at the read stage. 

 

I am grateful for any help you could offer.

Gil,

0 Kudos
Message 5 of 9
(2,191 Views)

First, can you use "File->Save for Previous Version..." back to maybe LV 2016?   I can't open 2021 files.

 

Is your pulse generator making nice "rectangular" digital pulses, either 0-3.3V or 0-5V logic?  That's what most NI counters are looking for.  (Though other digital logic levels may be supported in the modular realm of cDAQ where I have less familiarity).

 

Referring back to my earlier reply, you should avoid having or needing a separate sample clock.  An easier starting point might be the "on demand" counter frequency example.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 6 of 9
(2,184 Views)

Hi Kevin.

Thanks for your prompt reply.

Can you please send a link to the counter frequency example.

Thanks!

I am also checking my pulse generator now.

Thanks!

Gil

 

0 Kudos
Message 7 of 9
(2,179 Views)

In LabVIEW:

Help->Find Examples->Hardware Input and Output->DAQmx->Counter Input

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 8 of 9
(2,175 Views)

Hi Kevin

Thanks for your kind help.

I have found the problem to be with the electrical connections.

Thanks for the help!

Gil,

0 Kudos
Message 9 of 9
(2,135 Views)