EtherCAT-IOLink Gateway
 
Loading...
Searching...
No Matches
Start TwinCAT - Extended Project
  1. Start the TwinCAT "eXtended Automation Engineering XAE".
  2. Open the TwinCAT project select in menu "File->Project/Solution". Select project "twincat/ec_iol_gateway/TwinCAT Gateway.sln"
Opened Gateway solution
  1. The PLC program can be found in the tree:

    "TwinCAT Gateway.PLC.GatewayPlc.GatewayPlc Project.POUs.MAIN (PRG)"

Main program
  1. Build the project in menu select "Build->Build solution"
Build output
  1. Activate configuration in menu select "TwinCAT->Activate Configuration". Click "OK".
Gateway activate configuration
  1. The dialog box is shown, asking to restart in run mode will show up. Click "OK".
Dialog box - Restart in run mode

The TwinCAT will detect the connected EtherCAT slave.

  1. Select in menu "PLC->Login".
  2. The dialog box asking to create the Port_851 will show up. Click "Yes".
Dialog box - Create the Port 851

Actual values will be shown in the MAIN program part. In this moment all shall be zeros.

Logged in PLC
  1. Select in menu "PLC->Start" to start the PLC program. The program unpacks the measured distance from the sensor, calculates a related color and send it to the smart light:
Color Meaning
green allowed zone (enough big distance)
yellow near the not allowed zone
red not allowed zone (too small distance)
  1. Try to move a metal object before the distance sensor, the light will change the colors in relation to the distance. Actual values will be shown together with the MAIN program.
Gateway PLC runs

Next will be shown where can be found the cyclic data of sued IO-Link devices and how to read the VendorID and DeviceID of connected IO-Link devices.

  1. Click in the tree on the "Box1 (KUNBUS EtherCAT ...)".
  2. Click on the "Box 1->TxPDO Module 2->Tx PDO 001". You will see on the right side the measured distance value in raw format.
TxPDO from the distance sensor
  1. Click on the "Box 1->RxPDO Module 1->Rx PDO 001". You will see on the right side the control bits for the smart light in the raw format.
RxPDO to the smart light
  1. Click on the tab CoE-Online. It takes a while to load the object dictionary from the EtherCAT slave.
  2. Click on the object index 0x9000 and 0x9100. It will read and show actual VendorID and DeviceID values of the connected devices.
CoE online 0x9000 and 0x90100

You can compare the values with the values in the table below.

IO-Link Device DeviceID VendorID
Balluff BNI007T 0x00050A05 0x00000378
Autosen AI 402 0x00000061 0x00000345

It was shown how to setup the hardware with two IO-Link devices. How to start the PLC program to control the distance and how to read which IO-Link devices are currently connected.

Store and Recall Parameters

Gateway parameters can be stored by writing a value of 0x65766173 into CoE object 0x2010

Gateway parameters can be restored by writing a value of 0x64616F6C into CoE object 0x2011