User's Manual

CAEN RFID API Reference Manual
97
Event Handling
Standard tag's detection method (InventoryTag) is based on a polling mechanism: a call to the InventoryTag
method/function results in a single read cycle and the detected tags in that cycle are returned.
An useful variant ("continuous mode") uses an event mechanism to notify detected tags: a call to the
EventInventoryTag method/function starts a continuous tags' detection algorithm (multiple read cycles) and an event is
generated for each read cycle to notify the detected tags (see the CAEN RFID API User Manual.for further information).
The user of the library can define an event handler method/function that is called automatically when the event raises;
the data related to the event is passed to the handler as a parameter.
The user can define the number of read cycles that the EventInventoryTag have to perform using the ReadCycle
parameter of the relevant LogicalSource. If ReadCycle is equal to 0 the EventInventoryTag method loops indefinetely.
The continuous mode is obtained by setting to 1 both framed (bit 1) and continuous (bit 2) flags.
The "continuous mode" can be interrupted using the InventoryAbort method function.
In readers equipped with button (like the A828BT and the qID R1240I), if the event trigger flag (bit 5) is enabled and the
continuous mode is enabled (bit 1 and bit 2), the event handler is recalled every time the button is pressed.
The event handling is implemented using the standard event handling mechanism in .NET and Java/Android while in C
it is simulated using the callback mechanism.
No other methods can be invoked on logical source and reader, during the continuous mode, nor inside the event
handler. The only operation allowed is an inventory abort, that must be used to stop a reader which is working in
continuous mode.
For further information on the use of the EventInventoryTag, please refer to the CAEN RFID API User Manual.