From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

DAQ Timing Issues Using USB-6341

Solved!
Go to solution

I need help synchronizing my DAQ IO signals properly. What I am trying to do is move two galvo motor with mirrors attached incrementally (4-100 points) in sync with a laser diode signal. Picture pointing a laser pointer at a mirror and moving the mirror around while holding the laser pointer stationary; that is the broad view of my setup.

 

I want to send a laser pulse signal once for each incremental movement of the galvo mirror, no more no less. I have breadboarded a PWM trigger signal that I am using to both turn on and off the laser AND move the galvo. The signal is 200-300 Hz, where the HIGH time is always 350us. Only the low time changes when switching frequencies.

 

My DAQ IOs are:

  • 2 analog outputs (ao0 and ao1), each wired to the galvo mirror to select position
  • 1 digital trigger input (PFI0) that is wired to the aforementioned PWM trigger signal
  • 1 digital output (p0.0) to turn on/off the trigger board

 

I am able to successfully get everything working in sync, but am always getting one extra pulse due to a timing delay on the trigger on/off signal. The DO I am sending to turn the trigger off takes anywhere from 3-7ms extra, causing for extra unwanted pulses coming from the laser after the mirror has stopped moving.

 

Here is a picture of the main loop of my code as well as a scope photo of my signals.

ianscandela_0-1608592185627.png

 

ianscandela_2-1608591784561.png

Signals above are:

yellow = trigger signal (PFI0)

blue = trigger on/off signal (p0.0)

green/purple = two galvo mirror signals (ao0 and ao1)

 

In the scope photo I am trying to run a total of 4 pulses, but the trigger does not stop until 5.44ms after the fourth trigger pulse, and I end up getting an unwanted pulse from the diode. This 5.44ms varies +/- 2ms each operation.

 

If anyone has any suggestions as to how I can turn the trigger signal off more quickly I would be so grateful!

0 Kudos
Message 1 of 3
(1,057 Views)
Solution
Accepted by topic author ianscandela

Well, you could just generate that "PWM trigger" signal with one of your 6341's onboard counters.  Then you can set it up with the high/low time combo you want, and configure it for Finite Sampling and exactly 4 pulses.  And you'd no longer need that software-timed DO task that can't perfectly sync with the hardware-timed AO task anyway.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 3
(1,034 Views)

Thanks, this worked. To anyone interested, here is what I ended up with:

 

ianscandela_0-1609183185865.png

 

0 Kudos
Message 3 of 3
(989 Views)