ECATMasterStatus
Function Block A function block groups an algorithm and a set of private data. It has inputs and outputs. - Reads 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 master state and the lost frame counter to determine if EtherCAT is running normally.
Inputs
Input |
Data Type |
Range |
Unit |
Default |
Description |
---|---|---|---|---|---|
Enable |
BOOL |
0, 1 |
N/A |
No default |
Request to read the EtherCAT master state and the lost frame count. Continuously reads the master state and the lost frame count as long as the Enable remains high. |
Outputs
Output |
Data Type |
Range |
Unit |
Description |
---|---|---|---|---|
Valid |
BOOL |
No range |
N/A |
Indicates the values at the State and LostFrameCount outputs are valid. |
Error |
BOOL |
No range |
N/A |
Indicates whether this function block has completed with error. |
ErrorID |
DINT |
No range |
N/A |
Error code when the function block failed due to error. |
State |
UINT |
No range |
N/A |
Indicates the EtherCAT state of the Master. See State Defines for more information. |
LostFrameCount |
UDINT |
No range |
N/A |
Total cumulative number of cyclic frames sent with no-response since the EtherCAT started by calling the MLMoitonStart.
|
Remarks
-
- See Example: EtherCAT Communication Diagnosis Steps for more information.
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 *)
Figure 6-75: ECATMasterStatus
FBD Language Example
FFLD Language Example
IL Language Example
Not available.
ST Language Example
// ECATMasterStatus
Inst_ECATMasterStatus( True );
MasterSTate := Inst_ECATMasterStatus.State;
MasterLastFrameCount := Inst_ECATMasterStatus.LostFrameCount;
See Also