Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronize DAQ analog output with the digital output of my camera

Hello,

I am new with the utilisation of a DAQ instrumentin Labview.

Right now I am trying to synchronize an analog output with a digital input. I have a camera that will send a digital output of 5V during acquisition and I would like to use that output as a trigger for my analog output of my DAQ.

From the example I found, I was able to make a VI that send an analog output on the trigger of the digital input. However, I have a hard time figure out:

  • How to synchronise the end of the analog output with the end of the digital input. With this VI the analog output only stay “on” for one period. I would like if the analog could stay “on” until the digital input goes down to 0. I have tried to add a second trigger function with as reference the same digital input as the first trigger function, but I get an error.
  • The VI right now only trigger once. I would like if it could trigger continuously. The camera will capture continuously some image and I would like the analog to go on and off on the digital output of the camera.

I would appreciate any advice or example that could help me.

I use Labview 2014 with a DAQ model NI-USB-6351

Thank you for your help

0 Kudos
Message 1 of 8
(4,054 Views)

Hi Kastaa,

 

If you open the "Voltage - Continuous Output" LabVIEW example you will see that you are able to configure something called "Digital Pause". This way you will be able to generate only when the digital singnal from your camera is high.

0 Kudos
Message 2 of 8
(4,023 Views)

Hello Stockson, 

Thank you for your advice, I take a look at the example you suggest and try to incorporate the digital pause into my VI but it didn't do what I expected. With this VI the analog signal is now generated at random moment totally out of sync with my digital input and I'm not sure to understand why. I joined a picture to show more precisely what I'm trying to do. 

signal.PNG

 

 

Than you for your help

0 Kudos
Message 3 of 8
(4,006 Views)

Hi Kastaa,

 

Could you clarify what you mean by a "random moment totally out of sync"? Particularly, do you mean that it is completely random when the analog output occurs, or that the analog input is occurring at the opposite times that you expect it? I ask because you currently have the VI set to pause when the trigger is high. From what you originally described, you want the signal to be paused until the signal is high. So I would expect you to be seeing the exact opposite behavior of what you want.

 

Also, it might be helpful to have a chart of what you are getting, in addition to the chart of what you expect.

William R.
0 Kudos
Message 4 of 8
(3,976 Views)

Hi GiantDeathRobot

 

Thank you for your reply,

 

Sorry for the high trigger, it was a mistake I made before I sent the VI, I usually put it in low trigger. As suggested, here some picture taking at different time of the signal I get with the VI right now.  Yellow line is my analog output and blue line is the digital input that I simulated for the moment with a function generator (hardware) with a square wave of 100Hz. As you can see the analog output is out of sync with my digital input. Another problem I’m not sure to understand, the analog output only last for one period of the frequency input on the timing clock. Since I input a frequency of 1000Hz on my clock, I get an analog signal that stay on for 1ms. I would like if the analog output could stay on as long as my digital input is high (If I don't know my digital input frequency).

 

Thank you for your help

 

Karl 

0 Kudos
Message 5 of 8
(3,969 Views)

Hi Karl,

 

Looking over the code again, it looks right to me. I'll have to get some hardware and play with it. That said, is there a particular reason you're using an analog output to send out a constant voltage? Or is this just a simplified example?

William R.
0 Kudos
Message 6 of 8
(3,925 Views)

Hi GiantDeathRobot,

 

Sorry for the delay of my response. I use an analog output since the output voltage may take different values depend on the user input.

 

Karl

0 Kudos
Message 7 of 8
(3,897 Views)

Hi Karl,

 

Got it. Looking over what we've got for information, I don't think you're going to be able to do this on a USB multifunction DAQ. Based on the way our DAQ devices work, you have to define the output and load it on the DAQ device ahead of time, so you can trigger it. Windows and USB are particularly non-deterministic, so your jitter is going to be pretty bad. Adding up the time to determine when the change happens, load up the new output, and reconfigure the trigger, and accounting for jitter, you'd need to have a very slow digital signal to do a reliable logic level translation. (We're talking pulse widths in the 0.5 second range.) 

 

You could do it with a USB R-Series RIO, like a USB-7854R. That would be able to do exactly what you're looking for with very little latency. However, you might find it more cost effective to wire up a multiplexer to a digital output, and a couple logic-level convertors to do the actual work.

William R.
0 Kudos
Message 8 of 8
(3,882 Views)