LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different Sample Rates in the same VI

Hi there, 

 

I am attempting to sync data capture between two devices using the VISA serial tool. One device samples at 5000 Hz and the other at 4000 Hz, I would like to be able to start data collection at the same time to make the post processing easier. 

One device has an internal timestamp and the other does not, so I have been using the 'Format date/time string' to timestamp both sets of data to make it consistent. 

 

My question is, can I have both of these loops in a single VI, with a single boolean that starts data collection? (I have tried having a boolean in one loop that starts collection and created a 'local variable' [changed to control] of this boolean to have in the other loop)

 

When I have the equipment connected the loops seem to run at the slower of the sample times, but to test the VI without the equipment connected you can see the iterations of each loop are running at their own sample times (4000 & 5000 Hz). 

 

Many thanks, 

Dan

 

0 Kudos
Message 1 of 4
(926 Views)

Please describe more about the devices you're using. Typically, synchronization is implemented at the hardware level using triggers and clock sharing. The method you're talking of is just the software side of synchronization which is never reliable and you may not achieve your goals in this fashion.

 

Though you try to timestamp the data, it is timestamped when you read in the software but not when the device actually acquired the sample, this already adds communication delays and any execution delays due to OS or code implementation.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 4
(919 Views)

Thank you for your response. 

 

One of the devices is an IMU that like you say has a hardware timestamp. 

The other is an autocollimator that only provides angle data, so does not have the capability to provide a time stamp. 

 

My thoughts were, if I use a software timestamp then at least they will be the same for each device?

 

Thanks, 
Dan

0 Kudos
Message 3 of 4
(915 Views)

Could you please be more specific about the IMU and the autocollimator, and perhaps share their datasheets/manual?

 

This will help the forum members to check if there is a way to synchronize them at the hardware.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 4
(889 Views)