V740 RFID READER/WRITER, ANTENNA
2005-09, REV0.1
OPERATION MANUAL
40 of 56
©OMRON CORPORATION 2005
4.
Reader
Control
The client software can register a command with a
cursor name to the reader. This section describes
Cursors (Stored Procedures or Aliases ) and Reader
settings.
i. Cursors
Declare
The client software has the ability to declare cursors
(saved queries), which it can then use to request data
repeatedly using the FETCH or the AUTO_MODE
command. Only one cursor can be executed at one
time. A maximum of 16 cursors can be defined.
To create a cursor:
DECLARE
cursorname
CURSOR FOR
query;
cursorname
— an arbitrary string.
query
— an RQL query (SELECT/UPDATE
statement), as defined above.
If the query is valid in its syntax, an empty event (only
LF code) is returned. If invalid, an error message is
shown(Ref. Table 9).
Example:
DECLARE cursor1 CURSOR FOR SELECT id,
antenna_id FROM tag_id WHERE
protocol_id='EPC1';
DECLARE cursor2 CURSOR FOR UPDATE
tag_data SET id=0xFEDCBA9876543210
WHERE protocol_id='EPC1' and
antenna_id=1;
Note:
Commands for getting information and setting
the separator can not be used as cursors.
Close
Used to close(delete) a cursor and free its
resources(only 16 cursors may be defined
simultaneously). Only one cursor can be closed at one
time. The client software issues the command:
CLOSE
cursorname
;
If the cursorname is valid, following the command, an
empty event (only LF code) is returned.
Reset
To reset the reader RQL server, for example, if the
RQL state is undefined or questionable, use:
RESET;
Following the command, an empty event (only LF
code) is returned. The command returns the RQL
daemon to its initial state; that is, resets the reader,
deletes cursors and clears memory.
ii.
Execution
Commands stored as cursors can be executed in 3
ways as described below.
Fetch
To execute the stored cursor, a FETCH command is
sent by the client software. Only one cursor can be
executed at one time.
FETCH
cursorname
;
which performs all actions appropriate to the declared
query and sends the result back.
Example:
DECLARE cursor3 CURSOR FOR SELECT id,
antenna_id FROM tag_id WHERE id =
0x11111111111111111111 AND
protocol_id='EPC1';
FETCH cursor3;
could return:
if the tag was read by antenna 2,
0xCE791111111111111111|2<LF><LF>
or if the tag was not found.
<LF>
Auto Mode
The client software may switch the reader into Auto
Mode, causing the reader to repeatedly execute a
cursor indefinitely.
SET auto
cursorname
= ON, repeat =
interval
;
For example,
DECLARE cursor4 CURSOR FOR SELECT id,
antenna_id FROM tag_id WHERE
protocol_id='EPC1' SET time_out=250;
SET auto cursor4 = ON, repeat = 500;
Every 500 milliseconds, the cursor executes for 250
milliseconds querying for tags. The remaining 250
time
DECLARE
FETCH
RQL execution
Response
Sequence of execution