Concatenated list for checking all slaves, L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 912

Advertising
background image

L-force | PLC Designer

Device Editors

910

DMS 4.1 EN 03/2011 TD29

Properties of the Slave:

VendorID

After the start of the EtherCAT stack, this property returns the Vendor ID read from
the device.

ConfigVendorID

This property reads the Vendor ID from the configuration.

ProductID

After the start of the EtherCAT stack this property returns the Product ID read from
the device.

ConfigProductID This property reads the Product ID from the configuration.

SerialID

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

If in the expert settings the check of the Vendor resp. Product ID is activated, the
starting of the stack will stop as soon as there is a mismatch between VendorID and
ConfigVendorID resp. between ProductID and ConfigProductID.

Concatenated List for Checking all Slaves
For each EtherCAT Master and EtherCAT Slave implicitly an instance of a function block
will be created, which for example may be used to watch the state of particular slaves.
For this purpose the instance must be called in the application program and the slave
state can be read from wState. In order to simplify the programming, all masters and
slaves can be retrieved via concatenated lists. Thus all slaves can be checked by a
simple "WHILE" loop.
For the master as well for a slave there are the properties NextInstance and
LastInstance. Herewith a pointer on the next resp. previous slave is returned. For the
master additionally the property FirstSlave is available, providing a pointer on the first
slave.
The following example shows how to check all slaves:
Example
Declaration:

pSlave: POINTER TO ETCSlave;

Program:

pSlave := Ethercat_Master.FirstSlave;
WHILE pSlave <> 0 DO
pSlave^();
IF pSlave^.wState = ETC_SLAVE_STATE.ETC_SLAVE_OPERATIONAL THEN
;
END_IF
pSlave := pSlave^.NextInstance;
END_WHILE

Advertising