04-10-2022 06:06 PM
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.
04-11-2022 06:46 AM
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
04-11-2022 11:19 AM
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.
04-11-2022 11:24 AM
Also, is this what you meant by configuring the counter to the ai/sampleclock?