User's Manual

CAEN RFID API Reference Manual
109
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" can be interrupted using the InventoryAbort method function.
The event handling is implemented using the standard event handling mechanism in .NET and Java while in C it is
simulated using the callback mechanism.
For further information on the use of the EventInventoryTag, please refer to the CAEN RFID API User Manual.