Implicit Instance of Slave

 

An instance of the ETCSlave data type is generated for each EtherCAT slave inserted in the device tree. The name of the instance corresponds to the name of the slave in the device tree. The availability of the instance is displayed in the IEC Objects tab of the device editor.

The slave instance is used in the application in order to query or change the state of the slave at runtime.

Inputs

Name

Data type

Description

xSetOperational

BOOL

Rising edge: An attempt is made to switch to the ETC_SLAVE_ OPERATIONAL mode.

Outputs

Name

Data type

Description

wState

ETC_SLAVE_STATE

Current state of the slave:

  • 0: ETC_SLAVE_BOOT

  • 1: ETC_SLAVE_Init

  • 2: ETC_SLAVE_PREOPERATIONAL

  • 4: ETC_SLAVE_SAVEOPERATIONAL

  • 8: ETC_SLAVE_OPERATIONAL

    Configuration was successfully completed.

If errors occur during the configuration, the slave can fall back into an earlier state.

Properties of the slave:

VendorID

After the EtherCAT stack starts, this property returns the vendor ID that is read from the device.

ConfigVendorID

Reads the vendor ID from the configuration.

ProductID

After the EtherCAT stack starts, this property returns the product ID that is read from the device.

ConfigProductID

Reads the product ID from the configuration.

SerialID

After the EtherCAT stack starts, this property contains the serial number of the device.

LastEmergency

If a message is received, this information is stored in the slave and can be queried from the application with this property. A log message is also added.

If the checking of the vendor or product ID is activated in the expert settings, then the boot up of the stack is stopped as soon as a discrep­ancy is found between VendorID and ConfigVendorID or between ProductID and ConfigProductID.

See also