ECATDeviceAction
Description
This function block performs an action on an EtherCAT ***EtherCAT is an open, high-performance Ethernet-based fieldbus system. The development goal of EtherCAT was to apply Ethernet to automation applications which require short data update times (also called cycle times) with low communication jitter (for synchronization purposes) and low hardware costs device. This function returns immediately, and can be called multiple times in one cycle.
Figure 7-191: ECATDeviceAction function block
The following actions are currently supported
- DEVICE_ACTION_DISCONNECT
- The EtherCAT master is notified to expect the node to be removed from the EtherCAT when ECATDeviceAction is called with “DEVICE_ACTION_DISCONNECT”.
- Any Axis/Axes mapped to a drive node will be automatically simulated.
- The last position from the physical drive will be carried over to the simulation when the EtherCAT restarts.
- DEVICE_ACTION_CONNECT
- This action connects the already disconnected node to the EtherCAT Network
- The axis (or axes) that was acting as simulated axis becomes a normal axis when the drive node is connected.
- The axis/axes position will come directly from the configured drive feedback. The position will not be automatically transferred from the simulated axis.
Arguments
Input
Execute | Description | When Execute is set to True, an action will be performed. |
Data type | BOOL | |
Range | 0, 1 | |
Unit | N/A | |
Default | — | |
DeviceAddress | Description |
The address of the device to perform an action on. The first node usually has the value '1001'. The second node usually has the value '1002'. Alternately, you can use the members of the EtherCAT structure to specify a device's address when you Create Variables.
|
Data type | INT | |
Range | — | |
Unit | N/A | |
Default | — | |
Action | Description | The action to be performed. Action can be one of the following values:
|
Data type | INT | |
Range | — | |
Unit | N/A | |
Default | — |
Output
Done | Description | Indicates whether the ECATDeviceAction function block completed without error. |
Data type | BOOL | |
Unit | N/A | |
Error | Description | Indicates whether the ECATDeviceAction function block call completed with error: |
Data type | BOOL | |
Unit | N/A | |
ErrorID | Description | The ECATDeviceAction error result if Error is TRUE (see list of Error Codes in table below). Upon success, Error is set to zero. |
Data type | DINT | |
Unit | N/A |
Error Code | Value dec (hex) | Description |
---|---|---|
ECERR_OK | 0 | The action succeeded. |
ECERR_DEVICE_ACTION_IS_INVALID | 1000 (0x3E8) | The specified device action is invalid. |
ECERR_DEVICE_IS_DC_CLOCK_MASTER | 1001 (0x3E9) | The Device is a DC Clock Master |
ECERR_DEVICE_IS_IN_DC_MASTER_UPSTREAM | 1002 (0x3EA) | The device is before the DC Clock Master. |
ECERR_DEVICE_ACTION_MINIMUM_ONE_NODE_REQD | 1003 (0x3EB) | Minimum one node is required in the EtherCAT Network. |
ECERR_DEVICE_ERROR | 1792 (0x700) | EtherCAT device is not accessible. |
ECERR_DEVICE_NOTREADY | 1799 (0x707) | Device is not in a ready state. The EtherCAT network is not in the desired state for the specified action. |
ECERR_DEVICE_INVALIDADDR | 1832 (0x728) | The specified EtherCAT node address is invalid. |
Usage
The EtherCAT network needs to be stopped to use this function block. This can be achieved by calling ECATDeviceAction prior to calling MLMotionStart or by first calling MLMotionStop to stop the network.
Related Functions
Also see Modular EtherCAT Concept for information on modular machine design.
Examples
Structured Text
MLMotionStop(); MotionEngineStatus := MLMotionStatus(); On MotionEngineStatus = MLSTATUS_STOPPED Do Inst_ECATDeviceAction(True, EtherCAT.AKD_3, DEVICE_ACTION_DISCONNECT); If Inst_ECATDeviceAction.Error Then // Handle Error // Error ID value is in Inst_ECATDeviceAction.ErrorEnd_If; End_Do;
FBD
FFLD