Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger for simultaneous analog input and output with text-bsaed NIDAQmx

I am trying to perform a simultaneous analog output and input on a PCI 6251 board.  I would like the both the input and the output tasks to be triggered by a digital signal.  The analog output involves two channels, while the input task involves one channel.  I trigger the output task from a digital signal wired to PFI6 as follows (ExposeBeamTaskHandle is the ao output task handle):

 

status:=DAQmxCfgDigEdgeStartTrig(ExposeBeamTaskHandle, 'PFI6', Trigger_Edge);

 

This works fine by itself, and triggers as expected.

 

The question I have is if I start the analog task (ExposeAlignTaskHandle), can I trigger on the same PFI6 input, or do I need another input instead of "PFI6" in the line below?

 

status:=DAQmxCreateAIVoltageChan(ExposeAlignTaskHandle, PChar(AIChannel), '',
                      DAQmx_Val_InputTermCfg_Diff, -Image_input_voltage, Image_input_voltage,
                       DAQmx_Val_VoltageUnits2_Volts, nil);
status:=DAQmxCfgDigEdgeStartTrig(ExposeAlignTaskHandle, 'PFI6', Trigger_Edge);

 

 

Thanks in advance for your help!

 

0 Kudos
Message 1 of 4
(3,367 Views)

Hi Shiva,

 

This sounds right to me. A PFI line is a digital line that can be used to trigger any task you choose. If you choose to start the AI task manually, you can use the PFI6 line as the trigger to start AO.

 

Post back if this doesn't work for you.

Joey S.
Senior Product Manager, Software
National Instruments
0 Kudos
Message 2 of 4
(3,352 Views)

Thanks for your reply.  I am not sure you answered my question, which was: can I use the same trigger input (PFI6) to trigger both the ao and ai tasks at the same time?  I would like to start the ai and ao tasks at the same time with a single digital trigger.

 

0 Kudos
Message 3 of 4
(3,347 Views)

Yes, you should be fine sharing the same digital trigger to start multiple tasks. Post back if you have any issues.

 

This forum discussed a similar issue, and reported no problem off of the same digital signal, with a caveat for triggering off the same analog signal.

Joey S.
Senior Product Manager, Software
National Instruments
0 Kudos
Message 4 of 4
(3,342 Views)