- Create a "Standard project” and select CODESYS Control Win V3 as the device.
- Define the target system by means of Network scan.
- Activate the Diagnosis for devices.
lkdsjlksdajlfkj
fdjlkjdlfsgj Insert an EtherCat Master Ethernet adapter and specify the interface to be used.
Note If a target system has not been defined yet, then the error message "Gateway not configured" is displayed.
- Insert a slave below the EtherCat Master or scan the bus.
Edit the PLC_PRG POU as follows:
Section Column width 7 Declaration
Column width 93 Code Block theme Confluence VAR xDisable : BOOL; xEnable : BOOL; xReconfigure : BOOL; itfNodeSlave : DED.INode; fbReconfigure : DED.Reconfigure; eState : IoDrvEthercatLib.ETC_SLAVE_STATE; END_VAR
Section Column width 7 Implementation
Column width 93 Code Block theme Confluence itfNodeSlave := EK1100; IF xDisable THEN xDisable := FALSE; itfNodeSlave.Enable := FALSE; xReconfigure := TRUE; END_IF IF xEnable THEN xEnable := FALSE; itfNodeSlave.Enable := TRUE; xReconfigure := TRUE; END_IF fbReconfigure(xExecute := xReconfigure, itfNode := EtherCAT_Master); IF fbReconfigure.xDone THEN xReconfigure := FALSE; END_IF EK1100(); // Necessary for the status to be updated eState := EK1100.wState;
- Start the project and test the functionality by deactivating and activating the slave.