EtherCAT-IOLink Gateway
 
Loading...
Searching...
No Matches
EtherCAT-IOLink Gateway Basic Example

Software Requirements

Software Version
Code Composer Studio 12.7
IND COMMS SDK for AM64x 09.02.00.49
TwinCAT TcXaeShell 15.0.28010.2050 D15.8

Under Windows, make sure that the following environment variable is set (adjust path):

set MCU_PLUS_SDK_AM64X_PATH = C:\ti\ind_comms_sdk_09_02_00_49\mcu_plus_sdk

Import Example Projects in Code Composer Studio

In Code Composer Studio (CCS) the example projects are imported as CCS projects from the directory examples/ in the EtherCAT-IOLink Gateway archive.

  1. In CCS select File > Import...
  2. In the following 'Select' window choose Code Composer Studio > CCS Projects
Project Select Window
  1. In the following 'Import' Window select search-directory and browse to the examples directory
Import CCS Project for AM64x-EVM
  1. Check the boxes for the desired project and click Finish

Configuration of IO-Link Ports

The default configuration accepts all IO-Link devices. The used settings are stored in variable GW_API_SPortExpConfig. For more details and valid range, please refer to file gw_api_interface.h.

Examples

If the developer wants to limit to a specific device, it is necessary to modify in the variable IOL_sFixedConfiguration_g the members vendorID, deviceID to the values specified by the vendor and in the member validationType set the value to GW_API_VALIDATION_TYPE_ID. For example:

[x] = { VENDOR_ID, DEVICE_ID, IOL_REVISIONID_UNDEF,
DATA_IN_LENGTH, DATA_OUT_LENGTH, "", IOL_CYCLE_TIME_UNDEF,
GW_API_IQBEHAVIOR_NOTSUPPORTED, GW_API_VALIDATION_TYPE_ID,
GW_API_MASTERCONTROL_IOLINKPROT | GW_API_MASTERCONTROL_ACTIVE},

It is also possible to configure a port exclusively as digital input or output, as shown below:

/* Digital Input */
[x] = {IOL_VENDOR_UNDEF, IOL_DEVICE_UNDEF, IOL_REVISIONID_UNDEF,
1, 0, "", IOL_CYCLE_TIME_UNDEF,
GW_API_IQBEHAVIOR_NOTSUPPORTED, GW_API_VALIDATION_TYPE_NONE,
GW_API_MASTERCONTROL_DI | GW_API_MASTERCONTROL_ACTIVE},
/* Digital Output */
[y] = { IOL_VENDOR_UNDEF, IOL_DEVICE_UNDEF, IOL_REVISIONID_UNDEF,
0, 1, "", IOL_CYCLE_TIME_UNDEF,
GW_API_IQBEHAVIOR_NOTSUPPORTED, GW_API_VALIDATION_TYPE_NONE,
GW_API_MASTERCONTROL_DO | GW_API_MASTERCONTROL_ACTIVE},

Run and debug the examples with CCS

  1. In Code Composer Studio import CCS project ethercat_iolink_gateway_demo_am64x-evm_r5fss0-0_freertos_ti-arm-clang from \examples\industrial_comms\ethercat_iolink_gateway_demo\am64x-evm
  2. Click on View->Target Configuration.
  3. In the new window right click on Projects/ethercat_iolink_gateway_demo_am64x-evm_r5fss0-0_freertos_ti-arm-clang/targetConfigs/AM64x.ccxml
    and select
    Launch selected configuration
  4. Open a scripting console by clicking on View -> Scripting Console.
  5. In the new window: type and press ENTER
    loadJSFile "C:\ti\ind_comms_sdk_09_02_00_49\mcu_plus_sdk\tools\ccs_load\am64x\load_dmsc_hsfs.js"
  6. In the window "Debug" left click on "Texas Instruments XDS110 USB Debug Probe/MAIN_Cortex_R5_0_0".
  7. Click in the toolbar on the icon "Connect".
  8. Click in the toolbar on the icon "CPU Reset" and select "CPU Reset".
  9. In the toolbar click on the icon "Load" and click on the button "Browse Project".
  10. Select the ethercat_iolink_gateway_demo_am64x-evm_r5fss0-0_freertos_ti-arm-clang -> Debug -> ethercat_iolink_gateway_demo.release.out and click on "OK". And again "OK".
  11. Run ethercat_iolink_gateway_demo_am64x-evm_r5fss0-0_freertos_ti-arm-clang by click in Toolbar on the icon "Resume".
  12. Run the TwinCAT and scan for the devices.

Create a TwinCAT project

This section describes how to establish a connection between TwinCAT software and the AM64x_EVM connected with general IO-Link devices.

The basic TwinCAT project shall be able to scan for the available EtherCAT devices and connect to access the IO-Link slave device description within the objects.

At least one, maximum of 8, IO-Link slave devices can be connected to the EtherCAT IO-Link Gateway device. Also, any type of IO-Link slave devices can be connected without any constraints.

For example, a smart light IO-Link device from BALLUFF (BNI007T) is connected to the Channel 1 on the TMDS64DC01EVM IO-Link breakout board for this demo.

Setup the hardware & firmware

  1. Take the development board AM64x_EVM.
  2. Be sure that the board is not powered. Unplug USB debugger (JTAG) and UART cables from the PC.
  3. Connect the IO-Link breakout board (TMDS64DC01EVM) to the AM64x_EVM.
TMDS64DC01EVM with AM64x_EVM
  1. Take the not yet powered 24V cable and plug it in the TMDS64DC01EVM IO-Link breakout board.
  2. Take the Balluff smart light (or any IO-Link device) and connect it to the Channel 1 on the TMDS64DC01EVM IO-Link breakout board.
  3. Power on the board AM64x_EVM.
  4. Power on the TMDS64DC01EVM IO-Link breakout board.
  5. The system shall look like on the following photo.
EtherCAT IO-Link Gateway Setup
  1. Load application described in the chapter Run and debug the examples with CCS