09-29-2017 02:52 PM
Hi Everyone,
I'm using Labview 16.0f2 and DAQmx (6341) to do triggering in/out and I'm having issues with getting things to occur in the order that I want them to. I'm trying to synchronize a camera and stepper motor. What I want to do is take a digital trigger in (indicating that the camera is ready), step an analog voltage (to the next motor position), then output a trigger (telling the camera to fire). Each of these things should happen in sequence. The issue that I'm having is that I'm only taking a step in analog voltage once for roughly ever 15-20 digital triggers in/out. This is illustrated in the attached oscilloscope image -- the yellow trace is the digital trigger in, the blue trace is the digital trigger out, and the purple trace is an example voltage step. What am I doing wrong--how do I synchronize both of my triggered events?
Thank you!
10-01-2017 07:04 AM
Is this really one of the Examples that ship with LabVIEW? Which one?
Some general comments:
Bob Schor
10-02-2017 09:31 AM
The main issue you have is that your AO task is software-timed, only updating as fast as your loop can iterate. Your retriggerable pulse is hardware-timed, and can react at hardware speeds much faster than your AO task.
Call DAQmx Timing.vi in your AO task config and specify the external trigger signal "/Dev1/PFI1" as the 'source' input wire. You'll then also need to pre-compute a buffer of AO values and write them to the AO task *before* you start the task (and before you enter the main loop).
But the essential thing is to make sure the timing of both your output pulse and your AO are being timed by the same external hardware signal.
-Kevin P