Handling instructions
RFID library handling
If you have included the library file Tc2_RFID, you have access to all functions. The library places a function block at your disposal for communication with an RFID reader.
You can use the general function block FB_RFIDReader, which is usable for all RFID reader models, or one of the manufacturer-specific function blocks. These offer the same range of functions and almost the same interface and the same handling, and they are also optimized in terms of the code and the performance.
The function block made available for RFID reader communication offers high level communication with a high level interface. A instruction set provides various commands (see RFID command set). In addition, the integrated low-level communication allows sending and receiving of raw data (see Low level communication).
The Tc2_RFID library expects the RFID reader to respond immediately to a command and that the dialog is not interrupted by another telegram. Otherwise an evaluation may not be possible.
General handling of the function block
Depending on the RFID reader model, the device can send a telegram to the controller without a prior request. A cyclic call of the RFID function block with bExecute = FALSE is sufficient for reception.
All possible active accesses to the RFID device are listed in the instruction set (see RFID command set). The following procedure is common to all commands:
The function block is called by a rising edge on the bExecute input. Afterwards, cyclic calling of the function block (bExecute = FALSE) returns the result of the query at the output as soon as the processing of the query has been completed (bBusy = FALSE). The function block must be called (bExecute = FALSE) for as long as it takes for the internal processing (bBusy = FALSE) to be completed. During that time, all inputs of the function block must remain unchanged.
All received messages are additionally made available completely as raw data in unprocessed form at the output.
Further handling instructions can be found in the description of the input and output variables of the function block and in the tutorial and examples in this documentation.
Initialization of an RFID reader integrated via the TwinCAT library
When the system is started, the following actions are required for initializing an RFID reader integrated via the TwinCAT library:
Insofar as they are available according to the instruction set, the model information (GetReaderVersion command) and the current reader configuration (GetConfig command) must be evaluated. Because successful communication with the RFID reader is dependent on these data, it must be ensured that the current values are always available and queried if necessary.
RFID reader handling
The characteristics of the supported RFID reader models are listed in section RFID reader settings and handling. The notes listed there are allocated to the special RFID reader manufacturers.