Page tree
  • 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.

  • Insert an EtherCat Master Ethernet adapter and specify the interface to be used.

    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:


        xDisable        : BOOL;
        xEnable         : BOOL;
        xReconfigure    : BOOL;
        itfNodeSlave    : DED.INode;
        fbReconfigure   : DED.Reconfigure;
    	eState          : IoDrvEthercatLib.ETC_SLAVE_STATE;


    itfNodeSlave := EK1100;
    IF xDisable THEN
        xDisable := FALSE;
        itfNodeSlave.Enable := FALSE;
        xReconfigure := TRUE;
    IF xEnable THEN
        xEnable := FALSE;
        itfNodeSlave.Enable := TRUE; 
        xReconfigure := TRUE;
    fbReconfigure(xExecute := xReconfigure, itfNode := EtherCAT_Master);
    IF fbReconfigure.xDone THEN
        xReconfigure := FALSE;
    EK1100(); // Necessary for the status to be updated
    eState := EK1100.wState;

  • Start the project and test the functionality by deactivating and activating the slave.

  • No labels