Function block declaration

The function block FB_RFIDReader is the core of the entire RFID reader communication. The declaration and initialization of the function block is described below.

Function block declaration 1:

1. Create an instance of the function block FB_RFIDReader.
2. Hand over the manufacturer of your RFID model to the instance at the eManufacturer input.
fbRFIDReader : FB_RFIDReader := (eManufacturer := eRFRM_Balluff);
sTranspSerialNumber : STRING;

FB_RFIDReader has 7 inputs (6 in the case of the specific FBs due to the missing manufacturer data), 2 inputs/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.

3. Call the function 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 error analysis the outputs bError and iErrorID etc. should also be evaluated.

See: Using the function block