GetRFID
Reads the transponder ID detected by the Codatex RFID sensor
Contents
Syntax
transpID = GetRFID(port)
transpID = GetRFID(port, handle)
Description
transpID = GetRFID(port) returns a 5-byte transponder ID (datatype is uint64). The given port number specifies the connection port. The value port can be addressed by the symbolic constants SENSOR_1, SENSOR_2, SENSOR_3 and SENSOR_4 analog to the labeling on the NXT Brick.
The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call COM_SetDefaultNXT to set one).
Note:
The RFID-tag should be placed in a distance of about 1 to 3cm from the RFID sensor. If the transponder was successfully detected, the orange LED of the sensor will flash. Very rarely, when operating with multiple ID tags close to each other, an ID might not be read correctly (in this case it's usually easy to spot, as it looks very different from the "usual" tag IDs).
Please also note that this function returns about 3 to 5 readings per second when used with USB. Bia Bluetooth however, a single function call can take as long as 1 second, depending on connection quality.
Example
OpenRFID(SENSOR_2); transID = GetRFID(SENSOR_2); CloseSensor(SENSOR_2);
See also
Signature
- Author: Linus Atorf, Rainer Schnitzler (see AUTHORS)
- Date: 2008/12/1
- Copyright: 2007-2010, RWTH Aachen University