2 Instruction Descriptions
2-638
NJ-series Instructions Reference Manual (W502)
The GetECError instruction gets the highest level status and highest level event code of the current
communications port errors or master errors in the EtherCAT Master Function Module and outputs
them to Level and Code. If there are currently no communications port errors or master errors, the value
of error flag Out is FALSE. If there is more than one Controller error at the highest event level, the value
of Code is the event code for the Controller error that occurred first.
The following figure shows a programming example.
*1 The GetECError instruction gets the errors that are shown by _EC_PortErr (Communications Port Error) and
_EC_MstrErr (Master Error).
*2 Refer to the NJ-series CPU Unit Built-in EtherCAT Port User’s Manual (Cat. No. W505) for details.
Refer to the sample programming that is provided for the ResetMCError instruction (page 2-630).
Function
Related System-defined Variables
Name Meaning Data type Description
_EC_ErrSta Built-in EtherCAT Error WORD Contains a summary of the errors in the
EtherCAT Master Function Module.
*2
_EC_PortErr
*1
Communications Port
Error
WORD Contains a summary of the EtherCAT mas-
ter communications port errors.
*2
_EC_MstrErr
*1
Master Error WORD Contains a summary of the EtherCAT mas-
ter errors and the slave errors detected by
the EtherCAT master.
*2
_EC_SlavErr Slave Error WORD Contains a summary of the overall EtherCAT
slave error status.
*2
Sample Programming
abc:=GetECError(def, ghi);
LD ST
def
ghi
abc
GetECError
EN
Level
Code