Pepperl-Fuchs
RFID reader settings
For smooth communication between controller and RFID readers, some settings need to be made before the system startup. These include, for example, the baud rate for the serial communication. A proprietary tool from the manufacturer of the RFID reader may be required in order to transfer these settings to the RFID.
For all supported RFID reader models, the following standard data transfer settings have been tried and tested:
Setting | Value |
---|---|
Baud rate (RS232 and RS485) | 38400 baud |
Parity Bit | none |
Data bits | 8 |
Stop bit | 1 |
If required, other parameters can be set, depending on the hardware. These must then also be adopted in the software reader connection (see RFID reader connection).
RFID reader handling
The model information (GetReaderVersion command) and the current reader configuration (GetConfig command) must be evaluated at the system start.
The received status of the device is displayed via output iErrCodeRcv of function block FB_RFIDReader and signaled in case of error by bError = TRUE and iErrorId = eRFERR_ErrorRcv. The read heads also have their own status. These can be checked with the configuration structure read via GetConfig.
The set transponder types should be checked on restarting. If the configuration structure read via GetConfig does not display the correct transponder types for each read head, they can be corrected with the ChangeDCType command. It is recommended to set the value specified for the transponder in place of the default value (99). The read/write head additionally recognizes the data storage device more quickly as a result.
When accessing the data memory of a transponder for writing and/or reading, a block size (see ST_RFID_AccessData) suitable for the transponder must be used for all Pepperl+Fuchs RFID devices!
Block sizes of possible transponders:
4 bytes (IQC21, IPC03, IQC22, IQC24)
8 bytes (IQC33)
16 bytes (IQC40, IQC41, IQC42 and IQC43)
32 bytes (IQC37)
The use of a 4-byte block size only is supported up to version 3.3.3.0 of the library.
It must be pointed out here that not all peculiarities of every supported RFID reader model can be named here. Therefore you are referred to the manufacturer’s own documentation for more detailed information.
Buffered Command
Using the bBufferedCmd input variable in ST_RFID_Control, it is possible to transmit commands that can be buffered for continuous execution at a later time. This is possible with the eRFC_GetInventory, eRFC_ReadBlock and eRFC_WriteBlock commands. A buffered command can be ended with the eRFC_AbortCommand command.
![]() | Buffered command If such a buffered command is active on a read head, the trigger mode may neither be active nor activated for this channel! Similarly, no raw data command may be transmitted that concerns this channel! |
Trigger mode
It is recommended not to use any trigger or sensor channel. The trigger mode should also be deactivated for all channels. In the factory setting for the RFID device the trigger is deactivated for all channels.
Alternatively, for example, the GetInventory command can be called cyclically or GetInventory can be called as a buffered command (bBufferedCmd in ST_RFID_Control).
The TwinCAT library offers the following option for using a sensor channel as trigger for the RFID unit:
The trigger sends a message to indicate whether it is triggered or the value is outside the trigger range. These messages are received and displayed as eResponse = eRFR_CmdConfirmation or eRFR_NoTransponder. The application can respond accordingly and trigger the required command.
To configure a channel as sensor channel/trigger, the corresponding Ident channel must be 0. The required raw data command is explained in the next paragraph.
![]() | Trigger setting The trigger setting must not be accomplished from the manufacturer's proprietary tool. Otherwise the messages of the sensor channel received as a result cannot be read by the function block of the TwinCAT RFID library. |
The correct setting of the trigger mode should be checked with the command GetConfig and by evaluating the read configuration structure. If necessary the setting can be made up for on program startup.
Sending the settings via raw data commands
For details see Low-level communication and the description of structures ST_RFID_Control and ST_RFID_RawData.
Baud rate:
To set the baud rate of the RFID device to 9600 baud send the following raw data:
ASCII | hex |
CI0,9600 | 43 49 30 2C 39 36 30 30 |
After changing the baud rate, a reset of the RFID device is necessary.
Trigger mode:
To deactivate a trigger sensor on channel 3 so that the channel can be used as read head, the following raw data should be sent:
ASCII | hex |
TM300 | 54 4D 33 30 30 |
To configure a sensor as trigger on channel 2, the following raw data should be sent:
ASCII | hex |
TM201 | 54 4D 32 30 31 |
Answer: eResponse = eRFR_CmdConfirmation when the sensor is triggered.
Answer: eResponse = eRFR_NoTransponder when the sensor is exited.
The output stTranspInfo.iHeadNumber indicates the sensor channel from which the response was sent.
To configure a sensor as inverted trigger on channel 4, the following raw data should be sent:
ASCII | hex |
TM402 | 54 4D 34 30 32 |
Answer: eResponse = eRFR_NoTransponder when the sensor is triggered.
Answer: eResponse = eRFR_CmdConfirmation when the sensor is exited.
The output stTranspInfo.iHeadNumber indicates the sensor channel from which the response was sent.
Once such setting has been made, the device configuration must be re-read with the command Get Config. It is advisable to check the settings by analyzing the read configuration structure.