ECATMasterStatus

PLCopen motion icon Pipe Network motion icon

 Function Block - Reads the EtherCAT master state and the lost frame counter to determine if EtherCAT is running normally.

Inputs

Input

Data Type

Range

Unit

Default

Description

Enable

BOOL

FALSE, TRUE

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

FALSE, TRUE

N/A

Indicates the values at the State and LostFrameCount outputs are valid.

Error

BOOL

FALSE, TRUE

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.

  • Missing return frames will generate an A38 alarm.
  • The Counter is reset to 0 (zero) when the MLMotionStart is called.

Remarks

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 1: 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