11-08-2016 10:40 AM
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:
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
11-09-2016 03:21 AM
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.
11-09-2016 02:55 PM
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.
Than you for your help
11-11-2016 12:26 PM
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.
11-11-2016 01:40 PM
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
11-15-2016 06:49 PM
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?
11-20-2016 09:19 PM
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
11-22-2016 02:54 PM
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.