Microsoft Developer Network > Forums Home > BizTalk Server Forums > BizTalk Server RFID > Problem in printing RFID Label with Zebra R110XiIII plus
Ask a questionAsk a question
 

AnswerProblem in printing RFID Label with Zebra R110XiIII plus

  • Wednesday, September 23, 2009 11:11 AMNMohanraja Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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.

Answers

  • Tuesday, September 29, 2009 5:45 AMAndrew_ZhuMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

    You can set breakpoints and debug the code, base on the Null Reference Exception ,new DeviceConnection("WS03_OFFICE07", "ZBR2282607") may not successfully been created. check if the connection with Zebra printer is good or not.

    Regards



    Microsoft Online Community Support

All Replies

  • Tuesday, September 29, 2009 5:45 AMAndrew_ZhuMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

    You can set breakpoints and debug the code, base on the Null Reference Exception ,new DeviceConnection("WS03_OFFICE07", "ZBR2282607") may not successfully been created. check if the connection with Zebra printer is good or not.

    Regards



    Microsoft Online Community Support