Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • 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
    Image Added


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


    Image Added


  • Insert a slave below the EtherCat Master or scan the bus.

    Image Added


  • Edit the PLC_PRG POU as follows:


    Section


    Column
    width7

    Declaration


    Column
    width93


    Code Block
    themeConfluence
    VAR
        xDisable        : BOOL;
        xEnable         : BOOL;
        xReconfigure    : BOOL;
        itfNodeSlave    : DED.INode;
        fbReconfigure   : DED.Reconfigure;
    	eState          : IoDrvEthercatLib.ETC_SLAVE_STATE;
    END_VAR






    Section


    Column
    width7

    Implementation


    Column
    width93


    Code Block
    themeConfluence
    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.

    Image Added

    Image Added