RFID Reader Interface User's Guide
2.3 Extending the Reach
Mobile Readers
Function Manual, 12/2010, J31069-D0198-U001-A2-7618
35
We store incoming tag events in a list of tag events for later delivery
public void NotificationHandler(object sender, RfNotificationArgs
notificationArgs)
{
...
if (null != notificationArgs.TagEvents)
{
foreach (RfTagEvent tagEvent in notificationArgs.TagEvents)
{
// Remember this tag event when filtering for later
// confirmation
this.bufferedTagEvents.Add(tagEvent);
}
}
...
}
// This is our internal list to store tag events
private List<RfTagEvent> bufferedTagEvents = new List<RfTagEvent>();
Remember that as long as we are scanning, all acquired data is only stored locally on your
RFxxxM
device. A connected RF-MANAGER runtime will not see a single one of the scanned
tags.
Now we can present the buffered tags to an end user such as Molly. If she confirms that all
shown tag events are valid, we can forward them to the RF-MANAGER runtime by calling
the SetTagEvents function as shown below:
public void ConfirmTagEvents()
{
...
if (this.bufferedTagEvents.Count > 0)
{
RfReaderApi.Current.SetTagEvents(RfReaderApi.NC_RFID,
this.bufferedTagEvents.ToArray());
}
...
}
Notice that the second parameter for the SetTagEvents function is just a list of tag events. In
the code above, simply all buffered tag event items are passed on to the function. The only
other information needed is the name of the data source within our reader service that will
receive the tag events. Again, we can safely rely on the system’s default component names
and use the given constant RfReaderApi.NC_RFID.
Contrary to subscribing for tag event notifications – where we simply used NC_ALL – we are
not allowed to use a generic name such as ‘all’ here but we have to address a specific data
source.
Running the code above now passes on the read tag events to the connected RF-
MANAGER runtime.
As said in our case the whole list of tag events. However, nothing prevents you from
selecting only some of the tag events, deleting events, adding your own tag events or
changing the values of a tag event before handing it over to the SetTagEvents function.
That way you can allow ‘Molly-like’ filtering for example by providing all tag events in a list
and letting the user select those events to be passed on.
And voila! We are able to make both Jerry and Molly happy again.
Summary of Contents for SIMATIC RF610M
Page 2: ......
Page 8: ...Introduction Mobile Readers 8 Function Manual 12 2010 J31069 D0198 U001 A2 7618 ...
Page 79: ......