Long ago, I developed the habit of sync'ing tasks *solely* by sharing a sample clock. No triggers at all whenever feasible. This runs contrary to most advice you'll find about sync, but I find that triggers are often not needed, and sometimes add unnecessary complication and difficulty. Yours is such a case.
To *SOLVE*:
1. Remove all trigger-related config. It isn't needed.
2. Choose one of your AI tasks to act as the "master". It doesn't really matter which one, they'll all share the same sample clock, but you just need to know which one is playing the role of "master". Let's go with the one at the bottom of the diagram where you're already trying to share the sample clock with the counter task. Stay tuned, I'm gonna suggest a different method.
3. I'm not sure how the cDAQ system decides which task will use the "ai" timing engine, and which will use "te0", "te1", etc. Thus I'm not confident that asking for the ".../ai/SampleClock" terminal explicitly by name is the right approach.
In place of the subvi you have now, instead you should place a DAQmx Timing property node, and query for the SampleClock-->Terminal property. Then it won't matter which timing engine that particular task happens to be using.
4. Make sure your "master" task is started *LAST*. You did this correctly for the counter task, just expand the "Merge Errors" node so you can similarly sequence the other AI tasks to start before the master AI task.
5. Minor note: there's no harm but also no real benefit from the call to "reserve" the task I'm suggesting you use as master. You could get rid of that.
To *UNDERSTAND*:
On any NI DAQ devices I've worked with, Counter Input tasks (such as encoder measurement) can *NOT* use a regular Start Trigger. They can only be triggered by something called an "Arm Start Trigger", which can only be configured with a DAQmx Trigger property node. (FYI, counter output tasks *can* use a regular Start Trigger, in fact they be configured to use both kinds of trigger, a capability that I've actually seen a use for.)
Your attempt to configure an encoder task to use a regular Start Trigger is definitely one possible source for the error you report.
I just reviewed earlier replies in the thread. I'd encourage you to try the advice in the first reply from Cy_Rybicki (in msg #2) to configure all the AI channels into a single multidevice task. You'll still need to manually sync the Encoder task by sharing a sample clock. Your existing method with an explicit terminal name might work reliably then, or you can switch to the method I described for querying it.
If you can't do the multidevice task, then have a quick look at the link Cy pointed to in msg #4 -- it shows sync based *only* on a sample clock, no triggers, just as I was also suggesting. (It also specifies the sample clock terminal name explicitly, which might not be ideal on your cDAQ system.)
I honestly don't know why the other tutorial link *talks* about sample clock based sync but then shows code that also includes trigger config. I think that's been steering lots of folks wrong, thinking the trigger is necessary in a lot of cases where it isn't.
-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.