For the full tutorial, see Low-code Example: QEC Digital Input/Output
With the 86EVA and ArduBlock, using the external LEDs are blinked by the Digital Output, and the status of the LEDs is received through the Digital Input and printed out through the Serial Port.
- QEC-R11DF0: EtherCAT 16 Channel Digital Input Slave Module
- QEC-R11D0F: EtherCAT 16 Channel Digital Output Slave Module
- Others: 24V LED
Please first connect the EtherCAT Out network on the QEC-M to the EtherCAT In network of the QEC-R11D0F, and the EtherCAT Out network of the QEC-R11D0F to the EtherCAT In network of the QEC-R11DF0.
This example will use Vp power as the power source for QEC-R11D0F Pin0 by using Pin8 of QEC-R11DF0 as the receive signal pin.
- Vp power is connected to QEC-R11D0F Pin0+
- QEC-R11D0F Pin0- connected to the LED VCC
- LED GND to Pin8+ of QEC-R11DF0
- Pin8- of QEC-R11DF0 is connected back to GND of Vp power supply
As shown in the figure.
QEC-R11D0FS (Digital Output) + QEC-R11DF0S (Digital Input):
Step 1: 86EVA, EtherCAT Configuration
Go to the 86Duino Coding IDE, open the 86EVA tool, and configure EtherCAT.
Step 2: Set up the Virtual Arduino Pin and generate the code
In the screen of the Digital Output slave device, QECR11D0FS, set DQ00 to the Virtual Pin D0 of the Arduino.
In the screen of the Digital Input slave device, QECR11DF0D, set DI08 to the Virtual Pin D1 of the Arduino.
After completion, the 86EVA code can be generated.
Step 3: ArduBlock setup
We need to set Output’s Pin0 to High and read Input’s Pin8, then print it in Serial Port, with a delay of 4000 ms. After that, set Output’s Pin0 to Low and read Input’s Pin8, then print it in Serial Port, with a delay of 1000 ms.
The building blocks are as follows.
Generate the code and upload it.
You can find more information about the basic QEC applications in the EtherCAT application.
You can also explore Language or Libraries for a more detailed collection of 86Duino IDE programming.