During a single scan loop or cycle, the transfer of the EtherCAT packet, or I/O scan, must be synchronized between the master controller and NI 9144 slave chassis. During the I/O scan, the master sends out a packet with new outputs and instructions for the slaves, and the slaves return the packet with new input values for the master. Using the updated data from the EtherCAT packet, the master begins the program scan and the NI 9144 chassis begin the slave update. The program scan is the time the master takes to process data and run the LabVIEW program. The slave update is the time the slave uses for DMA transfers, data processing, and I/O updating. Therefore, the minimum loop rate is limited by either the program scan or the slave update, depending on which one takes more time.
Figure 4. Scan Cycle Timing Diagram
The program scan time increases with the number of slaves and I/O on the network because the master controller has more data to process. However, the slave update time does not increase because the slaves update their I/O at the same time in parallel. Therefore, the more slave I/O on the network, the more likely the master’s program scan becomes the bottleneck. If your application involves a high I/O channel count, consider using a high-performance controller such as PXI for the master.
Figure 5. CompactRIO and PXI Systems With NI 9144 Chassis
Master Controller Benchmarks
The default LabVIEW programming mode for the master controller is to run the NI Scan Engine, which is a component of LabVIEW Real-Time that scans single-point I/O values into memory at a user-specified rate. For the purposes of the master controller benchmarks, the amount of time it takes to run the user’s code is not calculated. Therefore, the remaining master benchmark component is the driver speed, which includes the amount of time the controller takes to transfer data between the NI Scan Engine memory map into the I/O variable. I/O variables are used to access data from the NI Scan Engine memory map, and each instance of an I/O variable node in a LabVIEW VI takes time to execute. The average execution time of each I/O variable node tends to remain constant even as the number of nodes on the block diagram increases, and the chart in Figure 6 displays this execution time for certain master controllers. Based on this data, the average execution time per I/O variable node is approximately 8 µs for the NI cRIO-9074 integrated system, 3.5 µs for the NI cRIO-9022 embedded real-time controller, and 0.3 µs for the NI PXI-8106 dual-core embedded controller.
Figure 6. Average Execution Time per I/O Variable Node
Note: This is not a complete list of all compatible NI controllers. See the Deterministic Ethernet Product Selection Guide for more information. In general, the more powerful the processor, the faster the I/O variables are executed.
Slave Device Benchmarks
Customers often ask for the maximum number of NI 9144 chassis that they can daisy chain from the master controller. Theoretically, the EtherCAT protocol states that the maximum number of slaves in one network is 65,535 devices, but having that many devices controlled by one master controller significantly slows down the scan rate and most likely is best implemented with multiple masters instead. In reality, the number of I/O channels, not the number of slave devices, has more impact on the system scan rate from the master side. As seen in Figure 4, the master’s program scan increases as more data is pushed over the EtherCAT network, typically overshadowing the slave update time. Therefore, despite the amount of overhead added for each slave device, 300 I/O channels divided among two or 20 NI 9144 chassis have approximately the same system loop rate.
Combined System Loop Rate
Table 1 combines the benchmarks for the master controller and the NI 9144 to form the minimum cycle time, or system loop rate.
Minimum Cycle Time = Driver + EtherCAT Network + I/O Updates
Note that these benchmarks do not include the amount of time the user’s code takes to run, so add the appropriate time for the code and see the related links below for more information.
Table 1. System Loop Rates
Based on the tests for these two controllers and four different I/O modules, a benchmarking spreadsheet called system_loop_rate_chart2.xls is attached at the end of this white paper to help you approximate the system loop rate for your configuration. Simply enter the number of analog and digital I/O channels you are using as well as the approximate time for running the LabVIEW code to calculate the system loop rate. Remember that these formulas are based on a specific hardware setup, and results may vary when using other I/O modules.