ECATDeviceStatus
Function Block A function block groups an algorithm and a set of private data. It has inputs and outputs. - Provides the 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 state and the port link status information for the EtherCAT device.
Inputs
Input |
Data Type |
Range |
Unit |
Default |
Description |
---|---|---|---|---|---|
Execute |
BOOL |
0, 1 |
N/A |
No default |
Read the device status on the rising edge A rising edge is the transition of a digital signal from low to high. It is also called positive edge. |
DeviceAddress |
INT |
No range |
N/A |
No default |
The address of the device data is read from.
|
Outputs
Output |
Data Type |
Range |
Unit |
Description |
---|---|---|---|---|
Done |
BOOL |
No range |
N/A |
Indicates whether this function block has completed without error. |
State |
UINT |
No range |
N/A |
Indicates the EtherCAT state of the device.
|
LinkStatus |
UINT |
No range |
N/A |
Provides the physical link status of the device's ports.
|
Error |
BOOL |
No range |
N/A |
Indicates whether this function block has completed with error. |
ErrorID |
DINT |
No range |
N/A |
The function call error result, if Error is TRUE.
|
Remarks
- If the EtherCAT network communication is not running due to a shutdown, the device status contains information taken at the time the network was shutdown.
- This function block is useful in locating the devices with communication errors when the ECATWCStatus function indicates there are EtherCAT communication errors.
-
- See Check the Device States in Example: EtherCAT Communication Diagnosis Steps for an example of implementing this function.
State Defines
#define EC_STATE_NO_COMMUNICATION 0 (* 0x00 = No Communication to device *)
#define EC_STATE_INIT 1 (* 0x01 = Device in Init state *)
#define EC_STATE_PREOP 2 (* 0x02 = Device in Pre-operational state *)
#define EC_STATE_BOOTSTRAP 3 (* 0x03 = Device in Bootstrap state *)
#define EC_STATE_SAFEOP 4 (* 0x04 = Device in Safe-Operational state *)
#define EC_STATE_OP 8 (* 0x08 = Device in Operational state *)
#define EC_STATE_ERROR 16 (* 0x10 bit 4 set to 1; Device not in requested state error *)
LinkStatus Defines
#define EC_LINK_NO_COMMUNICATION 1 (* 0x1 = No communication to device; bit 0 set to 1 *)
#define EC_LINK_PORT_A 16 (* 0x10 = Link detected on Port A; bit 4 set to 1 *)
#define EC_LINK_PORT_B 32 (* 0x20 = Link detected on Port B; bit 5 set to 1 *)
#define EC_LINK_PORT_C 64 (* 0x40 = Link detected on Port C; bit 6 set to 1 *)
#define EC_LINK_PORT_D 128 (* 0x80 = Link detected on Port D; bit 7 set to 1 *)
Figure 6-73: ECATDeviceStatus
FBD Language Example
FFLD Language Example
IL Language Example
Not available.
ST Language Example
(********************************************************)
(* Read AKD_1 device state and link status*)
(********************************************************)
Inst_EcDeviceStatus(TRUE,EtherCAT.AKD_1);
See Also