RFID error codes
Error outputs are provided at two outputs of the RFID PLC function block. The two output variables iErrorID and iErrCodeRcv are described below.
iErrorID
If there is an error, the output variable iErrorID shows the type of error. The following list shows the possible values.
TYPE E_RFID_ErrID :(
eRFERR_NoError := 0,
(* general errors *)
eRFERR_TimeOutElapsed := 16#4001,
(* invalid input parameters *)
eRFERR_InvalidCommand := 16#4101,
eRFERR_IncompatibleCfg := 16#4102,
eRFERR_InvalidManufacturer := 16#4103,
eRFERR_InvalidTimeOutParam := 16#4104,
eRFERR_InvalidRawDataParam := 16#4105,
eRFERR_InvalidAccessData := 16#4106,
eRFERR_InvalidCfg := 16#4107,
eRFERR_InvalidCfgParam := 16#4108,
eRFERR_InvalidCtrlHeadNumber := 16#4109,
(* error at receive of response *)
eRFERR_InvalidResponse := 16#4201,
eRFERR_InvalidRspLen := 16#4202,
eRFERR_InvalidBlocksize := 16#4203,
eRFERR_ErrorRcv := 16#4204,
eRFERR_ChecksumError := 16#4205,
(* internal errors *)
eRFERR_UnknownReaderGroup := 16#4401,
eRFERR_CreatedTelegramTooBig := 16#4402,
);
END_TYPE
If iErrorID has the value eRFERR_ErrorRcv, an error code was received from the RFID reader. This received error code is indicated in the output variable iErrCodeRcv.
If iErrorID has a different value it may nevertheless be the case that an error has additionally been received from the RFID reader, which is also indicated on iErrCodeRcv.
Value | ID | ID | Description |
---|---|---|---|
eRFERR_TimeOutElapsed | 0x4001 | 16385 | This error occurs if the time period specified as timeout at the input (default = 5 s) has elapsed. Any action still being processed will hence be aborted. A timeout error also occurs if serial background communication does not work. This may be the case, for example, if an incorrect baud rate is set or if the task cycle time is not sufficient to process the data. See also: RFID reader connection and Documentation of the PLC library serial communication. |
eRFERR_InvalidCommand | 0x4101 | 16641 | The command has not been executed. The selected command cannot be executed with this RFID reader model. The available commands are listed in the instruction set. To ensure that the function block knows the existing RFID reader model, the GetReaderVersion command must be executed first, if possible. |
eRFERR_IncompatibleCfg | 0x4102 | 16642 | The command has not been executed. The current RFID reader configuration (see output structure ST_RFID_Config) is not compatible with the selected command (and the associated input parameters). Ensure that the configuration has been read once before. Otherwise this error code may also occur. |
eRFERR_InvalidManufacturer | 0x4103 | 16643 | The RFID manufacturer of the RFID reader model must be specified with the variable eManufacturer at the input of the generic function block FB_RFIDReader. The error eRFERR_InvalidManufacturer indicates invalid data. |
eRFERR_InvalidTimeOutParam | 0x4104 | 16644 | This error is output if the input variable "tTimeOut" is invalid. The condition tTimeOut > tPreSendDelay + tPostSendDelay applies. |
eRFERR_InvalidRawDataParam | 0x4105 | 16645 | If raw data is to be sent, it must be specified at the inbound channel of the function block. The error eRFERR_InvalidRawDataParam is output if the specification of the input variable pRawDataCommand or iRawDataCommandLen is invalid. See also: Low-level communication. |
eRFERR_InvalidAccessData | 0x4106 | 16646 | The command was not executed because the parameters specified at the input in the structure ST_RFID_AccessData are invalid. |
eRFERR_InvalidCfg | 0x4107 | 16647 | The command "Changing the configuration" was not executed because the specified configuration data are invalid. The configuration data are present as a configuration structure (bUseCfgReg = FALSE). In the case of doubt, the exact valid ranges of values for the data are given in the manufacturer’s proprietary protocol specification. If the last read configuration is used for parameters that are not available in the configuration structure (bUseCfgDefault = FALSE in ST_RFID_ConfigIn), make sure that the configuration was read first. Otherwise this error code may also occur. |
eRFERR_InvalidCfgParam | 0x4108 | 16648 | The command "Changing the configuration" was not executed because the specified input parameters of the configuration data are invalid. The configuration data should be present as a configuration register or a configuration structure. Its length or another parameter in ST_RFID_ConfigIn is invalid. |
eRFERR_InvalidCtrlHeadNumber | 0x4109 | 16649 | If an RFID reader with several read heads is addressed, the read head is specified in the input structure ST_RFID_Control. If no read head is available for the specified value, this error value is output. |
eRFERR_InvalidResponse | 0x4201 | 16897 | This error is output if the byte sequence of the received response does not correspond to any known message type or if the individual bytes do not exhibit the necessary values. The received data can be analyzed as a raw data block at the output ST_RFID_RawData. |
eRFERR_InvalidRspLen | 0x4202 | 16898 | This error message is generated if the byte sequence theoretically corresponds to a known message type, but the length is not as expected. The received data can be analyzed as a raw data block at the output ST_RFID_RawData. |
eRFERR_InvalidBlocksize | 0x4203 | 16899 | If this error value occurs, then the received data read out from the transponder could not be evaluated. The number of received bytes indicates that the configured block size does not correspond to the input at the command call. |
eRFERR_ErrorRcv | 0x4204 | 16900 | An error code was sent with the received message. The error displayed by the RFID reader is likewise output and represented by the output variable iErrCodeRcv (description at the end of this section). |
eRFERR_ChecksumError | 0x4205 | 16901 | Depending on the protocol specification a checksum, for example a CRC checksum, is sent with the telegram. If a telegram with an incorrect checksum is received by the controller, then this error is output. |
eRFERR_UnknownReaderGroup | 0x4401 | 17409 | The RFID library assigns the RFID reader models internally to groups. The error eRFERR_UnknownReaderGroup can occur if the RFID reader is not yet assigned to a group. Therefore, depending on the RFID reader model, the "GetReaderVersion" command must be executed as the first query when the program starts. |
eRFERR_CreatedTelegramTooBig | 0x4402 | 17410 | An attempt was made to send a telegram that exceeded the maximum size of 300 bytes. Only telegrams with up to 300 bytes can be sent. |
![]() | In a few cases, the RFID device sends several telegrams directly one after the other. It is therefore important to always detect and correct the first error that occurred. |
iErrCodeRcv
If an error code is sent along by the RFID reader, it is output at the output variable iErrCodeRcv. Sometimes status messages are sent by the RFID reader and then sent to iErrCodeRcv, which do not lead to an error (bError remains FALSE and iErrorID shows no error).
A list of possible values can either be found in the data type declarations (E_RFID_ErrCodeRcv_Balluff, E_RFID_ErrCodeRcv_Deister, E_RFID_ErrCodeRcv_Leuze etc.) of the PLC RFID library via the TwinCAT XAE library details or directly in the protocol specification.
For further error analysis, reference is made to the logging option. To this end, the input parameter bLogging is set. See the Parameter description in API for details.