01-06-2010 02:28 PM
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.
01-06-2010 04:27 PM
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,
01-07-2010 07:51 AM
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.
01-07-2010 09:41 AM
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":
Best Regards,
09-16-2011 12:19 AM
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
09-19-2011 10:39 AM
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
09-19-2011 03:20 PM
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