Identification
If HotConnect is used, the current topology status can be viewed in the online topology view in the system manager, i.e. which HotConnect group is connected and where. Several ADS accesses are necessary in order to access this information from the controller/PLC.
This sample program (PLC and System Manager) takes the following approach:
- a function block contains the necessary code
- the FB can be instanced several times and must be linked with its I/O variables to a HotConnect head (EK coupler, EP-box). As a result of this it receives information about the EtherCAT master and its own ADS port.
- As soon as the Wc (Working Counter) reports operation, the device’s own data are queried from the EtherCAT master via ADS, as are the data of the devices that directly follow.
- In addition the identities and names of the neighboring devices are determined. The identifier is the EtherCAT address, which remains constant.
This modified sample program also contains a visualization template that uses placeholder variables.
EtherCAT topology in the PLC In the introductory part of the documentation for the TcEtherCAT.lib there is an extensive sample program for determining various items of information about an EtherCAT network. This documentation is to be found in the information system (online or on DVD): TwinCAT --> TwinCAT PLC --> PC Libraries --> EtherCAT --> Overview. This sample program uses function blocks from there. |
The following structure is assumed:
The first EK1100 coupler is equipped with EK1110 and EK1122 as branch stations for the EK1101s GroupA and GroupB.
Regarding the procedure: the linking of the address information into the function block is crucial, see Fig. AdsAddr.
In the example the EK1101 HotConnect coupler has the EtherCAT address 1007. The FB can also access the EtherCAT Master NetId and the ADS Port = EtherCAT address via the link.
ADS address If the ADS address is not displayed in the green InfoData, the display can be switched on in the Advanced Settings for the slave. (See Fig. "Switching on the "ADS Address" in the Advanced Settings") |
The function block outputs a status structure, which supplies information about the own identities of the linked coupler and the connected devices; see Fig. Information structure. Since an EtherCAT Slave has a maximum of 4 ports, a maximum of 4 neighboring devices can be determined. The device names are taken from the configuration.
Most important for self-orientation is the predecessor slave on port A/0.
Via this mechanism an entire topology can also be determined from the PLC.