From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9401 used as an 8 port digital counter?

Does anyone have a simple code for turning the NI 9401 into an 8 port digital counter?
0 Kudos
Message 1 of 9
(6,998 Views)

Hi Jeff,

From my understanding, you are seeking example programs to program the counters on the NI-9401.  The 9401 is an 8 channel 5V/TTL, High Speed Bi-directional DIO module.  It can be configured to do digital inputs or outputs.  If you are using a cDAQ chassis then you can put your 9401 into slots 5 or 6 to access the two counters on the cDAQ chassis backplane.  If you this, then all you will need is a counter shipping example to program the counters.  You can find the shipping examples in LabVIEW by going to Help>>Find Examples.  This will call up the NI Example Finder.  Navigate to Hardware Input and Output>>DAQmx>>Counter Measurements.  You will see folders for several different types of counter measurements.  Browse to see which example fits your application the best.

I hope this helps!

Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
0 Kudos
Message 2 of 9
(6,978 Views)

How could I manually set the destination channel for counter output?

Since a 9401 module was plugged in slot 5 on cDAQ-9172, I can see this channel named "cDAQ1Mod5/ctr0".

Then, How to manually set the route channcel on the 9401 module? I can't find any examples about this problem.

Should I use a property node? Please give me a hint! Thx!

0 Kudos
Message 3 of 9
(6,802 Views)

Hi zenith

 

By default the source of counter 0 while using the 9401 is located on PFI0 or pin 14.  In order to determine the rest of the pins have a look at the image below.  I was able to get this information from by right clicking my device in Measurement and Automation Explorer (MAX) and selecting device pinouts.

 

 

 

You can also specify which PFI line the counter outputs on.  In order to use this you use a DAQmx Channel Property node and modify the Counter Output Pulse Terminal.  Have a look at the screen shot below 

 

Hope this helps. 
Chris_K_
Message Edited by Chris_K_ on 08-27-2008 12:26 PM
Download All
Message 4 of 9
(6,784 Views)

 

 

Message Edited by zhiqin on 03-04-2009 07:44 AM
0 Kudos
Message 5 of 9
(6,473 Views)

what about crio-9076?

In which slot of crio-9076 should we insert ni9401 for counter leverage?

0 Kudos
Message 6 of 9
(4,425 Views)

You should really have created your own thread.  The cRIO is not a cDAQ.  There aren't any counters on the backplane.  The question you're asking doesn't really make sense in the prior conversation.

 

What you're looking for is related to your fpga. Here's one such tutorial: http://zone.ni.com/reference/en-XX/help/371599G-01/lvfpgaconcepts/customizing_i_o/

0 Kudos
Message 7 of 9
(4,399 Views)

Hello all,

 

I am not sure if it will be the correct place. I wrote last week about a problem I was trying to fix (I don´t use labview since almost 5 years ago, so updating/remembering skills) and I had a "problem" with a ni6008, at the end I had the conclussion that the device will not be usefull.

 

Now, the other available hardware to replace ni6008 is 3 x ni 9401 connected to a cDAQ with 4 counters. Can I use only one cDAQ for 16 input counter (i will have to access 4 times to that), if I understood well. 8 of these inputs  will be processed, lets call it, in "mode A", and the other 8 in "mode B". and can I also generate a continuous PWM signal with the same cDAQ (that is why we will have 3x9401)? So at the end, I will have like 18 inputs trying to access to the 4 counters in cDAQ (but i guess that only 2 would be accesible for the the 16 inputs). Can be used for my application? 

 

At the end, I will save every second in an excel file the frequency of the 16 inputs, and the other 2 inputs (and other information from other devices that they already work) 

 

I don´t post any code yet, because I am still thinking about that, and I am wondering first if it can be done and i am not sure how to redirect the input channels to the cdaq/port0/lines0:3.

 

Thanks in advance.

Regards 

 

0 Kudos
Message 8 of 9
(3,902 Views)

I would suggest creating a new thread for this question. It will get more traffic and help you answer your questions faster than on this older thread.

Maggie M.
Application Engineer
National Instruments.
http://www.ni.com/support
0 Kudos
Message 9 of 9
(3,874 Views)