Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-9472 Change Event Output Terminal

Hello,

 I am having an issue with using the counters and PFI lines. Please see the attached document for a full description.

 

Device: NI-cDAQ 9174, Module NI-9472

Goal: Use 4-onboard counters (ctr0...ctr3) to control directly DO0..DO3

Methodology:  Based on online literature and the DevZone:
•    Initialize Counter with CO “Pulse Generation-Frequency”
•    Use Events.Counter Output Event.Output Terminal To route the signal to the output pins
 

 

untitled.JPG

 

Problem:
•    I run the code once, say for PFI_0 and it works well. I stop the device, and the pin stops toggling
•    I then run the code again, say now- on PFI_1. Now the counter triggers both PFI_0 and PFI_1.
o    Why???
o    The only resolve for this I have found is to use the ‘device reset’ vi on startup. This is not an acceptable solution.

 

 

Additional Observations:
•    Sometimes pins are already “connected to a counter” without me setting that. For example, one time PFI-3 was connected to ctr0. Another example was PFI_7 was connected to ctr1.

Why???
o    Even on device reset (both cDAQ and module) this happens.

 

Additional Questions:
•    Why are the PFI0..PIO7 lines of the 9472 module directly connected to the DO0..DO7 lines??? This does not make sense


Thank you,
 Justin Reina
 justinmreina@gmail.com

justinmreina@gmail.com
Download All
0 Kudos
Message 1 of 5
(7,485 Views)

Howdy Justin!

 

When you use the DAQmx Export Signal as shown in the image you are creating a task-based signal route from the output of the counter to the PFI line.  From the NI-DAQmx Help page for "Lazy Line Transistions":

 

When a task-based route gets created and released, it does not necessarily go away. The hardware resources associated with the route are released, but the configuration might remain so that glitches are minimized.

 

What is likely happening is that when you first run the VI you are creating a route from the output of ctr2 to PFI0.  Then when you run the VI a second time with the PFI line changed to PFI1 you are creating a route from ctr2 output to PFI1, but the original route from ctr2 output to PFI0 still exists. Calling the Device Reset VI forces these routes to be cleared and set to the default routes.  After reseting the device you are seeing ctr0 on PFI3 and ctr1 on PFI7 because those are the default routes.

 

The following table (from the NI-DAQmx Help page "C Series Physical Channels") shows the counter terminal defaults for 8-Channel DIO/DI/DO C Series devices:

 

PFI Signal Physical Channel Name
PFI 0 ctr0 src/ctr2 aux
PFI 1 ctr0 gate/ctr2 out
PFI 2 ctr0 aux/ctr2 gate/freqout
PFI 3 ctr0 out/ctr2 src
PFI 4 ctr1 src/ctr3 aux
PFI 5 ctr1 gate/ctr3 out
PFI 6 ctr1 aux/ctr3 gate
PFI 7 ctr1 out/ctr3 src

 

The PFI lines and DO lines do share physical ports, however, they are not directly connected.  If you are performing a digital output then the port will be connected as a DO line.  If you are using the PFI lines to route signals to those ports then they will be connected to the output.

 

Regards,

Barron
Applications Engineering
National Instruments
Message 2 of 5
(7,451 Views)

Hi Barron,

 First, thanks for the clarifications! This was the info I finally came down to over the weekend while doing some reading.

 

 

So: How do I unconnect the old routes?? 

 

Thanks,

 Justin Reina

justinmreina@gmail.com
0 Kudos
Message 3 of 5
(7,445 Views)

From the NI-DAQmx Help page for "Lazy Line Transitions":

 

If you initially created the route by exporting a signal with the Export Signal function/VI, you can also disable the tristate buffer by calling the Export Signal function/VI with the same signal name but with an empty string as the output terminal. Putting the terminal back into a tristate mode is necessary if an external signal must be connected to the I/O terminal. If the terminal is not tristated first, double driving the terminal damages the hardware.

 

Let me know if this solves the issue.  Thanks!

 

Regards,

Barron
Applications Engineering
National Instruments
Message 4 of 5
(7,421 Views)

hello...

i also want to do same and i am facing same problem. i also tried that null string solution but in my case it didn't work. i am having usb 6343 Daq.

 

i also posted same thing in forum but i didn't get any reply. so my be you people can help me out.

 

 

thanks & regards 

0 Kudos
Message 5 of 5
(5,420 Views)