From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronous AI, AO, & CO Issue

Hi. I'm trying to generate two AO signals while generating a pulse at some specified rate (for use with a camera to capture images at a certain rate). At the same time I want to capture data from a single AI channel at the same rate as the pulse and output it to a text file. Physically this corresponds to a camera capturing an image in sync with a conductivity probe capturing a value. Everything also needs to begin at the same time, ie. AO, AI, and CO all start at the same time, with the CO and AI working at the same rate. Attached I have what I believe should work but it doesn't. What I did was attempt to combine the Multi-Function-Synch AI-AO.vi and Multi-Function-Ctr Pulse Train Generation for AI Sample Clock.vi examples found in the example finder along with my own waveform generation. Currently, the error I'm receiving is -200284 (some or all of the samples requested have not been acquired). If I change the clock source to OnboardClock the AI will collect data in a text file but no AO generation or pulse generation occurs. Does my code look correct for what I'm attempting to do? Also, please ignore the greyed out values in the second screenshot because I copied my VI to a computer without my NI device attached in order to take the screenshots.

Download All
0 Kudos
Message 1 of 2
(2,257 Views)

Hello,

 

Currently your code executes like this - first the AI and AO starts at the same time, and after that only the start of initialization of CO starts, which is not what we desire (to all AO, AI and CO start at the same type). The solution is to make same technique with CO as the technique you obtain in example Multi-Function-Synch AI-AO.vi:

 

- set the source of CO trigger to ai/StartTrigger -with this we achieve starting AI and DO tasks when AI triggers (when AI task starts).

 

- connect error wires from Start block of CO task, Start block of AO task and from Get Terminal Name with Device Prefix.vi of AI task to Merge Errors, and end from Merge Errors function to Start block of AI acquisition. This step will dataflow force CO and AO tasks to start waiting for AI trigger before AI - and as we know AI trigger will happen when the AI tasks starts; that is why we need to start other tasks (CO, AI) before AI task.

 

Now all the tasks should be synchronized.

 

 If there will be anymore questions or errors please fell free to ask.

 

Regards,

Gregor Cerne

 

0 Kudos
Message 2 of 2
(2,228 Views)