I am having trouble with DAQ Assistants used for sending and receiving a Gaussian modulated sine pulse though piezoelectric actuators attached to an aluminum plate. I have two DAQ assistants, the first one generates a pulse and sends voltage to actuator 1. The second DAQ assistant measures the voltage given by vibrating actuator 2.
How do I ensure synchronization (in time) among the two DAQ assistant outputs? I get time vs voltage plots for both in excel (see attached). But the time for input DAQ seems to be later than time for the output DAQ. Ideally, I would like both DAQ assistants to "start at the same wall-clock time" - "do their job" - "stop after a few hundred micro-seconds" - "write sent/received data to a file".
I have attached my VI below.
Thanks in advanced.
In your earlier post about sending and receiving a Gaussian Modulated Pulse, LocalDSP suggested "Check out the DAQmx examples (Help>>Find Examples... menu). These examples are based on DAQmx VIs rather that DAQ Assistent) and gives you more freedom to control your timing and triggering."
The Dreaded DAQ Assistant is, maybe, OK if you want to do something really, really simple, know very little LabVIEW, and want a Quick Fix. If you really want to do something serious, perhaps synchronizing inputs and outputs, you need to learn a little more LabVIEW, get rid of the Dreaded DAQ Assistant (and its Evil Twin, the Dynamic Data Wire), and use the simple DAQmx Functions to handle your slightly-more-complex DAQ tasks.
A good place to start are the DAQmx Tutorials by NI (do a Web search for DAQmx Tutorials). This one is especially relevant. Note that synchronizing Analog Input with Analog Output might depend a bit on the hardware you are using, but you should be able to figure out how to synchronize input and output (you may need to delay (or advance) input in relation to output (that's why you try it out and measure if there is a phase difference between input and output).
I had a similar issue in the past with an older VI where I was performing high rate AO/AI sampling that required synchronization. Take a look at my older thread and you can see how I was able to sync both modules up.
In general, the trick is to use a 'Digital Start Edge' which references the AI module clock, during initialization of the AO module task. Also, like Bob says, DAQ assistant is a hard no-go unless you're trying to accomplish very simple tasks. Here is a screen-clipping of the section of code I am referring to.
Would you mind uploading your working vi? I want to look closer at the similarities in our programs so that I can modify my program adequately. Also, would you please upload it as a 2014 version of labview? I cannot open any newer version with my current version of labview.
I won't upload the entire VI as much of it is irrelevant to what you're trying to accomplish. Here is a reduced version that has the segment that pertains to you (LV version 14.0).