|Download Help (Windows Only)|
Parent Topic: Customizing the Custom Device Driver
You can configure an asynchronous custom device to run synchronously with the rest of NI VeriStand by configuring the custom device to use the same timing source as the Primary Control Loop (PCL). For example, NI VeriStand can use a DAQ device as the timing source for the PCL. You can configure the RT Driver VI of your asynchronous custom device to use the same timing source.
When you synchronize your custom device to the PCL, your custom device will not delay PCL if it finishes late.
The following example illustrates the code required to synchronize an asynchronous custom device with the PCL.
The previous block diagram shows the Set Loop Type VI added to an Initialization VI and configured to allow you to synchronize the asynchronous custom device with the PCL. First, the Loop type input specifies that the custom device will use a Timed Loop, which then allows you to set the Use Device Clock (Timed Loops only) input to TRUE. When this input is TRUE, NI VeriStand passes the timing source from the PCL to the Device Clock control in the RT Driver VI.
|Note You can add and configure the Set Loop Type VI in any VI for configuring the custom device, such as a page VI. For example, if you want a user to be able to specify whether or not to synchronize the custom device to the PCL, you could add and configure the Set Loop Type VI in the Main Page VI of the custom device.|
The following step shows you how to configure your RT Driver VI to use the Device Clock control as the timing source for its Data Loop.
The previous block diagram illustrates an asynchronous RT Driver VI configured to run in sync with the PCL. Before configuring your asynchronous RT Driver VI as shown above, you must change the device's Data Loop from the default While Loop to a Timed Loop. You can do this by right-clicking the While Loop and selecting Replace with Timed Loop The following list explains how to configure the Input Node of the Timed Loop:
|Note For asynchronous custom devices, the decimation only affects when the Primary Control Loop reads and writes the FIFOs it uses to communicate with the custom device.|