LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI6341 common starting trigger for AO and IO

Solved!
Go to solution

Hello,

 

I use NI PCIE 6341 DAQ to output a digital signal and an analog signal, but there is alway some delay between each other when initializing. I am wondering if it is possible to set up a common software starting trigger to have those two channels start output at the same moment? How to do that with the counter clock?

 

Thanks.

0 Kudos
Message 1 of 7
(2,921 Views)

Sure.  There's lots of ways to sync the AO and DO task outputs, let's look at 2 ways that use a counter.

 

1. (To be used if AO and DO are at the same rate).  Configure both AO and DO tasks to use a counter pulse train as their sample clock.  Start AO and DO tasks first, then start the counter pulse train task.  By sharing a sample clock *and* starting the clock after starting the AO and DO tasks, samples will be sync'ed without need for a trigger.

    In LabVIEW, you can query the counter task for its pulse output terminal using a DAQmx Channel property node.  You can then wire this to the 'source' input for the DAQmx Timing calls on your AO and DO tasks. 

 

2. If AO and DO are at different rates you can still sync their start times with a trigger.  Configure both AO and DO tasks to use a counter pulse as their start trigger signal.  Start AO and DO tasks first, then start the counter pulse task.

 

 

-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 7
(2,901 Views)

Once you get the two tasks starting together, do they need to stay synchronized to each other?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 7
(2,863 Views)
Solution
Accepted by topic author utoct

Hi utoct,

 

Other members left good responses. The following articles offer good documentation on start triggers with NI-DAQmx.

 

Timing and Synchronization Features of NI-DAQmx

Synchronizing Analog Input C Series Modules with NI-DAQmx in LabVIEW

 

You can use a flat sequence structure to get the channels to start fairly close together depending on your project needs.

 

If you you need something more precise and you can use the same rate, then you can set the sample clock of the slave to be that of the master. By starting the master after the slave, the two channels will start on the same trigger. 

 

Regards,

David F.

Applications Engineering

National Instruments

www.ni.com/support

Message 4 of 7
(2,853 Views)

Yes, they need to be synchronized. The problem has been resolved. Thanks.

0 Kudos
Message 5 of 7
(2,839 Views)

Yes. What you said in the last paragraph works.

I set DO's sample clock as AO's, then delay the start of AO. Note that if the delay is not sufficiently long, there would still be jittering between two channels at the beginning.

 

Thanks.

 

BY 

0 Kudos
Message 6 of 7
(2,837 Views)

Glad to hear.

 

I would wire the error wire of the error output of the DO start task to the error input of the AO start task. This will force the AO task to start after the DO task. 

 

David F.

Applications Engineering

National Instruments

www.ni.com/support

0 Kudos
Message 7 of 7
(2,819 Views)