Error -209836 in DAQmx Start Task on TSN-Enabled cRIO or cDAQ

Updated Oct 21, 2020

Environment

Hardware

  • CompactRIO Controller
  • CompactDAQ Controller

Driver

  • NI-DAQmx

I am using a TSN-enabled CompactRIO or CompactDAQ. When booting a start-up application, I receive DAQmx error 209836 with a message similar to the below:
The devices in your task cannot be synchronized. This may be because there are no available synchronization mechanisms between the devices.

Some synchronization paths are not available in interactive tools like the DAQ Assistant. To determine whether synchronization between these devices is possible, try deploying and executing your task in your application environment. 
Device: cRIO1 
Task Name: ai_9202s 
Status Code: -209836 

  1. This error appears due to DAQmx attempting to start a task before the synchronisation domain is complete, or where poor networking performance results in TSN not being found when the task begins. When DAQmx is started, it requires a synchronisation domain, even if it is only one device connected, and the TSN processes boot in parallel to a startup executable.
  2. To solve this error, create a loop to call "DAQmx Start Task" until the error -209836 is not called before continuing on with the rest of the execution. 
  3. Ensure that we only poll for error -209836 and add a maximum number of iterations so the device does not lock up if a different error occurs.

Example Snippet of how to call DAQmx Start Task until the error does not occur.