LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering AO tasks with digital trigger

Solved!
Go to solution

I am trying to trigger an analog task using a digital trigger (PFI0) on a NI-6343 (USB), but am not seeing the desired behavior from my VI (See attached screen shot).

 

*When I turn the digital triggering off (digitalTrigger = False), the AO signals appear expected (except...they aren't triggered).

* However, when I turn the triggering on (digitalTrigger = True), there is no signal on the AO channels.

* I tried two different sources: PFI0 and the internal clock (both set wtih Rising edge). For the PFI0 channel, I connected a function generator with a 5V square wave (the PFI0 had a fairly slow rise time...I suspect I could fix this by adding a small buffering circuit). However, I expected that this should work correctly using the internal clock as a trigger. 

 

What's wrong with my code / setup?

 

A few follow-up questions:

* Will this triggering setup only start the AO signal once? Or will the trigger cause the task to start everytime the AO signal finished and the trigger goes high? (I'd like it to behave like the latter)
* Just to check: The rate of response of the AO task to the digital trigger should be on the order of 1MHz?

 

 

 

0 Kudos
Message 1 of 3
(2,684 Views)
Solution
Accepted by kllurie

Hello kllurie,

 

What are you using the triggering for? The way you have the task set up now, it will run continuously until you press the STOP button and will ignore any trigger input. If you want to be able to have the task finish and start it again with a digital trigger, you will have to make the task both Finite and Retriggerable. You can configure the task to be Finite by replacing the Continuous Samples constant on the Timing.vi with Finite Samples and giving it a number of samples to take before stopping. Then, you can make the task Retriggerable by using the DAQmx Triggering property node and choosing Start > More > Retriggerable sometime before the Start.vi. 

 

As for what to use as your trigger, you will want something with a quick rise time (so that it is detected as a digital edge) and that isn't as fast as the sample clock. If you were to use the sample clock as your trigger, there would basically be no difference between your retriggerable task and a continuous one. It would finish taking samples and then immediately be retriggered. 

 

Let me know if this answers your questions!

0 Kudos
Message 2 of 3
(2,636 Views)

Thanks, Siana. This worked.

 

I attached a screenshot of the relevant changes in the code. I also found it was necessary to actually indicate the number of samples per channel.

0 Kudos
Message 3 of 3
(2,625 Views)