Feeds:
Posts
Comments

Archive for the ‘BizTalk RFID’ Category

Hello

In one of our BTS RFID implementations we are using the “DuplicateTagIdsElimination” event handler.

The event handler is part of BizTalk Server Code Samples.

The client was seeing a strange behaviour, the event handler will work properly for a while. but after some time, it would start to flag all RFID tags as duplicates.

I run a script to constantly send tags to the event handler to try to recreate the issue.

After letting it run for 24 hours, I noticed that the event handler was doing good until midnight, but right after midnight it started to mark all tags as dups.

I looked at the code: the event handler is using the current system time to determine when was a specific tag last seen. it then compares the current system time to the time embedded in the RFID tag itself.

If the elapsed time is bigger then a configurable value, the tag is marked as new, otherwise it is marked as dup.

the interesting lines in the code are:

currentTS = EventLog.getTimeStamp(System.DateTime.Now);// get the current system time

int tagTS = (int) entry.VendorSpecificData[TIMESTAMPKEY]; //get the time stamp imbedded in the tag
elapsedTime = currentTS - tagTS;// calculate the elapsed time.

The event handler fails (by marking valid tags a dups) after midnight because it uses “System.DateTime.Now” as a starting point.

“System.DateTime.Now” takes into consideration the current day.

so, a tag that was introduced at 05/22/20011 11:59:59PM will fail dup check at 05/23/2011 00:00:01AM because the day has changed and the elapsedTime values will be 86,400 (one day in seconds) instead of just 2 seconds.

To resolve this, I recommend using the dup elimination logic in BizTalk RFID Better Duplicate Tag Eliminator.

The code in this event handler is similar to the one provided from Microsoft, BUT uses different approach to calculate the elapsedTime value.

Good Luck

Uri

Read Full Post »

Hello

Today, I am proud to release the BizTalk RFID Azure Event Handlers as part of Tellago DevLabs.

 

Cloud RFID Event Handler enables uploading RFID TagReadEvents and TagListEvents to Azure storage.

The current version has 3 separate event handlers, one for each storage type, to support uploading RFID events to all 3 types of Azure storage: Blobs, Queues and Tables.

The basic concept is similar across all 3 event handlers: supply the event handler with a valid Azure account and the event handler will take care of the rest.

You can choose to use one of the event handlers or any combination of the three to achieve your specific business scenarios.

Once the events are uploaded to Azure storage, they will become available using the REST Storage Services API or custom code.

It is very important to note that all 3 event handlers return “TagReadEvent” so they can be used anywhere within the BizTalk RFID events pipeline. 

Usage Scenarios

The sky (Cloud) is the limit. Bringing the power of RFID with the ultimate visibility provided by the cloud opens the door for endless applications.

Open Supply Chain and Asset Visibility

RFID Journal states that the “EPCglobal Network ” will be used to “enable companies to share data in real time”. According to the article “When Company A ships a pallet full of soft drink, the tags on the cases and pallet are scanned as the shipment leaves, and software is used to automatically let Company B know the shipment has left the warehouse. Company B can look up data associated with the serial numbers on the shipment and learn what’s coming, when it will arrive and so on. When Company B receives the shipment, it scans the tags automatically, and a message can be immediately sent to Company A to let it know the shipment arrived

The bold lines in the quote above can now be easily achieved by posting the RFID events to the cloud and thus enabling the open supply chain. The article then states that “The potential efficiencies created by this visibility are enormous. Companies would be able to reduce inventories while ensuring product is always in the right place at the right time”.

Security and Access Control

RFID has long been used as an electronic key to control who has access to office buildings or areas within office buildings. Many companies have the need to issue multiple cards to one employee since he needs access to multiple locations. Using the cloud event handles, companies can upload user id information to the cloud and centralize the authorization system.

 

Please see more documentation ,including installation and configuration, here.

 Good luck

 Uri

 

Read Full Post »

Hello

My colleague,Suresh Girirajan, published this week the BTS data services project on codeplex.

This should be huge news if you are developing RFID solutions with BizTalk RFID or already have a deployed solution and need a lightweight monitoring system.

The project allows reading and setting properties for RFID processes, devices, device groups and RFID providers. it also allows stopping/starting RFID processes and devices.

The interface is 100% REST (written in C#) and allows both GET and PUT operations on the RFID artifacts.

Make sure to check out the code and the documentation on codeplex.

Good Luck

Uri

Read Full Post »

Hello

During development of RFID processes, we often need to debug the process in Visual studio.

one way to do this is “Debug–> Attach to Process…” option.

The issue with RFID processes is that it is not always clear which process to pick from the list.

One possible workaround is to use ”System.Diagnostics.Debugger.Launch();” inside the code. (for example inside the “ProcessTagReadEvent”).

There is no need to attach to any process. once the code is executed, you will get the “Visual Studio Just-In-Time Debugger” window (see below) where you can choose your code and it will open in debug mode.

Good Luck

Uri

Read Full Post »

BizTalk RFID Logging

Hi

I created a process using BizTalk RFID management console and set the logging level for the process to verbose.

when the process run, it did not log anything to the log file. my code was sending log entries but they were not making it to the log file.

after 30 frustrating minutes I discovered that if the root logging level for the server is set to off (see image below), the log file will not have any entries even if you uncheck the “inherit log level” check box for the process itself.

the good news is that if you set the server level logging to Verbose but set your process logging level to something else, the process settings will override the server logging level.

good luck

Uri

Read Full Post »

Hello

This is the third part of my multi-series of posts regarding using custom types as input for event handlers.

in part 1 I described the problem I faced and outlined the solution. I also demonstrated how to create a custom object that can hold both non-rfid and rfid related objects and return it.

in part 2 I showed how to use the return object from the first event handler as the input for the second event handler. I also showed how to cast the rfid object to TagReadEvent

This part has the complete source code used for this series.

The code is written using c# and also contains “rfidProcess.xml” which is the actual RFID process exported from BTS RFID Manager.

The complete source code can be found here.

Good luck

Uri

Read Full Post »

Hello.

This is the second part of my multi-series of posts regarding using custom types as input for event handlers.

in part 1 I described the problem I faced and outlined the solution. I also demonstrated how to create a custom object that can hold both non-rfid and rfid related objects and return it.

in this part, I will show how to handle the output of part 1 as an input for the next event handler:

  1. The entry point in the second event handler has to have its input type match the return type of the first event handler. since the return value from the first event handler derived from  ”RfidEventBase”, the method signature can be something like this:  public void ProcessCustomEvents(RfidEventBase customEvent).
  2. The return object form the first event handler had 2 objects in it. Inside the method declared above, we declare 2 objects to hold them:
    • object objTagReadEvent;
    • object strADP;
  3. Extract the individual events from the custom event collection:
    • customEvent.VendorSpecificData.TryGetValue(“rfidTagReadEvent”, out objTagReadEvent);
    • customEvent.VendorSpecificData.TryGetValue(“_ADP”, out strADP);
  4. Since “strADP” is a string, it is ready to be used. The rfid object needs to be casted to a TagReadEvent type before we can use it:
    • TagReadEvent tagReadEvent = (TagReadEvent)Convert.ChangeType(objTagReadEvent, typeof(TagReadEvent));
  5. Now that the cast is complete, we can use tagReadEvent in the same way we are used to:
    • string deviceName = tagReadEvent.DeviceName;
    • string rfidSource = tagReadEvent.Source;
    • DateTime rfidEventTime = tagReadEvent.Time;
  6. if we need to loop on the custom event that is the input parameter, we can do this:

foreach(object var in customEvent.VendorSpecificData.Values)

{

string strEvent = var.ToString();

}

 

the complete method code is:

public void ProcessCustomEvents(RfidEventBase customEvent)

{

//get the total number of events inside the custom event

int customEventCount = customEvent.VendorSpecificData.Count;

//objects to hold the individual events

object objTagReadEvent;

object strADP;

//extract the individual events from the custom event collection

customEvent.VendorSpecificData.TryGetValue(“rfidTagReadEvent”, out objTagReadEvent);

customEvent.VendorSpecificData.TryGetValue(“_ADP”, out strADP);

//cast the object to rfid tagReadEvent

TagReadEvent tagReadEvent = (TagReadEvent)Convert.ChangeType(objTagReadEvent, typeof(TagReadEvent));

//get rfid properties

string deviceName = tagReadEvent.DeviceName;

string rfidSource = tagReadEvent.Source;

DateTime rfidEventTime = tagReadEvent.Time;

 //incase we need to loop on the Values collection

foreach (object var in customEvent.VendorSpecificData.Values)

{

string strEvent = var.ToString();

}

}

 

Next time, I will put it all together and post the complete source code.

good luck

Uri

Read Full Post »

Hello

this is the first part in a multi-series of posts regarding using custom types as input for event handlers.

in my current project the client has a requirement to raise events to event broker while processing rfid events inside the event processing pipeline of BizTalk rfid.

for example: during processing of one of the event handlers, we call an external web service that returns a value. the returned value is not related to rfid directly (it is some other important business value). the requirement is to report this value to event broker.

Solution:

Create a custom event handler to report events to event broker.

Issue:

How to pass custom values that are not tied to tagReadEvent or tagListEvent to the event handler?

Disucssion:

if you read bullet #2 in this article, you will see that the documentation states “for subsequent event handlers in the pipeline, any input type is allowed, as long as it conforms with the return type of the previous event handler in the pipeline”.

This statement might be misleading because you CAN NOT really use any input type, you can use any input type that derives from “RfidEventBase” abstract class.

I think that the technical representation of the issue at hand can be split into 2 major questions:

  1. How can I pass non-rfid objects from one event handler to another?
  2. How can I pass both non-rfid objects and rfid related objects (like “tagReadEvent”) in a single input parameter?

both of the above question can be answered by creating a custom type deriving from “RfidEventBase” and adding any desired objects to it. (the objects may be primitive types like string, integer or complex types like tagReagEvent)

let’s look at some code:

  1. “RfidEventBase”  is an abstract class so no direct instantiation from it. to create an object from it we:
    • create a new class that derives from “RfidEventBase” - internal class CustomEvent : RfidEventBase{ }
    • instantiate an object from the new class - CustomEvent customEvent = new CustomEvent();
  2. Add any desired number and type of objects to “customEvent” object:
    • add an int value - customEvent.VendorSpecificData.Add(“_ADP”, 12345);
    • add TagReadEvent type - customEvent.VendorSpecificData.Add(“rfidTagReadEvent”, tagReadEvent);
  3. Return the custom object to serve as an input for the next event handler in the pipeline (which will be the event broker event handler):
    • return customEvent;

next time, we will look at how to handle the custom event as an input to the next event handler.

Read Full Post »

Hello

the “RfidClientConsole.exe” is a nice console app that performs some operations on the RFID system.

you can find it in <Microsoft BizTalk RFID install folder>\bin

usage examples

  • Unregister event handler: RfidClientConsole.exe UnregisterEventhandlersInAssembly <Assembly name without the extension>

 

I will be adding more samples as I use them.

Uri

Read Full Post »

Hello

I received a wired error the other day while trying to add an event handler using BizTalk RFID manager.

The error was complaining about not being able to find any public component event handler implementation in the assembly.(see image below)

Needless to say (but I will say it anyway) that the code was OK and did have all the necessary elements. (I used the Event Handler Template from here.)

 It turned out that I had to have a reference to Microsoft.Rfid.Util.dll in my project(even though I did not use any code from that dll) for the event handler to be successfully registered using the BTS RFID manager.

Good luck.

Uri

Read Full Post »

Follow

Get every new post delivered to your Inbox.