Real-Time EtherCAT Motion Control with NI cRIO and Embedded UI


DMC implemented an EtherCAT-based motion control and measurement system with configurable test sequencing using a cRIO-9038 with embedded UI.

Customer Benefits

  • High-speed data acquisition and control by leveraging the cRIO real-time processor and Kintex-7 160T FPGA
  • Precise motion control using EtherCAT to communicate with the Parker Drives from LabVIEW
  • Operator feedback and control through the embedded HMI, avoiding the added cost and complexity of adding a PC to host the UI
  • Configurable Test Sequencer for flexible and expandable application functionality


  • National Instruments CompactRIO-9038
  • National Instruments cRIO FPGA (Kintex-7 160T)
  • cRIO Embedded UI
  • EtherCAT
  • Parker Brushless Servo Motor (MPJ0922R8D)
  • LabVIEW Real-Time
  • NI 9219 - Analog input 24-bit
  • NI 9229 - Analog input +-60V
  • NI 9203 - Analog input +-20mA
  • NI 9264 - +- 10V Analog Output


DMC’s customer needed a way to tightly synchronize the motion of two Parker motors, while also acquiring data at high speeds and controlling other digital and analog outputs in real time. DMC’s solution followed a phased project approach that aimed to accomplish each major system requirement in the order of its importance to the system.

DMC started with the motion control, as this was essential to the project’s success. DMC developed and validated a driver set for controlling a single motor using the Ethernet communication protocol. This driver was then applied to the other motor, and independent speed and position movements were proven out on the system. The next major requirement was synchronous control of both servos. Using the driver sets previously mentioned, DMC proved out tight synchronous control of the two servos that met the system requirements for precision without resorting to mechanical gearing of the servos.

Once the motion control software was complete, we developed an application to integrate the motion control with the other major IO of the system, which include analog and digital inputs and outputs. A screenshot of the application is below. DMC built the user interface leveraging the cRIO’s embedded user interface, which saved the cost and complexity of using a PC to simply host a user interface for the system. A separate thread handles any user interaction by constantly listening to any activity from the UI.

User Interface for Motion Control and Major IO Application

Logging of real-time data was added to the cRIO so that the client’s engineering team could review the data in post-processing. To log data at fast rates, DMC chose a TMDS file format for quick and efficient data streaming to disk. This efficient streaming is important when logging is done on a cRIO rather than a PC, as the cRIO has significantly less available disk space than what we typically expect from a PC. The highly efficient TDMS file storage allows for optimal results in these more limiting circumstances.

After setting up the manual control of the entire application, DMC took the last step to automate the process. Using the manual control application that had already been built, DMC added a sequence configuration tool that allowed the user to set up an arbitrary order of operations for the system to sequence through using a basic ini file format. The advantage of this sequence configuration was that the client could write sequences (with the help of a syntax example) at their desk and deploy the sequence files from their network without having to manually control operation from the UI. 

DMC added validation checks that examined the validity of sequence steps before execution to prevent beginning a sequence that would cause the system to go into an error state. This is valuable to the client, as it allows them to create and execute custom sequences that can be run multiple times without the need to manually interact with the UI for the full duration of every test. Custom sequencing allows for flexibility in use as research and testing requirements change over time.

While the sequence is running, the operator may choose to pause or abort for any reason. The software also has real-time fault limit checking that is configurable in the system settings for all digital and analog inputs to the system.

LabVIEW System Parameters Configuration Interface

Overall, the cRIO-9038 provided the perfect platform for high-speed data acquisition and synchronous motion control combined with an embedded UI for a convenient and easy-to-use front end. With DMC’s solution, our client now receives more accurate data on their products, and running tests is easier than ever with this automated, custom test recipe solution.

Posted in Custom Software and Hardware Development, Embedded Development and Embedded Programming, LabVIEW Programming, LabVIEW Programming for Real-Time and FPGA, Manufacturing Automation and Intelligence, Motion Control Engineering and Servo Systems, Test and Measurement Automation, User Interface Design

DMC Chicago • 2222 N. Elston Ave Suite 200 • Chicago, IL 60614 • (312) 255-8757

DMC Boston • 20 Holland St Suite 408 • Somerville, MA 02144 • (617) 758-8517

DMC Dallas • 1920 McKinney Ave 7th Floor • Dallas TX, 75201 • (972) 432-5536

DMC Denver • 1860 Blake St Suite 410 • Denver, CO 80202 • (303) 223-1801

DMC Houston • 3311 Richmond Ave Suite 209 • Houston, TX 77098 • (713) 322-9192

DMC New York • 141 W 36th St Suite 20N • New York, NY 10018 • (917) 473-0030

DMC Reno • 316 California Ave #691 • Reno, NV 89509 • (775) 300-6804

DMC Seattle • 506 2nd Ave Suite 910 • Seattle, WA 98104 • (206) 388-5186

DMC St. Louis • 1034 S Brentwood Blvd • St. Louis, MO 63117 • (314) 627-5427 • (888) DMC-4400