From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

How to synchronize analog input acquisition and do and output to digital I/O milliseconds later?

Solved!
Go to solution

I am performing an analog acquisition with a NI USB-216. It is started using an Daqmx StartTrigger.vi, set for digital edge, on PFI2 (I am externally triggering the acquisition). This part works fine.  As the AI acquisition occurs I need to control one digital I/O line several milliseconds after the acquisition starts. The timing need to be precise. I wish to use the start of the analog acquisition for the start of a millisecond timer (T0), then after several milliseconds set a Digital line high. I can't seem to find a proper working way that would allow me to do this. I tried using StartTrigger.vi setting it for digital edge on PFI2. That didn't work, Also tried using ExportSignal.vi to export setting input as "StartTrigger" and directing it out to PFI15 which is hardwired to another port line which I try to read but could'nt get that to work either. Seems I would need to run that in a loop to keep reading the port and I didn't want to do that. Any help would be appreciated.

0 Kudos
Message 1 of 3
(2,772 Views)
Solution
Accepted by topic author BrianSw

You could define a single pulse generation task on one of your counters, using the same Start Trigger from PFI2.  Then your digital output will be timed very precisely by your daq hardware.

 

 

-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).
Message 2 of 3
(2,710 Views)

I've read about doing it that way, was thinking there was a simplier way to do it. But, this is acceptable and should work fine. Thanks...

0 Kudos
Message 3 of 3
(2,701 Views)