Table of Contents

IEthercatSlave

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

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.

Methods

EthercatStateFlags

METHOD EthercatStateFlags () : EthercatSlaveStateFlags

Returns

EthercatSlaveStateFlags
METHOD Link () : ZPointer

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

Returns

ZPointer

Name

METHOD FINAL Name () : ZString

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) '

Returns

ZString

RequestStateAsync

METHOD RequestStateAsync (
 [input] startToken : IStartToken,
 [input] state : EthercatSlaveState)

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.

Inputs

startToken IStartToken
state EthercatSlaveState
METHOD SetLink (
 [input] linkPtr : ZPointer)

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

Inputs

linkPtr ZPointer

WcState

METHOD WcState () : BOOL

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.

Returns

BOOL