Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronous AO AI

I am attempting to write a VI to output a waveform voltage while synchronously measuring two voltages through seperate AI channels. I have found a sample VI under examples.

 

My problem is that the explination says that you must arm the AO before the AI to ensure they start at the same time. How can I have another AI channel run in parallel with the AO AI channels already configured. I have provided an attachement of this VI.  

0 Kudos
Message 1 of 7
(4,190 Views)

Hi Nick,

 

The large majority of our DAQ devices only allow for a single timed AI task to run at once since the AI lines use the same timing engine (the notable exceptions are the 9174 and 9178 chassis which have 3 AI timing engines available for use with multiple modules).

 

You may include multiple channels in your AI task but they must be triggered at the same time.  If you'd like you can have AI running continuously in parallel with AO and you could start the AI/AI and AO independently of each other.

 

 

Best Regards,

John Passiak
0 Kudos
Message 2 of 7
(4,182 Views)

I want both AI channels to be taking measurements when I start the AO task and to stop when this task is completed. I have almost no experience using the DAQ as I previously used the DAQ assistant. I dont understand how I can ensure that both AI start tasks run after the AO start task.

 

0 Kudos
Message 3 of 7
(4,165 Views)

The code you posted will start both tasks simultaneously.  AO is configured to use the aiStartTrigger as its own start trigger.  The aiStartTrigger is a hardware event that is generated when you call the Start function for your AI task.

 

To read from multiple channels at once, you just need to include the extra channels in your task and change the instance of DAQmx Read to "Multiple Channels":

 

Multi_Channel.png

 

Best Regards,

 

John Passiak
0 Kudos
Message 4 of 7
(4,153 Views)

John,

 

I have the same goal as the original poster in terms of syncing an AO waveform and two AI channels on a DSA USB-4431, with simultaneous input.  An added complication I have is that the two AI channels have different coupling states, one DC and one AC.  I have come across the error that states that two tasks can't share the same timing clock (I am guessing ai/startTrigger).

 

Thanks,

 

kmsk

0 Kudos
Message 5 of 7
(3,721 Views)

kmsk-

 

How are you trying to configure your channels?  You can create two AI virtual channels and place them in series so that you can use property nodes to set the coupling.  You would set up the synchronization the same way.  The ai/startTrigger is a trigger that occurs when the AI task starts; it's not a timing clock.  See the modified version of the Multifunction Synch AI-AO shipping example that I modified.

 

Hope this helps!

 

Thanks,

 

Sean

Applications Engineering Specialist - Semiconductor Test
National Instruments
0 Kudos
Message 6 of 7
(3,702 Views)

Sean,

 

Thanks for your reply.  I ended up creating a DAQ Assistant task and then converting to DAQMx code and looking at the DAQMx CreateTask.vi.  The implementation was exactly as you described and it works.

 

Thank you,

kmsk


@Sean_N wrote:

kmsk-

 

How are you trying to configure your channels?  You can create two AI virtual channels and place them in series so that you can use property nodes to set the coupling.  You would set up the synchronization the same way.  The ai/startTrigger is a trigger that occurs when the AI task starts; it's not a timing clock.  See the modified version of the Multifunction Synch AI-AO shipping example that I modified.

 

Hope this helps!

 

Thanks,

 

Sean


 

 

0 Kudos
Message 7 of 7
(3,691 Views)