05-14-2025 06:19 AM
Hi NI Community,
I am new to LabVIEW.
I’m using a USB-6351 with LabVIEW to capture voltage signals from two channels. Each signal has a pulse shape at around 40 Hz, and I want to capture the waveform from 2.5 ms before to 2.5 ms after the trigger point. To do this, I’ve configured the acquisition using a reference trigger.
However, the system is only achieving about 3 acquisitions per second, which is far lower than expected for this application.
My Questions:
Is reference triggering the appropriate approach for capturing many repeated short-time windows around frequent triggers?
How should I modify the code?
I’ve uploaded my LabVIEW code for reference.
Thank you very much for your time and help.
05-14-2025 07:02 AM
Most community users don't have the latest version of LabVIEW. Please save your VI to a previous version, preferably 2019.
05-15-2025 07:37 AM
I can't look at the new-version code, but here's an educated guess:
You need to trim down any DAQmx task overhead in your loop. The best practice is to create and configure the task once only before the loop, NOT inside the loop. Then *also* call DAQmx Control Task to set it to the "commit" state before entering the loop. (This will optimize the turnaround time when you subsequently need to stop and restart the task. Search on DAQmx State Model for more info.)
Inside the loop you should only Start, Read, and Stop the task. I would also recommend a Producer/Consumer pattern so that the data from your Read gets deferred to parallel code for further processing. Keep the DAQmx loop lean & tight!
-Kevin P
05-15-2025 03:22 PM
Small addendum: past experience teylls me that doing this with a USB-connected device will likely limit the turnaround speed compared to the same kind of device in a desktop PCIe slot. Dunno how *much* with your particular device though.
-Kevin P