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.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Export multiple signals from counter at the same time

Solved!
Go to solution

I am trying to learn digital pulse generation with USB 6212 DAQ card. Following the NI examples, I have the following VI which generates a finite pulse train upon triggering of an external source. I have two questions:

 

1. I am able to output a finite pulse train. However I want to see how excatly the pulse generation works. So I want to route multiple siganls of counter 0, such as source, gate, sample clock, etc, each to a different PFI terminal, to allow viewing them on an oscilloscope at the same time. I would imagine that this could be done by a vi which you specify the signal (source, gate, ....) and output terminal. However for the "export signal" vi I do not see how to specify that which signal to export (I would imagine it to be an enumeration just like choosing a trigger source). And how to export multiple signals?

 

2. Seems another way to export signal is using the property node like in my attached vi. However this is even more confusing to me. In the attached image, seems that the property node of "export signal" is doing toggling at the event of "CtrOut", what exactly does this mean? Is this output the same as "Ctr0InternalOutput"? When I change the delay (set to 0 in the image) of the pulse, the output does not really delay compared to the trigger source. Is this related to that I am outputing something else than the real Ctr0 output? If so, how can I export the real output?

 

Your help would be greatly appreciated. Thank you!

 

Finite pulse tick.png

0 Kudos
Message 1 of 4
(2,918 Views)
Solution
Accepted by topic author firephysix

Hi Firephysix, I'd be happy to help.

 

1. You seem to be a bit confused about the counter terminals, which is perfectly understandable (it took me more time than I'd care to admit to understand it). If you check out the first explanation in the linked forum topic, the only signal being generated with each counter task will exit through the Out gate. If you wanted to look at multiple counter signals with your O'scope, you will need to make multiple counter tasks, and it looks like with your device you only have 2 counters available, to create a total of 2 counter signals.

 

Counter terminals explained: https://forums.ni.com/t5/Counter-Timer/What-is-the-meaning-of-CTR-0-SRC-CTR-0-GATE/td-p/583219

 

2. The Export Signal property node you are using will allow you to internally wire a new output for the counter output task (if you wanted to directly feed it to a digital input channel without setting up wiring, for example). The toggle merely establishes whether the counter will change states or keep it's state when you reach the max count on your channel (see the help page below for more clarity). I don't think it matters for your application.

 

Events:Counter Output Event:Output Behavior Property: http://zone.ni.com/reference/en-XX/help/370469AG-01/daqmxprop/attr174f/

 

Lastly, i don't imagine the delay you set on the first VI matters since you have your VI set up to run with a trigger.

http://zone.ni.com/reference/en-XX/help/370469AG-01/lvdaqmx/mxcreatechannel/#DAQmxCreateChannel(CO-P...)

 

0 Kudos
Message 2 of 4
(2,857 Views)

Hi Kodester,

 

Thank you for the explanation! That helps a lot!

 

Just to make sure. Since you mentioned each counter only has one output. If I use the above property node to wire the output for counter 0 to say PFI 0, does it mean that this output at PFI 0 will be exactly the same as Ctr0InternalOutput?

0 Kudos
Message 3 of 4
(2,850 Views)

Yep, exactly! You'll now be able to pull a signal out of both, but the signal is going to be the same counter signal.

0 Kudos
Message 4 of 4
(2,839 Views)