Table of Contents

IEthercatSlave

Namespace
ZCore

This interfaces holds the general methods that the Zeugwerk Framework expects from an ethercat slave. Implementations may be provided in a platform dependent library, i.e. (The beckhoff platform-library).

By extending from the IObject this interface may be used in Await methods of sequences.

INTERFACE IEthercatSlave EXTENDS ZCore.IObject, ZCore.IBootable, ZCore.IError
Extends
Inherited Properties
Inherited Methods

Methods

EthercatStateFlags

This method returns the state of the EtherCAT slave device in a flags enum. This means that several bits of the returned value can be on or off at once.

METHOD EthercatStateFlags () : EthercatSlaveStateFlags

Returns

EthercatSlaveStateFlags

Retrieves the platform specific data pointer to ethercat slave communication. This method is highly platform dependent, refer to ZPlatform.EthercatSlaveImpl.

METHOD Link () : ZPointer

Returns

ZPointer

Name

This method returns the name that has been passed with the SetName method concatenated with the string '| EthercatSlave' and the identifier of the object. The later is obtained in the booting sequence when reading the EtherCAT slave device's identity. If simulated, the identifier 'Simulated' is used.

ethercatSlave.SetSimulated(FALSE);
ethercatSlave.SetName('Slave1');
ethercatSlave.Name(); // returns 'Slave1 | EthercatSlave (Simulated) '
METHOD FINAL Name () : ZString

Returns

ZString

RequestStateAsync

Use this method to switch the ethercat slave device into any state. If the object is busy while the method is called, the startToken that is passed will inform about this and the actual request will not be performed. EthercatSlaveImpl can only perform 1 task at a given time, this includes booting. If a special state should be set during booting, please use the parameter in FB_init.

METHOD RequestStateAsync (
 startToken : IStartToken,
 state : EthercatSlaveState)

Inputs

startToken IStartToken

state EthercatSlaveState

Set the platform specific data pointer to ethercat slave communication. This method is highly platform dependent, refer to ZPlatform.EthercatSlaveImpl.

METHOD SetLink (
 linkPtr : ZPointer)

Inputs

linkPtr ZPointer

WcState

The method returns the state of the working counter for the ethercat slave device whose Process Data Objects are mapped to this instance. It is an easy way to find out if data is sent and received correctly to the device. If any error occurs, this objects additionally transitions into its error state (for at least 1 cycle) and ErrorMessage can be used to retrieve informations about the error.

METHOD WcState () : BOOL

Returns

BOOL