Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Start Trigger for Analog and ArmTrigger for Counter task necessary?

Hey guys,

 

I am currently trying to aquire data from an analog input task (pressure sensors conncected to a NI 9205) and a counter input task (measuring flange for angle measurements on a NI 9411) in sync. I use the ai timebase of my analog task as a source for the sample clock of the counter input task for that. Since the counter input task is an optional feature of the data aquisition the syncing might be questionable but that is a topic for another day and the aquisition seems to be working fine for that.

 

Now i have a reference signal for my measuring flange, which will send a signal per revolution and want to start my measurement of the analog and counter task, when the signal has been detected. What I've done is using a start trigger with the DAQmx Start Trigger API for the analog task and a ArmTrigger for the counter using the PFI line the trigger is sent to.

ekcireg_1-1753269824399.pngekcireg_0-1753269803902.png

 

However when doing this the tasks do not seem to start at the same time, since the samples in the buffer for both tasks differ immensely and when writing the data to a tdms file the number of samples for a rate of 40 kHz differ by ~6000 samples.

 

Now i am unsure if this is a problem with my QMH Framework or if I am misunderstanding how syncing the tasks actually works when working with triggers. 

 

Currently I do not make sure that the Counter Tasks starts before the Analog task which was propositioned by Kevin [here], however I am unsure if this will fix the problem entirely, since when looking into it, it seems to me that the counter starts before the analog task. Thats why I wanted to ask if i even need the ArmTrigger for the counter task, if I use the timing source of the analog task and the trigger to start it and make sure the counter starts before the analog task?

Or if it is better to use the ai/StartTrigger source for the ArmTrigger to not have a delay?

 

Sorry if my wording is confusing, since I am not a native speaker.

 

Thank you in advance and I'll hope you'll be able to help me,

 

ekcireg

0 Kudos
Message 1 of 2
(59 Views)

Going back off grid in a couple minutes until next week. 

 

In the meantime,  it's probably a good idea to listen to that Kevin guy -- he sounds like he knows his counter timer stuff pretty good.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 2
(5 Views)