ST_RFID_Control

TYPE ST_RFID_Control :
STRUCT
    sSelTranspSRN       :T_RFID_TranspSRN;     (* serial number shown as hex coded string(ascii) *)

    tPreSendDelay       :TIME;          (* condition: tTimeOut > tPreSendDelay + tPostSendDelay *)
    tPostSendDelay      :TIME;          (* condition: tTimeOut > tPreSendDelay + tPostSendDelay *)

    iSrcAddrSnd         :UDINT;         (* RS485 address *)
    iDstAddrSnd         :UDINT;         (* RS485 address *)
    bAddrAutoMode       :BOOL   := TRUE;        (* if AutoMode is activated the communication addresses are handled automatically and set addresses are not used. *)

    bLogging            :BOOL;

    iHeadNumber         :USINT  := 1;       (* if multiple read heads are installed at the reader unit, one can be selected *)
    iDCType             :USINT  := 1;

    pRawDataCommand     :DWORD;             (* data input for low level communication *)
    iRawDataCommandLen  :UINT;

    bBufferedCmd        :BOOL;

    iVHLFileID          :USINT  := 16#FF;           (* selection of VHL file; default 0xFF (ad hoc VHL file of vhlSetup) *)

    iCardTypeMask       :UINT   := 16#FFFF;     (* select which card type should be detected via GetInventory; default 0xFFFF (all types) *)
    bReselect           :BOOL   := TRUE;        (* with Reselect every GetInventory gets the first item of the reader's detected card list *)
    bAcceptConfCard     :BOOL   := TRUE;        (* a read command also accept configuration cards to configure the rfid reader *)
END_STRUCT
END_TYPE

The input structure stCtrl contains variables, such as the serial number, with which the behaviour of the function block can be parameterised.

Optional the two variables tPreSendDelay and tPostSendDelay offer the possibility to parameterize delay times. Further information at the ende of this page.

ST_RFID_Control 1:

RS485

The PLC RFID library does not support more than one RFID reader on one RS485 network for the time being. A separate connection must be made to a separate terminal for each RFID reader. Individual addressing with iSrcAddrSnd and iDstAddrSnd is not necessary in this stand-alone operation. Accordingly, the addressing can be performed automatically by the PLC RFID library, to which end the input variable bAddrAutoMode can be left at TRUE.

all manufacturers:

tPreSendDelay

Before sending a command to the RFID reader, the function block waits until the time specified by tPreSendDelay has elapsed.

tPostSendDelay

After sending a command to the RFID reader, the function block waits until at least the time specified by tPostSendDelay has elapsed. If the expected response has not arrived by then, the function block continues to wait for the response until the specified timeout time tTimeOut has elapsed at the latest.

iSrcAddrSnd

Source address in the case of RS485 communication. This address is used if bAddrAutoMode is not set.

iDstAddrSnd

Destination address in the case of the RS485 communication. This address is used if bAddrAutoMode is not set.

bAddrAutoMode

Option in the case of RS485 communication. The RS485 addresses are assigned automatically if bAddrAutoMode is set (default = TRUE). The addresses given above are not used. If bAddrAutoMode is deactivated (FALSE), then the addresses given above are used.

bLogging

An additional output can be activated with bLogging. The serial communication can thus be reconstructed with the aid of Log View Messages. These messages can be viewed in the Windows Event Viewer as well as in the TwinCAT system manager. This is useful for test and analysis purposes. The output format is not defined to allow enhancements.

ST_RFID_Control 2:

The first time the function block is called with bLogging=TRUE the message 'Logging initialized.' is output. In this first cycle no communication data is monitored.

pRawDataCommand

The regular function block of the PLC RFID library can similarly be used for low level communication. In this case, raw data can be sent directly to the RFID reader. The raw data to be sent (e.g., as a byte array) must be specified in this input variable. This is a pointer to the raw data to be sent. The TcRFID library only accesses this address for reading. Further information on the low-level communication sequence is summarized in the chapter Low level communication. Both the transmitted and the received raw data can be viewed at any time at the output by means of the structure ST_RFID_RawData.

iRawDataCommandLen

The input variable iRawDataCommandLen specifies the length in bytes of the raw data specified by the pointer pRawDataCommand.

Balluff:

iHeadNumber

If a RFID reader with multiple read heads is connected, the choice for a specific read head is done in the input variable iHeadNumber.

iDCType

With iDCType the memory size (0->64bytes, 1->32bytes) of the chip can be set for Balluff readers.

Baltech:

iVHLFileID

Read und Write commands will be executed using the VHL-file specified in iVHLFileID. This file has to be saved in the reader's configuration. If iVHLFileID is 0xFF [default] the reader will not use a normal VHL-file stored in the reader's configuration but a simple ad hoc VHL-file which can be used to access blank non configured/encoded cards.

iCardTypeMask
[since library v.1.2.4]

The iCardTypeMask instructs the RFID Reader to select only the parametrized specific card families. Only the parametrized card families will be detected with the command GetInventory. All other card types will be filtered out. Keep the default value [default: 0xFFFF] if every card type should be available. For each card family the corresponding bit has to be set in iCardTypeMask. see "Extracted nested table 1"

 

Card Type

Card Family

CardTypeMask

Mifare / ISO 14443-A

1

0x0001 (Bit 1)

LEGIC

2

0x0002 (Bit 2)

ISO 15693

3

0x0004 (Bit 3)

ISO 14443-B

4

0x0008 (Bit 4)

PICOPASS via ISO 14443-2-B

5

0x0010 (Bit 5)

PICOPASS via ISO 15693

6

0x0020 (Bit 6)

bReselect
[since library v.1.2.4]

If bReselect is set [default: TRUE] every call of GetInventory outputs a transponder type if a transponder is within the HF field. If it's sure that only one card is within the HF field this setting should be kept.

If there are more than one card within the HF field a list of detected cards exists in the RFID device. To enable the detection of all cards by the command GetInventory the input variable bReselect has to be switched off [FALSE]. The command GetInventory works them off, one by one. After all cards have been selected the response is eRFR_NoTransponder. Only if a card is moved out of and again into the HF field the command GetInventory outputs its card type and serial number again.

 

 

bAcceptConfCard
[since library v.1.2.4]

If bAcceptConfCard is set [default: TRUE], also configuration cards are detected with the command GetInventory. The RFID Reader tries to adopt automatically the configuration. To avoid an influence by unknown configuration cards the variable can be deactivated.

Leuze:

sSelTranspSRN

The serial number of the transponder to which the command (e.g. read/write) is to be applied can be specified as a string on the input variable sSelTranspSRN. This is not necessary in most cases. If a certain reader configuration makes this necessary, details for this are to be found in the relevant description in the proprietary specification.

Pepperl+Fuchs:

iHeadNumber

If an RFID reader with several read heads is addressed, a choice of read head is specified in the input variable iHeadNumber.
iHeadNumber is also referred to as IdentChannel.

iDCType

With this variable and the command 'ChangeDCType' the transponder type can be set on the read head of Pepperl+Fuchs readers. Possible values for this are listed in the proprietary protocol under the 'ChangeTag' command. (They do not match the values of the E_RFID_TranspType enumeration) Extract of supported transponder types: see "Extracted nested table 2"

Data Carrier Type [dec]

Description P+F

Chip Type

Frequency

02

IPC02

Unique, EM4102

125 KHz

03

IPC03

EM4450

125 KHz

14

IPC14

T5557 (Atmel)

125 KHz

20

 

all ISO 15693 complaint data carriers

13.56 MHz

21

IQC21

I-Code SLI (NXP)

13.56 MHz

22

IQC22

Tag-it HF-I Plus (TI)

13.56 MHz

23

IQC23

my-D (infineon) SRF55V02P

13.56 MHz

24

IQC24

my-D (infineon) SRF55V10P

13.56 MHz

33

IQC33

Fujitsu FRAM MB89R118

13.56 MHz

35

IQC35

I-Code SLI-S (NXP)

13.56 MHz

...

...

...

...

99

 

default type of the connected read head

 

bBufferedCmd

Most commands are processed once immediately after the call. Depending on the RFID reader, commands can be present continuously. This enables, among other things, a read process as soon as the RFID transponder enters the reading field, without sending an extra command. This can either be configured in the RFID reader configuration (Balluff, Deister, Leuze) or selected with this input variable (Pepperl+Fuchs).

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!

Delay times

The two variables tPreSendDelay and tPostSendDelay offer the option of parameterizing delay times.
Both variables ensure that a delay is waited for between two requests to the RFID reader. If the delay time is specified as tPreSendDelay, a delay between the last response telegram and the next request telegram is ensured. If the request telegram is to be sent as directly as possible, tPostSendDelay can be used.
The condition 'tTimeOut > tPreSendDelay + tPostSendDelay' applies. Otherwise an error is generated at the output.

ST_RFID_Control 3:

A minimum delay time of 300 ms between two commands is specified in the proprietary protocol of the Balluff RFID reader.

ST_RFID_Control 4:

A minimum delay time of 150 ms between reception and command is specified in the proprietary protocol of the Leuze electronic RFID reader.

ST_RFID_Control 5: