Hi,
Now i want to print a RFID tag with Zebra printer. We can open the connection with BizTalk RFID server. After that i'm getting Null Reference Exception in PrintTag command.
Code:
using (DeviceConnection deviceConnection = new DeviceConnection("WS03_OFFICE07", "ZBR2282607"))//ZBR2282607
{
try
{
deviceConnection.Open();
//deviceConnection.ExecuteVendorDefinedCommand("Zebra Technologies", "ZBR2282607", "50,50,0,4,1,1,N,");
deviceConnection.SetCurrentPrintTemplateName("CASE2");
byte[] tagIdBytes = HexUtilities.HexDecode(tagId);
byte[] tagDataBytes = HexUtilities.HexDecode("123456");
Dictionary<string, string> fields = new Dictionary<string, string>();
fields.Add("1", text);
PrintLabel label = new PrintLabel(tagIdBytes, tagDataBytes, null, null, fields, LockTargets.None);
deviceConnection.PrintTag(label);
MessageBox.Show("The tag is printed successfully");
}
catch (RfidException ex)
{
MessageBox.Show("print operation failed" + ex.ToString());
}
finally
{
deviceConnection.Close();
}
}
What was the problem? Anyone please help me in this issue.
Thanks in advance.