01-24-2025 06:14 AM
Hello, it has been a while!
I have noticed for a while now, in my current VI, that I have sometimes rather large lags between starting starting my DAQ and my laser starting irradiating. I tried to synchronize the laser firing with the DAQ by wiring a "result" function from my laser VI - which states "0" when everything is ok and the laser wil start firing - into a boolean that will start a "True" case event. Inside that case event is a While loop used to make sure that all the data is collected and that the collection stage is finished once the "Get Scan Status" gets a "False" indicator, which will exit the while loop and immediately stop the DAQ Task.
A couple of days ago, I was surfing the Forum for ideas on how to improve this, and I came across a suggestion of using a Producer/Consumer loop, but I unfortunately I lost track of it. Is such a process architecture feasable here? The timers are inserted there to measure how much time it takes to go from frame to frame in this VI.
Any suggestions on how to improve synchronization between the DAQ and the laser start/stop events would be greatly welcome.
Cheers,
Fl0.
01-24-2025 11:41 AM
Well, how closely synchronized do they actually need to be?
In most cases, it's best if you can link them both together using the hardware of the DAQ itself. Either a hardware trigger that signals the start of the DAQ capture directly, or by capturing 2 or more DAQ channels at the same time, where at least one of those channels contains something you can use as an indication of your start time.
It looks like right now you're using software timing under Windows. In the best of conditions you'll sync up a few milliseconds apart, but because Windows and PC hardware are largely parallel and can be paused at any time by high priority system processes and the like, it's very tough to guarantee any sort of sync closer than 1 second when using two separate devices.
Even if you do get it to reliably send a signal to both devices within a millisecond of each other to start, devices may have a ramp-up time that you can't directly control either. I use lasers myself and often the drivers for these have a built-in delay after sending the start signal to them. NI DAQ devices can also have a delay in them, especially if they're set up to start capturing as soon as a task starts, instead of having a separate start task and trigger event.
01-24-2025 09:26 PM
It is so frustrating to look at a "picture" of a fragment of LabVIEW code, where you can't closely examine anything, can't look outside the margin of the image. We also don't know what hardware you have (what is your "DAQ" -- I'm assuming it is an A/D converter, but what model?
What is your hardware? What is your Operating System? What is your version of LabVIEW?
Please provide us with a lot more information. Sampling two channels with a single multi-channel A/D converter is something generally easy to do in LabVIEW, but maybe your hardware is not compatible with the "task requirements" of what you are trying to do (but you don't provide the necessary details).
Bob Schor
01-27-2025 02:09 AM
Hello,
Thanks for your feedback so far. I have attached the VI file to this thread.
Regarding the setup, I am using Windows 11 with Labview 2023. My hardware is a pair of SRS 830 lock-in amplifiers with their X and Y output analog channels connected to a NI-6210, and a Daylight Solutions MIRCat laser. The idea is to synchronize the readout of the lock-in amplifiers as soon as the laser starts shooting, so that the voltages obtained are matched to the laser wavelength. I always had problems with the start synchronization, but I always managed to stop the system in the end at the same time, so to overcome the synchronization issue, I started reading the data from the end to the beginning, in order to slice it properly and make proper accumulations/averaging. Unfortunately, I started noticing that the match isn´t sometimes proper and leads to the generation of "false peaks", which is just data with a slight time-shift.
Cheers,
Fl0