EtherCAT Network Connect and Disconnect with LS_Connect and LS_Disconnect

The XMC must connect to the EtherCAT network to communicate with slave devices. This is done using the LS_Connect function block. No commands can be sent to the drives if they are not connected. The EtherCAT network can also be disconnected using the LS_Disconnect function block.

  • LS_Connect will return an error number if the EtherCAT network doesn’t match the project configuration.

  • The EtherCAT slave status flags won’t be active until LS_Connect is successfully executed.

  • Disconnecting the EtherCAT network will cause the status to stop updating.

The following examples can be found in the XMC_SingleAxis_FBs.zip downloadable from Example Applications.

 

 

 

 

 

 

 

 

 

 

 

 

 

LM500