LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ multiple signals reading time synchronization

Solved!
Go to solution

Hello everyone, i have an aplication that read signals by 1khz sampling frequency. Hw is cDAQ 9184. Multiple voltage signals by 3 cards 9215 and 2 counters by card 9422.

I suspect that the signals are offset in time relative to each other by up to 100 ms. Time shift is random with every aplication start. Could someone please check the time synchronization and the task execution sequence (see attachment) in my program. Sw used is Labview 2015 SP1.

 

I declare tasks in a single vi. Clock generator task to run dummy task on ctr1 of card 9422, that create clock source for other signals aquistion tasks.

Ai voltage task, counter 0 and counter 3 task, all have the same clock source frome above (/cDAQ9184-510665Jihlavan/Ctr1InternalOutput)

rychlyjakub_1-1670917091016.png

 

 

 

 

Start of clock Generator is set imediately after vi end

rychlyjakub_2-1670917212544.png

 

 

Start of remaining signals tasks is run in data aquisition vi. DAQ Start is executed only once by First call bool on case structure input in the first frame, second frame is just waiting for enough data (500 per channel), third frame Reads data.

rychlyjakub_3-1670917294161.png

 

 

Thank you for any suggestions .

 

0 Kudos
Message 1 of 4
(686 Views)
0 Kudos
Message 2 of 4
(658 Views)
Solution
Accepted by rychlyjakub

Hello,thanks for reply,

 

I modified my task creation little bit. I disconnect following terminals from DAQmxTiming.vi :"source", "active edge" and "samples per channel" 

and keep only "sample mode", "task/channel in" and "rate". Is it OK? I have problem with testing, because i am currently out of rech from hw platform that is already by our customer.

 

rychlyjakub_0-1671006518486.png

 

Next I Modified data acquisition vi. I found in article (https://www.ni.com/docs/en-US/bundle/testscale-feature/page/start-trigger-signal.html) that it is possible to use "Counter n Internal Output" as a source of trigger.

 

rychlyjakub_1-1671006898594.png

Is it OK?

 

Also can you please explain me, what is the purpouse of DAQmx Start task.vi. In NI help is desribed that it is used to begin measurement but probably calling it for 3 tasks without trigger deffinition (as i had in old solution) is not enough to synchronize all 3 tasks.

 

Also if i understand it right, if actualy trigger come before i call "DAQmx Start task.vi" meassurments never starts? (It shouldnt be this situation because trigger Ctr1InternalOutput that i used still rising and falling)

 

0 Kudos
Message 3 of 4
(648 Views)

And also I should probably start task "Clock generator" (which generates source trigger) after i started tasks for data aqusitions othervise i may start data aquisitions before all tasks are running. Right?

0 Kudos
Message 4 of 4
(641 Views)