Low-code Example – Digital Output/Input

Low-code Example – Digital Output/Input

[QEC Tutorial]

For the full tutorial, see Example: Digital Input/Output on QEC with Low-code.

Digital Output/Input

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-M-01
  • QEC-R11DF0: EtherCAT 16 Channel Digital Input Slave Module
  • QEC-R11D0F: EtherCAT 16 Channel Digital Output Slave Module
  • Others: 24V LED

Circuit

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.

  1. Vp power is connected to QEC-R11D0F Pin0+
  2. QEC-R11D0F Pin0- connected to the LED VCC
  3. LED GND to Pin8+ of QEC-R11DF0
  4. Pin8- of QEC-R11DF0 is connected back to GND of Vp power supply

As shown in the figure.

qec_dio

Step 1: 86EVA, EtherCAT Configuration

Go to the 86Duino Coding IDE, open the 86EVA tool, and configure EtherCAT.

1-DIQ-eva(en)-3-1

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.

1-DIQ-eva(en)-3-2

In the screen of the Digital Input slave device, QECR11DF0D, set DI08 to the Virtual Pin D1 of the Arduino.

1-DIQ-eva(en)-3-3

After completion, the 86EVA code can be generated.

1-DIQ-eva(en)-3-4

Step 3: ArduBlock setup

Open ArduBlock.

1-DIQ-eva(en)-3-5

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.

1-DIQ-eva(en)-3-6

Generate the code and upload it.

1-DIQ-eva(en)-3-7

Learn More

You can find more information about the basic QEC applications in the EtherCAT application.
You can also explore コード構文 または コードライブラリ for a more detailed collection of 86Duino IDE programming.

コメントする

上部へスクロール