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 all 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 high I/O channel count, consider using a high-performance controller such as PXI for the master.
Figure 5. CompactRIO and PXI Systems with the NI 9144 EtherCAT slave 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 the LabVIEW Real-Time Module 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 consists of 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 simple click-and-drag variables used to access data from the NI Scan Engine memory map into the LabVIEW programming environment. Each instance of an I/O variable node in a LabVIEW program takes time to execute. The average execution time of each I/O variable node tends to remain constant even as the number of nodes in the programming environment increases, and the following chart displays this execution time for certain NI 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 EtherCAT-compatible NI controllers. See the NI Product Selection Guide for EtherCAT 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 slave 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 a greater 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 twenty NI 9144 modular chassis have almost the same effect on the system loop rate.
Combined System Loop Rate
Table 1 combines the benchmarks for the master controller and the NI 9144 slave 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 for the cRIO-9074, cRIO-9022, and PXI-8106 Master Controllers
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 entire system loop rate if you are only using NI hardware and software for your EtherCAT network. Simply enter the number of analog and digital I/O channels you are using in the NI 9144 modular chassis 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. Also, this does not include any time added by the I/O modules in the master controller's local chassis or backplane.
NI Scan Engine Performance Benchmarks