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
(1,775 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

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 2 of 9
(1,755 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
(1,714 Views)

Need more details:

 

- Latest code

- Desired behavior

- Actual behavior

- Any specific error codes / messages

 

 

-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 9
(1,699 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
(1,689 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

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 6 of 9
(1,682 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
(1,677 Views)

In LabVIEW:

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

 

 

-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 8 of 9
(1,673 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
(1,633 Views)