RFID Application Development with PowerBuilder and .NET Matthew Teskey Product Manager, iAnywhere Agenda RFID Anywhere recap Tasks in RFID application development Development options with RFID Anywhere Distributing business logic effectively Code sample walkthroughs Become an RFID Anywhere Insider RFID Anywhere overview Handles data movement from readers to enterprise systems while adding business value Allows developers to focus on creating business logic and value by abstracting low-level hardware, standards and protocols Rich management and distributed architecture Provides flexible development options and tools to make developers and integrators successful For a detailed RFID industry and RFID Anywhere product overview, see the slides from earlier course MOB356 - RFID 101 and Solution Overview RFID Anywhere architecture Tasks in RFID application development What does it mean to build an RFID application? Hardware integration Decoding raw data Edge processing Business context mapping Integrating with the enterprise Hardware integration Collecting raw data from wide range of hardware • RFID, barcode, mobile devices, sensors, PLCs, etc. Controlling hardware • Intelligent RFID solutions will control when RFID readers ‘read’ based on sensor and GPIO data • Indicate system status using message boards, light stacks • Print and verify RFID labels and tags Decoding raw data HEX representation from reader 30700048440663802E185523 Binary 0011000001110000000000000100100001000100000001100110010000000000000101110000110000101010100100011 URI representation after decoding urn:epc:tag:sgtin-96:3.0037000.06542.773346595 Filter Company Prefix Item Reference Unique Serial Number 3 0037000 06542 773346595 Procter & Gamble Bounty ® Paper Towels 15 Pack Unique serial number for item Shipping Unit Edge processing You often hear about massive amounts of RFID data being generated by a system, and the concerns of data overload • However, only a small amount of this data is actually valuable Smoothing • The ability to ignore temporary data inconsistencies to avoid generating meaningless events to business logic – i.e.: if a tag seemingly disappears during a 5 second span, but then gets read again, was it ever really gone? Filtering • The ability to not report on tags that match a specific criteria – i.e.: certain application cares about tags on pallets, not about tags on cases or items Mapping data to business context Mapping tag data to actual asset • Business logic and enterprise applications don’t want to worry about HOW the data is stored, just WHAT the data represents • Need to expose business-level fields to business logic Facilitating process automation • Proximity sensor event at Door1 connector implies that there are assets at Door 1 to read, so turn on readers Add business-level relationships and semantics to data • i.e.: Report says that 50 case-level tags and 1 pallet-level tag were seen between 1:00 and 1:05 at the dock door implies that 50 cases were on the same pallet Enterprise integration Getting RFID and other event data into enterprise systems for further action • Additional processing, analyzing, persisting, reporting Variety of enterprise systems might be interested in RFID data • Implies possibly multiple integration points, data formats Not all data processing may make sense at hardware or middleware layer • Enterprise layer, including database, may be better able to integrate with other systems to do field mapping, aggregation, etc. Developing applications with RFID Anywhere This section will focus on what and how you can develop in RFID Anywhere But just as important is what you DON’T have to develop yourself Tasks in RFID application development with RFID Anywhere Hardware integration • RFID Anywhere does the low-level integration for you Decoding raw data • RFID Anywhere provides a flexible architecture Edge processing • RFID Anywhere provides broad development options Business context mapping • RFID Anywhere exposes useful data Integrating with the enterprise • RFID Anywhere and Sybase provide flexible integration Hardware integration with RFID Anywhere Developers do not have to write low-level hardware integration code or work with hardware vendor APIs • RFID Anywhere abstracts this layer through its connector/controller architecture Decode raw data with RFID Anywhere RFID Anywhere offers Data Protocol Processor (DPP) architecture • Use from application, business module or Report Engine MP to encode and decode raw RFID tag data • Enables flexible tag and protocol selection • Enables flexible data format, including encryption Developers can write custom DPPs 3 components to a DPP • Schema – Defines the data fields that represent business context of data • Decode method – Takes raw tag data and converts to data set according to encoding • Encode method – Takes data set and converts to encoded data that can be written to tag Edge processing with RFID Anywhere Business Modules • Use included Visual Studio extension to create custom logic • Handle hardware events with the power of .NET • Easily interact with other applications, libraries or data sources Application Level Events (ALE) • Generate XML reports on tag activity for EPC tags Report Engine MP • Generate XML reports on tag activity for EPC, ISO and custom tags Business modules overview Focus on creating business logic • Wizards provide shell code and framework • Logic runs inside RFID Anywhere engine • Simple interaction with other RFID Anywhere components, libraries, applications, etc. • Libraries to help with common tasks Business logic runs at the edge • • • • Add value to raw data from hardware Send important, processed information to enterprise Orchestrate devices at the edge Expose methods as Web Services Knowledge state transitions RFID tag events During successive reads, tags move from state to state (knowledge state change is the ‘event’) • Each state change generates an event in RFID Anywhere – i.e. New > Observed generates TagEventType.Observed event • Triggers the OnRnEvent method of the business module • Developers check for the type of event, then details of the event – New or observed, which reader/antenna it came from, tag ID, etc. RFID Anywhere’s smoothing engine enables these events • Developers configure timeouts and thresholds on each connector for when these events should occur • i.e.: if a tag is not read for 30 seconds, consider it lost, and generate a TagEventType.Lost event for the tag Business modules handle events from controllers Business modules have high level OnRnEvent( RnEventArgs[ ] args) method that gets called automatically for any hardware event Developer iterates through event arguments, checking for: • Specific types of events – RfidMPEventArgs, GPIOEventArgs, BarcodeEventArgs, ProximityEventArgs, PlcEventArgs • Values of event object properties – RfidMPEventArgs.TagID, ProximityEventArgs.Status Then act on the event • For example, if ProximityEventArgs.Status is TRUE, then instruct an RFID reader to begin reading Business module example Decode RFID tag and send processed output to enterprise application public void OnRnEvent( RnEventArgs[] args) { // Iterate through available events foreach( RnEventArgs arg in args ) { if( arg is RfidMPEventArgs ) { RfidMPEventArgs rfidEvent = ( RfidMPEventArgs )arg; if( rfidEvent.EventType == TagEventType.Observed ) { // Handle observed tag tag = DecodeTag(rfidEvent.Tag); xmlout = CreateXML(“TagObserved”,tag.decodedTagID, tag.Company,tag.SKU,tag.Source); mSubscribers.FireXML(xmlout); } else if( rfidEvents.EventType == TagEventType.Lost) { // Handle lost tag . . . Business module example output Output of business module is custom XML sent over configured messaging connectors Receiving application processes output when it arrives <?xml version="1.0" encoding="utf-16" standalone="yes"?> <TagObserved> <ID>1.9.22.3</ID> <Company>MobilityFirst</Company> <SKU>Pedlar Light Workout Exerciser</SKU> <Source>MyReader\Antenna1</Source> </TagObserved> Business module example 2 Using a proximity sensor to control when an RFID reader should look for tags to reduce power consumption and interference public void OnRnEvent( RnEventArgs[] args) { // Iterate through available events foreach( RnEventArgs arg in args ) { // Identify ProximitySensor events if( arg is ProximityEventArgs ) { // Typecast the generic event to a ProximitySensor event ProximityEventArgs proximityEvent = ( ProximityEventArgs )arg; if( proximityEvent.Status ) { // Proximity sensor was triggered, so write code here // to instruct reader to read for 1 minute } } else { // Handle other events here . . . . . . Application Level Events (ALE) Provides a standards-based method for applications to request and receive EPC tag data Filter and consolidate data from multiple sources Exposes data in the form of periodic, XML-based ‘event cycle reports’ or ALE reports • An event cycle is a configurable series of h/w read cycles • Reports summarize tag activity during the event cycle • Application that receives report processes report and adds business context Reports and event cycles are configurable • Filtering, grouping, tags to report (current, added, deleted) RFID Anywhere has full support for ALE • No development required at RFID Anywhere layer; develop application to receive and process report Sample ALE event cycle report <?xml version="1.0" encoding="utf-8"?> <ECReports xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1" creationDate="2005-09-22T09:07:08.0000000-04:00" specName="InvTracSource1ALE" date="2006-07-11T14:38:02.1144806-04:00" ALEID="235f30b2-aedc-40dd-bd9e-c2f00bd4873a" totalMilliseconds="5007" terminationCondition="DURATION" xmlns="urn:epcglobal:ale:xsd:1"> <reports xmlns=""> <report reportName="Source1Deletions"> <group> <groupList> <member> <tag>urn:epc:tag:sgtin-96:1.000009.0000022.3</tag> </member> </groupList> <groupCount> <count>1</count> </groupCount> </group> Report Engine MP An alternative for ALE • Outputs ALE-style XML reports • Enterprise application receives and processes reports • Declarative model for report properties Some significant improvements • Multiprotocol support to collect data from different protocols – Combine data from ISO and EPC tags into one report – Can use multiple DPPs to create a report using data from multiple protocols • Scheduling support – “Send me this report every day at 5:00pm except on weekends.” • Use SQL statements to build report – Create filtering and grouping sets using SQL instead of URI pattern matching • Data fields extracted and identified in report – Simplifies XML report processing Sample multiprotocol report <xrnet:group name="Group1"> <xrnet:groupDef> <xrnet:query>select * from sgtin96 where CompanyPrefix=1</xrnet:query> <xrnet:groupCount>10</xrnet:groupCount> <xrnet:groupList> <xrnet:member id="303800004000008000000005“ Uri="urn:epc:tag:sgtin-96:1.000001.0000002.5“ Filter="1“ CompanyPrefix="1“ ItemReference="2“ SerialNumber="5" Partition="SIX" Encoding="sgtin96" /> <xrnet:member id="303800004000008000000006“ Uri="urn:epc:tg:sgtin-96:1.000001.0000002.6“ Filter="1" CompanyPrefix="1“ ItemReference="2“ SerialNumber="6" Partition="SIX" Encoding="sgtin96" /> <xrnet:member id="303800004000020000000001“ Uri="urn:epc:tag:sgtin-96:1.000001.0000008.1“ Filter="1" CompanyPrefix="1" ItemReference="8“ SerialNumber="1" Partition="SIX" Encoding="sgtin96" /> … Business context mapping with RFID Anywhere Discussions of various development options highlights choices in where business logic can be executed • Business modules – Can do all of the data processing, mappings, and process automation, then send properly-formatted output to enterprise application for display or persistence – Or, could send data that needs further processing • ALE and Report Engine MP – Send reports that need to be consumed by another process or application to derive business context Integrating with the enterprise RFID Anywhere offers out-of-the-box integration connectors to send output to enterprise systems • MSMQ, QAnywhere, SMTP, SOAP, UDP, TCP, file creation • Flexible architecture allows custom connectors to be created for integrating with proprietary or legacy systems • Developers don’t have to write low-level communication code to send output from RFID Anywhere • Send to multiple locations without writing additional code Easily expose secure Web Services • Business module methods, ALE, controllers Sybase’s end to end RFID offering, RFID Enterprise, provides integration to existing business applications • Database persistence, process modeling, reporting Flexible development options Components you can develop in C# • • • • DPPs Custom business modules Enterprise applications and processes Helper classes Components you can develop in PowerBuilder • Enterprise applications and processes • Helper classes Components you can develop in Java, other .NET languages, web technologies, etc. • Enterprise applications and processes Obtaining code samples For code samples, including those discussed in this session, become an RFID Anywhere Insider Free access to technical resources to make your RFID project a success • Free version of RFID Anywhere Developer Edition – Build and test with the simulator or with physical hardware • Various documents on a wide range of topics – Whitepapers, tutorials, Tech Tips, and more • Newsgroups – Interact with iAnywhere, or with other developers/integrators Register now at www.ianywhere.com/RFID Summary RFID applications introduce a number of unique challenges and concepts RFID Anywhere allows developers to focus on the application-specific business logic and integration, without getting lost in low level hardware and data complexities Learn more at www.ianywhere.com/RFID iAnywhere at TechWave 2006 Tech Support at TechWave 2006 • Meet with technical experts from Sybase iAnywhere and TeamSybase • Bring your technical questions and get answers on the spot! • Located off the Exhibit Hall on the fourth floor, Palace Ballroom Foyer Ask the iAnywhere Experts • Drop in during support hours to have your questions answered by experts! • Appointments are available to speak one-on-one with Senior Engineers • Located across from the Tech Support area TechWave-To-Go AvantGo Channel on your handheld device • Download the TechWave AvantGo channel for up-to-date details on sessions, events, maps and more • www.ianywhere.com/techwavetogo • Visit the AvantGo Kiosk on the 3rd floor iAnywhere at TechWave 2006 Reference Program • Share your vision and innovation with your peers • Come by the Information Desk at the Sybase booth to complete a survey form -- all submissions will receive a gift! iAnywhere Developer Community A one-stop source for technical information! • Access to newsgroups, new betas and code samples • Technical whitepapers, tips and online product documentation • Excellent resources for commonly asked questions • All available express bug fixes and patches • Network with thousands of industry experts http://www.ianywhere.com/developer
© Copyright 2024