LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How To Sync Timing of Encoder and Load Cell

Hello,

 

I have a code where I need to synchronize the timing of two different sensors (one analog and one counter), but I'm not fully certain on how to achieve this. I tried using the trigger that was used for the analog inputs, however it said that it wasn't supported when I implemented it into the encoder code. Any thoughts or ideas would be appreciated.

 

FaithPowell_0-1649631638575.png

 

0 Kudos
Message 1 of 4
(1,114 Views)

Yeah, counters are a bit of an "odd duck" in that counter *input* tasks can't use a regular ol' Start trigger.  Instead, they can only use a special, harder-to-find "Arm Start" trigger.

 

But in any event, I'd recommend that you use a shared sample clock to sync the tasks.  Configure the counter task to use the AI task's sample clock "/Dev1/ai/SampleClock" and use dataflow sequencing to make sure the counter task is started before the AI task.

 

Here's an incomplete example I once posted showing how to do that part of the configuration.

 

 

-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 4
(1,089 Views)

Thank you for the response! I do have one question. Would this also stop them at the same time? I need it to stop reading shortly after the encoder collects data so that it can be exported to excel and compared with the load cell data. 

0 Kudos
Message 3 of 4
(1,076 Views)

Also, is this what you meant by configuring the counter to the ai/sampleclock?

FaithPowell_0-1649693983986.png

 

0 Kudos
Message 4 of 4
(1,074 Views)