You must be careful in deciding how fast you want the I/O Scan to run because it runs in a high-priority thread. The Scan Period must be long enough for the Scan Engine to scan all the I/O variables and for the CPU to execute any code running in timed loops synchronized with the Scan Engine. If you select a Scan Period below 1 ms, the system can become unstable. If that happens, you can lose communication with the controller or device, or the Scan Engine may not have enough time to read and write all of the I/O.
There are a few things you can check to determine whether the system has enough resources to run your application at the speed you require.
You can use the NI Distributed System Manager or the RT Get CPU Loads VI to determine what percentage of the CPU capacity the controller or device is using. Check CPU usage without an application running to see how much CPU capacity is left for your application.
The Percent Hardware Scan Utilization I/O Variable indicates what percentage of the allotted time for data transfers is taken up by scanning I/O. If the percentage value reaches 100, a fault will occur. You can either use the NI Distributed System Manager to monitor the variable or read the variable programmatically.
You can monitor Scan Engine faults to determine whether modules are being scanned quickly enough for your application. You can configure a fault to stop execution if that is appropriate for your application. Look for the following fault.
|-65512||The data transfer for some I/O Variables on this target could not be completed in the allotted time and the updates for some values may have been delayed. Increase the Scan Period to avoid this problem.|