Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9401 Counter Issues

Hi All,

 

I'm trying to use on of the counter outputs on the 9401. I have several I/O hooked up to the 9401, which mostly go to a microcontroller. I have two tasks. One for digital input, and one for counter output, and use them respectively. It seems like when I run the counter output task that the unused counters (I'm just using the first ones) also are set high, which is causing extra current to be drawn from my board. How can I set this up so that only the counter I'm using will be driven, and the rest of the pins will stay as input?

 

Regards,
ken 

0 Kudos
Message 1 of 4
(3,160 Views)

Hi nthamma,

 

As described in this forum, the counters are located on the bacplane of the chassis that your 9401 is connected to. Which chassis are you using and how are you measuring the outputs of the unused 'counters' (i.e. NI Measurement & Automation Explorer, handheld multimeter, etc)? As also explained in the aforementioned forum, you can explicitly reserve your tasks using the DAQmx Control Task to set them as inputs.

 

Hope this helps!

 

Allison M.
Applications Engineer
National Instruments
ni.com/support
0 Kudos
Message 2 of 4
(3,146 Views)

My post on the other thread also points out that line direction on the 9401 is configurable by nibble (group of 4 lines).  Borrowing a description from the specifications:

 

The DIO channels are grouped in two ports, one containing channels 0, 1, 2, and 3, and one containing channels 4, 5, 6, and 7. You can independently configure each digital port in software for input or output. Note that all four channels in the port must share the same line direction. Refer to the software help for information about configuring ports on the NI 9401.

 

 

So if you need to use one of the lines for the counter output, then this would also set the direction of 3 of the other lines.  You can programmatically select which line to route the counter by setting the corresponding channel output property (varies slightly depending on which ADE you are using).  There is no way to configure the direction of a single line independent of the other 3 lines on its port.

 

 

Best Regards,

John Passiak
0 Kudos
Message 3 of 4
(3,135 Views)

Hi Ken,

 

The 9401 is nibble configurable.  What this means is that all lines 0-3 must be configured for the same direction, and all lines 4-7 must also be configured for the same direction.  Each nibble can be configured independently for a different direction, but all lines in within each a nibble must be configured for the same direction.  So in your use case, all the lines in the same nibble as the line you are using for counter output will also be configured for output.  There is no way around this.  That's just how the hardware works.  However, this shouldn't cause the lines you are not using to be driven high.

 

I have a few questions to help me better understand what you're seeing:

 

1.  What behavior are you seeing on the unused lines?  Are they pulsing at the same frequency as the counter you are using?  Or are they just being driven high and staying high? 

 

2.  Which counter(s) are you using on the 9401?

 

3.  Are you explicitly setting the counter output terminal using the DAQmx Channel::CO.Pulse.Term property?  Or are you relying on the default terminals?

 

4.  If you are explicitly setting the counter output terminal, have you ever changed that output terminal between task executions?

 

If we could see your application, that would helpful as well.

 

Thanks,

 

 

Ryan Campbell
NI R&D
0 Kudos
Message 4 of 4
(3,133 Views)