ECATDeviceAction
Function Block A function block groups an algorithm and a set of private data. It has inputs and outputs. - 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.
Inputs
Input |
Data Type |
Range |
Unit |
Default |
Description |
---|---|---|---|---|---|
Execute |
BOOL |
0, 1 |
N/A |
No default |
When Execute is set to TRUE, an action is performed. |
DeviceAddress |
INT |
No range |
N/A |
No default |
The address of the device to perform an action on.
|
Action |
INT |
No range |
N/A |
No default |
The action to be performed. Action can be one of these values:
|
Outputs
Output |
Data Type |
Range |
Unit |
Description |
---|---|---|---|---|
Done |
BOOL |
No range |
N/A |
Indicates whether this function block has completed without error. |
Error |
BOOL |
No range |
N/A |
Indicates whether this function block has completed with error. |
ErrorID |
DINT |
No range |
N/A |
The ECATDeviceAction error result if Error is TRUE.
|
Remarks
- This function returns immediately.
- It can be called multiple times in one cycle.
Supported Actions
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 is automatically simulated.
- The last position from the physical drive is 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 comes directly from the configured drive feedback.
- The position is not automatically transferred from the simulated axis.
Usage
The EtherCAT network needs to be stopped to use this function block.
- This is achieved by either:
- Calling ECATDeviceAction prior to calling MLMotionStart.
- First calling MLMotionStop to stop the network.
- See Modular EtherCAT Concept for more information on modular machine design.
Error Codes
Value Dec (hex) |
Error Code |
Description |
---|---|---|
0 |
ECERR_OK |
The action succeeded. |
1000 (0x3E8) |
ECERR_DEVICE_ACTION_IS_INVALID |
The specified device action is invalid. |
1001 (0x3E9) |
ECERR_DEVICE_IS_DC_CLOCK_MASTER |
The Device is a DC Clock Master. |
1002 (0x3EA) |
ECERR_DEVICE_IS_IN_DC_MASTER_UPSTREAM |
The device is before the DC Clock Master. |
1003 (0x3EB) |
ECERR_DEVICE_ACTION_MINIMUM_ONE_NODE_REQD |
A minimum of one node is required in the EtherCAT network. |
1792 (0x700) |
ECERR_DEVICE_ERROR |
EtherCAT device is not accessible. |
1799 (0x707) |
ECERR_DEVICE_NOTREADY |
Device is not in a ready state. The EtherCAT network is not in the desired state for the specified action. |
1832 (0x728) |
ECERR_DEVICE_INVALIDADDR |
The specified EtherCAT node address is invalid. |
FBD Language Example
FFLD Language Example
IL Language Example
Not available.
ST Language Example
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;
See Also