-
Notifications
You must be signed in to change notification settings - Fork 35
Minimal Example IP20 EC DI8 DO8
A complete software walkthrough for the Elrest IP20-EC-DI8-DO8
The IP20-EC-DI8-DO8 Minimal Example demonstrates how to control and monitor digital I/O on a Elrest IP20-EC-DI8-DO8 EtherCAT Fieldbus Controller using the QiTech machine framework.
The device provides:
- 8 digital outputs (DO1–DO8) — controllable from the dashboard
- 8 digital inputs (DI1–DI8) — readable in real time
Unlike Beckhoff EtherCAT terminal stacks (which require an EK1100 bus coupler), the Elrest IP20-EC-DI8-DO8 is a standalone EtherCAT device that connects directly to the EtherCAT master.
-
Elrest IP20-EC-DI8-DO8 EtherCAT Fieldbus Controller
- Vendor ID:
0x741 - Product ID:
0x117b6722 - Revision:
0x1
- Vendor ID:
- 24 V DC power supply
- Linux PC as EtherCAT master
- Standard Ethernet cable
- Wiring tools and appropriate conductors
(Installation steps in Section 4)
- Rust toolchain
- Node.js + npm
- Git
- QiTech Control repository
The Elrest IP20-EC-DI8-DO8 combines a fieldbus coupler and I/O in a single unit. It connects directly to your Linux PC via Ethernet and requires a 24 V DC power supply.
The device requires 24 V DC on its power terminals. Refer to the official Elrest documentation for the exact terminal layout of your hardware revision.
Always disconnect power before wiring. Working on live fieldbus devices can cause serious damage or electrical shock.
The 8 digital outputs switch 24 V DC loads. Connect the load between the corresponding output terminal and the 0 V (GND) reference terminal.
The 8 digital inputs sense 24 V DC signals. Connect the signal source between the corresponding input terminal and the 0 V (GND) reference.
Use a standard LAN cable to connect your PC directly to the EtherCAT (X1) port of the IP20-EC-DI8-DO8.
# Press Enter when prompted
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
sudo apt update
sudo apt install -y npm nodejs git
git clone git@github.com:qitechgmbh/control.git
cd control/electron
npm install./cargo_run_linux.shThis script:
- Builds the backend
- Grants required system capabilities (raw sockets)
- Starts EtherCAT communication
Ensure the IP20-EC-DI8-DO8 is connected and powered before running.
cd electron
npm run startThis launches the QiTech Control dashboard.
Once the backend and frontend are running, the IP20-EC-DI8-DO8 will appear in the device discovery view.
Steps:
- Click Assign on the IP20-EC-DI8-DO8
- Select IP20 Test V1 as the machine type
- Enter a serial number
- Click Write
Navigate to Machines → IP20 Test.
The control page has four panels:
| Panel | Description |
|---|---|
| Digital Outputs | Toggle each of the 8 outputs (DO1–DO8) individually between On and Off |
| Digital Inputs | Live view of each of the 8 inputs (DI1–DI8), displayed as HIGH or LOW |
| Master Output Control | Turn all 8 outputs On or Off simultaneously |
(SoonTM)
Located in machines/src/ip20_test_machine/.
| File | Description |
|---|---|
mod.rs |
Defines IP20TestMachine struct; holds 8-element arrays for inputs, outputs, digital input (dins) and output (douts) HAL wrappers |
new.rs |
Initializes the IP20EcDi8Do8 device, creates DigitalInput / DigitalOutput wrappers for all 8 channels |
api.rs |
Handles SetOutput { index, on } and SetAllOutputs { on } mutations; emits StateEvent (outputs) and LiveValuesEvent (inputs) via Socket.IO |
act.rs |
Real-time loop: reads inputs, emits state at 30 Hz, emits live values at 10 Hz |
The HAL device driver is located in ethercat-hal/src/devices/wago_modules/ip20_ec_di8_do8.rs.
Located in electron/src/machines/ip20testmachine/.
| File | Description |
|---|---|
useIP20TestMachine.ts |
Custom hook; manages optimistic state and sends SetOutput / SetAllOutputs mutations to the backend |
IP20TestMachineControlPage.tsx |
UI with output toggle controls, live input badges, master on/off, and input summary |
ip20TestMachineNamespace.ts |
Socket.IO namespace handler; updates the Zustand store with incoming StateEvent and LiveValuesEvent messages |
QiTech Control | GitHub | Video Demo | Open Source Framework for Industrial Control