Input Description

../_images/c5aa8f97020d06e30a317f345e81000a

EN

Data_Type Default_Value Range Unit
BOOL FALSE TRUE/FALSE -

The input EN has to be driven in edge triggered mode.

The execution of the Function Block is started with a positive edge on the input EN.

In the first call it evaluates its inputs and creates a local copy of them. Afterwards it starts its internal algorithm. It may take several PLC task cycles until it is executed.

Once the execution is completed DONE and its other outputs are set. To start the Function Block again a new positive edge on the input EN has to be applied.

SLOT

Data_Type Default_Value Range Unit
BYTE 0 0 … 4 (6) -

At input SLOT, the Communication Module slot is specified which should be used by the Function Block.

The internal Communication Module always has the index 0. All external Communication Modules are serially numbered from right to left, starting with 1.

NODE

Data_Type Default_Value Range Unit
DWORD 0 1 … 4294967295 -

NODE represents the ETHERCAT address of the slave.

DIAG_S500_FORMAT (diagnosis \ S500format)

Data_Type Default_Value Range Unit
BOOL FALSE FALSE, TRUE -

The Input DIAG_S500_FORMAT specifies the format of the diagnosis data which is provided in the buffer DIAG_DATA.

When DIAG_S500_FORMAT is TRUE the diagnosis data is in S500 Format. Otherwise it is in emergency data structure.

DIAG_DATA (diagnosis \ data)

Data_Type Default_Value Range Unit
POINTER TO BYTE 0 - -

The Input DIAG_DATA provides the pointer to buffer where the received diagnosis data is copied to.

The size of the provided buffer depends on the data structure of the diagnosis data which is specified with the Input DIAG_S500_FORMAT.

When the Input DIAG_S500_FORMAT is TRUE the buffer must have a size of at least 25 bytes.

The diagnosis data has the data type Array [1 … 5] OF DIAGDATA.

TYPE DIAG_DATA :(*Error format for S500 slaves*) STRUCT
ERR_CLASS     : BYTE        :=0;   (*error class*)
SLAVE_NR      : BYTE        :=0;   (*slave number*)
MODULE_NR     : BYTE        :=0;   (*module number*)
CHANNEL_NR    : BYTE        :=0;   (*channel number*)
ERROR_NR      : BYTE        :=0;   (*error number*)
END_STRUCT
END_TYPE

When the Input DIAG_S500_FORMAT is FALSE the buffer must have a size of at least 40 bytes.

The diagnosis data has the data type Array [1..5] OF ETHERCAT_MASTER_SLV_EMERGENCY_T.

TYPE ETHERCAT_MASTER_SLV_EMERGENCY_T: STRUCT
usErrorCode:    WORD                :=0;(*error code*)
bErrorRegister: BYTE                :=0;(*error register*)
abErrorData   : ARRAY [0..4]of BYTE :=5(0);(*error data*)
END_STRUCT
END_TYPE

The buffer should not be smaller than the sizes given for each format. Otherwise it will be overwritten and causes unexpected behavior.