Pepperl+Fuchs RFID reader

Settings of the RFID reader

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 to transfer these settings to the RFID.

This standard setting for data communication has proven itself for all supported RFID reader models:

Setting

Value

Baud rate (RS232 and RS485)

9600 baud

Parity Bit

none

Data bits

8

Stop bit

1

Depending on the hardware, other parameters can also be adjusted if necessary or the default settings of the RFID reader (38400 Baud) can be used. These must then also be adopted into the reader connection on the software side.

Handling of the RFID reader

The model information ('GetReaderVersion' command) and the current reader configuration ('GetConfig' command) must be evaluated at the system start.

The received device status is displayed via the iErrCodeRcv output of the FB_RFIDReader function block and is 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 show the correct transponder types for each read head, they can be changed with the 'ChangeDCType' command. It is recommended to set the value specified for the transponder in place of the default value (99).

For read as well as write access to the data memory of a transponder, a block size of 4 bytes (see ST_RFID_AccessData) must be used for all Pepperl+Fuchs RFID devices.

Pepperl+Fuchs RFID reader 1:

Not all peculiarities of each supported RFID reader model can be mentioned here. Therefore you are referred to the manufacturer’s own documentation for more detailed information.

Buffered Command

The input variable bBufferedCmd in ST_RFID_Control can be used to send commands that are buffered for later permanent execution.
This is possible with the commands eRFC_GetInventory, eRFC_ReadBlock and eRFC_WriteBlock.
A buffered command can be terminated with the command eRFC_AbortCommand.

Pepperl+Fuchs RFID reader 2:

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 therefore be disabled for all channels.
By factory setting of the RFID device the trigger is disabled on 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).

If a trigger is required as a sensor channel on the RFID unit, the TwinCAT library provides the following option:
The trigger provides a message whether it is currently triggered or whether the trigger range is exited. These messages are received and displayed as eResponse = eRFR_CmdConfirmation or eRFR_NoTransponder. The application can react to this and trigger the desired command.
To configure a channel accordingly as a sensor channel/trigger, the associated ident channel must = 0. The required raw data command is explained in the next paragraph.

Pepperl+Fuchs RFID reader 3:

The trigger setting must not be made from the manufacturer's own tool. Otherwise incoming messages from the sensor channel cannot be read by the TwinCAT library block.

Pepperl+Fuchs RFID reader 4:

The correct setting of the trigger mode should be checked with the command 'GetConfig' and by analyzing 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 sectionLowLevelKommunikationand the description of the structuresST_RFID_ControlandST_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

Pepperl+Fuchs RFID reader 5:

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_CmdConfirmationwhenthe sensor is triggered.
Answer:eResponse = eRFR_NoTransponderwhen the sensor is exited.
At the output stTranspInfo.iHeadNumberthe corresponding sensor channel is shown.

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.
At the output stTranspInfo.iHeadNumberthe corresponding sensor channel is shown.

Once such setting a setting has been made, the device configuration must be re-read with the command 'Get Config'. It is advisable to check the settings by analysing the read configuration structure.