Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger and clock source confusion

Hi, i just started playing around with DAQ cards and i'm always confused with trigger and clock sources.

For eg, in the Gen Dig Pulse Train-Continuous-Dig Start.vi example it seems straight forward where ctr0 generates a pulse train based on the parameters given, fine. But what is this trigger parameters at the bottom? The default trigger source is Dev1/PFI9. What is this PFI9 doing? And to further add to my confusion the drop down menu for the trigger source has this huge list of options for me to choose from. How do i use this?

The same thing applies when i create tasks. Under the task timing there's this Advance clock settings. What is it and how do i use this?

I know the answer might be lengthy so if anyone can point me to any literature would be appreaciated too.

Thanks guys.
0 Kudos
Message 1 of 7
(3,508 Views)

Hi ATMA,

 

 

The trigger parameter at the bottom of the example program is a control to the DAQmx trigger VI on the block diagram. The shipping example ahs this set to a DAQmx Digital start trigger. This will prevent any pulses from being generated before a ‘trigger’ (change from ‘high to low’ or ‘low to high’) comes along. The change that you want to use is determined by the second trigger parameter control. Although ‘Dev1/PFI 9’ is the default, there are obviously many lines and options to use as a trigger.

Below are some great resources describing DAQmx, triggers, and timing.

Getting Started with NI-DAQmx: Main Page

 

Tips and Techniques in Data Acquisition Triggering - NI-DAQmx

 

Timing and Synchronization Features of NI-DAQmx

 
David L.
Systems Engineering
National Instruments
0 Kudos
Message 2 of 7
(3,487 Views)
Ah, i didn't notice the DAQmx trigger VI. No wonder i don't see any output on my oscilloscope, but after i remove the trigger VI i get a train output on my oscilloscope.

But in this case, if i were to use the trigger VI meaning that i would need an external clock to start the pulse right. Is it possible to have an AO pin externally connected to this pin to trigger the pulse? Or is there a way to internally trigger the PFI9 pin?

In the mean time i go through the links you gave me. Thanks David.
0 Kudos
Message 3 of 7
(3,479 Views)
I got it.

I wired the PFI9 pin to a DIO pin. The moment i HIGH the DIO pin in MAX i get a train output in my scope.
0 Kudos
Message 4 of 7
(3,477 Views)
In the 2nd link you gave me http://zone.ni.com/devzone/cda/tut/p/id/4322 in Figure 2, i can see the trick they use whereby they force the AI to use AO's sample clock Dev1/ao/SampleClock so that both ai and ao would be sampled in the same instance thus synchronized.

Expanding this, say i have 2 separate tests to run say torque measurement of a motor and position of it's shaft. I should be able to use the same method to have them use a same sample clock and (adding a trigger vi) same trigger source so that both measurements would be in sync with each other correct?
0 Kudos
Message 5 of 7
(3,475 Views)

ATMA,

 

I’m glad that the DevZone articles helped you. It looks like you definitely have a much better understanding of clocking and triggering.

I believe your statement is correct about the trigger and synchronization, but here is a bit more explanation to finish it out: The AI and AO can be synchronized by using the ao/sampleclock for the ai clock, and also using a start trigger for the analog output task. A start trigger prevents the clock from starting, hence not taking any samples, until the trigger has occurred. Since the ao sampleclock will not be running until the trigger occurs, and the ai task relies on the ao sampleclock, than putting a start trigger on the ao task will essentially start both tasks.

 

Lastly, for more examples on synchronization, you can view the LabVIEW shipping examples found in the example finder (Help >> Find Examples… >> Hardware Input and Output >> DAQmx >> Synchronization)

Regards,

David L.
Systems Engineering
National Instruments
0 Kudos
Message 6 of 7
(3,456 Views)
Thanks alot David, this would help me alot!
0 Kudos
Message 7 of 7
(3,451 Views)