LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog output with analog triggering

Solved!
Go to solution

I would like to implement analog output with an analog signal trigger on the PXIe-6124. Both the manual and this page: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000kIhASAU&l=en-US state that it is possible. However, I get error -200265 "An attempt has been made to use an invalid trigger source." I am using the built in example with analog trigger source PXI1Slot3/ai0.

Any help is appreciated.

0 Kudos
Message 1 of 7
(2,404 Views)

I think direct support for analog triggering is only for analog input tasks.

 

However, you *can* set up analog triggering on an otherwise-unused analog input task, and then use that to drive your analog output task.  You'll get the same net effect, you just have to "waste" an analog input task to get there.

 

Hopefully the snippet below can get you started.  Note that the trigger property node "Start.Term" actually refers to a special internal *digital* signal that pulses once internally to indicate that the task's start trigger condition has been met.   Also note that you should need to start the AI task *last* so that the AO task is ready and waiting when the AI task asserts its internal trigger pulse.

 

 

-Kevin P

 

analog trigger for ao.png

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 7
(2,358 Views)

Thank you for the reply, Kevin. When trying your scheme, I get error -200452 at the property node "Specified property is not supported by the device or is not applicable to the task."

0 Kudos
Message 3 of 7
(2,302 Views)

Hmmm, i don't have a similar hardware device to test on, so how about instead of querying for the AI task's start trigger terminal, you instead wire the following terminal constant to your AO task's trigger config.  (Change the "Dev1" part if needed to match your device.)

 

Kevin_Price_2-1596508580559.png

 

 

-Kevin P

 

 

 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 7
(2,286 Views)

No, it didn't work either:  error -200265 "An attempt has been made to use an invalid trigger source."

0 Kudos
Message 5 of 7
(2,265 Views)
Solution
Accepted by topic author silver356b

At the end of work today I took a few minutes to try things out on a PCI-6115, which I *think* is part of the same product family.

 

It never worked to query the property node for the StartTrig.Term.

 

Specifying the terminal constant "/Dev1/ai/StartTrigger" as the AO trigger source gave me error code -200262, which indicated that I wasn't allowed to set up triggering unless I *also* set up hardware sample timing (using calls to DAQmx Timing).

 

After setting both the AI and AO tasks up for hardware sample timing, the code ran without error on a PCI-6115.  I was able to trigger the AO task from the "/Dev1/ai/StartTrigger" signal.   See attached code, version LV 2016.

 

 

-Kevin P

 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 6 of 7
(2,251 Views)

Ha! That worked. Thank you Kevin for your help.

 

0 Kudos
Message 7 of 7
(2,220 Views)