Hardware requirements
MIMXRT1180-EVK RevC
RJ45 Network cable
Mini/micro USB cable
Personal Computer on which the TwinCat3 has been installed(Windows 10 is recommended)
Board settings
For multiple boards cascades, R142 register needs to be removed.
Prepare the Demo
Generate the SSC source code
Download Slave Stack Code Tool(SSC Tool) from BECKHOFF official website and install it
Open Slave Stack Code Tool
Click ‘File’ -> ‘New’ -> ‘Import’ to import the Congfig file Select digital_io.xml under path ‘.\boards\evkmimxrt1180\ecat_examples\digital_io<core>\SSC’.
Click ‘Tool’ -> ‘Application’ -> ‘Import’ to import Application information Select digital_io.xlsx under path ‘.\boards\evkmimxrt1180\ecat_examples\digital_io<core>\SSC’.
Click ‘Project’ -> ‘Create new Slave Files’ ‘Source Folder’(default): ‘.\boards\evkmimxrt1180\ecat_examples\digital_io<core>\SSC\Src’. Click ‘Start’.
Remove digital_io.c under Src folder
Connect EtherCAT Port0 with TwinCAT3 RJ45 interface labeled as J28 is the EtherCAT Port0 and RJ45 interface labeled as J32 is the EtherCAT Port1.
Connect a USB cable between the host PC and the OpenSDA USB port on the target board
Open a serial terminal with the following settings
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo
Update ESI file to EEPROM
Copy ESI file ‘ECAT-IO.xml’ generated by SSC TOOL to <TwinCAT_installation_folder>/
/Config/io/EtherCAT/ Restart TwinCAT3 IDE
Scan device and Update EEPROM
Scan and load this device and create a PLC project in TwinCat3 The PLC Main code is as follows:
PROGRAM MAIN VAR Delay : TON; LedIn AT %I* : BOOL; LedOut AT %Q* : BOOL; END_VAR Delay(IN := TRUE, PT := T#1S); IF Delay.Q THEN LedOut := NOT LedIn; Delay(IN := FALSE); END_IF;
Activate configuration and start PLC Main function