Block declaration

The function block FB_RFIDReader is the core of the entire RFID reader communication. The declaration and initialisation of this block are described in the following chapter.

Block declaration 1:

Create an instance of the FB_RFIDReader.

Transfer the manufacturer of your RFID model to it at the eManufacturer input.

fbRFIDReader        : FB_RFIDReader     := (eManufacturer := eRFRM_Balluff);
sTranspSerialNumber     : STRING;

The FB_RFIDReader has 7 inputs (6 in the case of the specific FBs due to the missing manufacturer data), 2 input/outputs and 10 outputs.

In order to receive messages sent by the RFID reader to the controller, it is sufficient to call the function block cyclically. The bExecute input must thereby remain FALSE.

This is used in this example in order to implement simple presence detection for the time being. To do this, call the block as follows:

fbRFIDReader(
    bExecute        := FALSE,

    RxBuffer        := RxBuffer,
    TxBuffer        := TxBuffer,

    bBusy       => ,
    bError      => ,
    iErrorID        => ,
    iErrCodeRcv     => 
);
sTranspSerialNumber     := fbRFIDReader.stTranspinfo.sSerialNumber;

Now the last read serial number of an RFID transponder is shown in your string variable.

For failure analyzes it's necessary to process the outputs bError and iErrorID etc. too.

nächste Tutorial-Seite