Input DescriptionΒΆ
EN (enable)
| Data_Type | Default_Value | Range | Unit |
|---|---|---|---|
| BOOL | - | - | - |
In order to enable the function block processing, input EN has to be continuously set to TRUE. The function block is not processed if input EN = FALSE. While input is set to TRUE, the inputs are continuously checked for validity and plausibility. If this is not the case, processing is aborted and an error is displayed.
SLOT
| Data_Type | Default_Value | Range | Unit |
|---|---|---|---|
| BYTE | 0 | - | - |
The input parameter SLOT chooses the ETHERCAT Communication Module to be queried. The slots are numbered from right to left. Slot number 1 is the one beside the CPU.
NODE
| Data_Type | Default_Value | Range | Unit |
|---|---|---|---|
| WORD | 0 | - | - |
NODE represents the ETHERCAT address of the slave.
DIAG_S500_FORMAT (diagnosis \ S500format)
Data type: BOOL, default value: FALSE, range: FALSE, TRUE
With DIAG_S500_FORMAT is decided in which format the data should be returned. With a value of TRUE, the DIAG_DATA is formatted in ABB format. With a value of FALSE, the data coming from the slave is copied without modification.
DIAG_DATA (diagnosis \ data)
Data type: POINTER TO ARRAY OF BYTE, default value: 0
This input parameter is the address of the buffer that receives the diagnosis data. The needed buffer is directly related with the variable DIAG_S500_FORMAT. Is this variable set to TRUE, 25 bytes are needed (5 bytes per error). In this case, DIAG_DATA can be defined as the example below:
ECAT_SLV_DIAG_DIAG_DATA: DIAGDAT[5]; (* size of DIAGDATA is 5. Array of 5, one for each error = 25 bytes *)
The structure DIAG_DATA is defined as follows:
TYPE DIAG_DAT : STRUCT
ERR_CLASS : BYTE;
SLAVE_NR : BYTE;
MODULE_NR : BYTE;
CHANNEL_NR : BYTE;
ERROR_NR : BYTE;
END_STRUCT
END_TYPE
In case DIAG_S500_FORMAT is set to FALSE, a buffer of 40 bytes is needed (8 bytes per error, 5 errors max.), e. g.:
ECAT_SLV_DIAG_DIAG_DATA: ARRAY [1..40] OF BYTE;
The buffer should not be smaller than the sizes given for each format. Should the buffer be smaller, it will be overwritten with unexpected consequences.