To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI demonstrates how to continuously acquire and generate data at the same time, synchronized with one another.
Description
There are many applications which require synchronization between analog output and digital output tasks. The attached VI, for instance, shows how to output a pulse exactly when the analog output signal goes above 4.5V or when it goes below 0.5V.
In LabVIEW, this is as simple as sharing the clocks between the two tasks, and making sure that they start at the exact same time using same kind of trigger. The attached VI titled Sync AO and DO.vi does this by specifying the AO Sample Clock as the Sample Clock for the digital output Task, and by creating a digital start trigger for the analog output task. When the start trigger is received, both tasks start running at the exact same time, and run in a synchronized fashion until the user stops the VI. The pulse trigger is created in the VI using a Counter Output Pulse task.
To verify that the two output signals are synchronized, use the attached Acq&Graph Voltage-Int Clk-Dig Ref-Analog&Dig.vi and connect the analog and digital output waveforms to the appropriate analog input channels.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
This post describes exactly what I want to do: generate an analog output along with a digital pulse which is synchronized with that AO task much in the same way a benchtop arbitrary waveform or function generator has a SYNC output line next to the main waveform output.
Problem is, the source code attached to this post fails when I run it. I'm using a USB-6211. The error I get is:
Error -200077 occurred at Property Node DAQmx Timing (arg 1) in DAQmx Timing (Sample Clock).vi:4730003->Sync AO and DO.vi
Possible reason(s):
Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.
Property: SampTimingType
Requested Value: Sample Clock
You Can Select: On Demand
Task Name: _unnamedTask<16>
Does anyone know of a fix for this code, or an alternate apporach to acheive the same goal? I just want this USB device to be able to replace my existing 2-ch arb waveform generator with SYNC output. (I need both AO channels for separate analog signals, so I can't use one of the AO channels as a pseudo-SYNC signal by programming a 5V square wave into its buffer.)
Hi, I have the same problem.
Anyone knows why? I am using pci-6110.
Thanks in advance.
John