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.
Solved! Go to Solution.
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.
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."
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.)
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.