0

I am testing CS8300 RFID tag by using Motorola Scanner SDK and Motorola DS9808-SR rfid reader.

Basically, all the simple tasks work: let scanner beep, getting epcID through attribute 35001, etc; EXCEPT:

That I ALWAYS get status 2 (which means 'tag not found') from attribute 35009 after specifying a tag id through attribute 35002. Note: Attribute Explained in this doc

As you can see in my code (around line 80 'attribute 35002 setup'), I tried many different formats of epcID, like 0080B0403C0000000C015F85 or 0x00 0x0e 0x08 0x80 0x00 0x80 0xb0 0x40 0x3c 0x00 0x00 0x00 0x0c 0x01 0x5f 0x85 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00, but none worked.

What do I miss? By the way I tested several BAP tags already. Tags themselves are good because they can be read by other readers/SDKs.

My code:

using System;
using System.Collections.Generic;
using System.Text;
using CoreScanner;

namespace SampleApplication
{
    class Program //page 118 Motorola Scanner SDK for Windows Developer Guide.pdf
    {
        // Declare CoreScannerClass
        static CCoreScannerClass cCoreScannerClass;
        static void Main(string[] args)
        {
            //Instantiate CoreScanner Class
            cCoreScannerClass = new CCoreScannerClass();
            //Call Open API
            short[] scannerTypes = new short[1]; // Scanner Types you are interested in
            scannerTypes[0] = 1; // 1 for all scanner types
            short numberOfScannerTypes = 1; // Size of the scannerTypes array
            int status; // Extended API return code
            cCoreScannerClass.Open(0, scannerTypes, numberOfScannerTypes, out status);
            if (status == 0)
            {
                Console.WriteLine("CoreScanner API: Open Successful");
            }
            else
            {
                Console.WriteLine("CoreScanner API: Open Failed");
            }
            // Lets list down all the scanners connected to the host
            short numberOfScanners; // Number of scanners expect to be used
            int[] connectedScannerIDList = new int[255];
            // List of scanner IDs to be returned
            string outXML; //Scanner details output
            cCoreScannerClass.GetScanners(out numberOfScanners, connectedScannerIDList, out outXML, out status);
            Console.WriteLine(outXML);

            //// Let's beep the beeper
            //int opcode = 6000; // Method for Beep the beeper
            //string outXMLBeep; // Output
            //string inXML = "<inArgs>" +
            //    "<scannerID>1</scannerID>" + // The scanner you need to beep
            //    "<cmdArgs>" +
            //    "<arg-int>3</arg-int>" + // 4 high short beep pattern
            //    "</cmdArgs>" +
            //    "</inArgs>";
            //cCoreScannerClass.ExecCommand(opcode, ref inXML, out outXMLBeep, out status);
            //Console.WriteLine(outXMLBeep);//null

            //// Let's set the UPC-A enable/disable
            //int opcode = 5004; // Method for Set the scanner attributes
            //string outXMLUPC; // XML Output
            //string inXML = "<inArgs>" +
            //    "<scannerID>1</scannerID>" +                // The scanner you need to get the information (above)
            //    "<cmdArgs>" +
            //    "<arg-xml>" +
            //    "<attrib_list>" +
            //        "<attribute>" +
            //        "<id>1</id>" +                // Attribute number for UPC-A from the Attribute Data Dictionary (above)
            //        "<datatype>F</datatype>" +
            //        "<value>False</value>" +
            //        "</attribute>" +
            //    "</attrib_list>" +
            //    "</arg-xml>" +
            //    "</cmdArgs>" +
            //    "</inArgs>";//This method does not show any output but it sets the UPC-A to enable (True) or disable (False).
            //cCoreScannerClass.ExecCommand(opcode, ref inXML, out outXMLUPC, out status);
            //Console.WriteLine(outXMLUPC);

            // Let's set the user data reading attributes
            int opcode = 5004; // Method for Set the scanner attributes
            string outXMLUserData0; // XML Output
            string inXML = "<inArgs>" +
                "<scannerID>1</scannerID>" +                // The scanner you need to get the information (above)
                "<cmdArgs>" +
                "<arg-xml>" +
                "<attrib_list>" +
                    "<attribute>" +
                        "<id>35002</id>" +
                        "<datatype>A</datatype>" +//<!-- get it using <attrib_list>35001</attrib_list> -->0080B0403C0000000C015F85
                        "<value>000e08800080B0403C0000000C015F85</value>" +//0x00 0x0e 0x08 0x80 0x00 0x80 0xb0 0x40 0x3c 0x00 0x00 0x00 0x0c 0x01 0x5f 0x85 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00            000e08800080B0403C0000000C015F85000000000000000000000000000000000000
                    "</attribute>" +
                    "<attribute>" +//"<!-- bank -->" +
                        "<id>35003</id>" +
                        "<datatype>B</datatype>" +
                        "<value>3</value>" +
                    "</attribute>" +
                    "<attribute>" +//"<!-- offset -->" +
                        "<id>35005</id>" +
                        "<datatype>W</datatype>" +
                        "<value>1</value>" +
                    "</attribute>" +
                    "<attribute>" +//                    "<!-- length -->" +
                        "<id>35006</id>" +
                        "<datatype>W</datatype>" +
                        "<value>0</value>" +
                    "</attribute>" +
                    "<attribute>" +//                    "<!-- command -->" +
                        "<id>35008</id>" +
                        "<datatype>B</datatype>" +
                        "<value>1</value>" +
                  "</attribute>" +
                "</attrib_list>" +
                "</arg-xml>" +
                "</cmdArgs>" +
                "</inArgs>";
            cCoreScannerClass.ExecCommand(opcode, ref inXML, out outXMLUserData0, out status);
            Console.WriteLine(status);

            // Let's retrieve assert tracking information
            int opcode1 = 5001; // Method for Get the scanner attributes
            string outXMLRetrieve; // XML Output
            string inXML1 = "<inArgs>" +
                "<scannerID>1</scannerID>" + // The scanner you need to get the information
                "<cmdArgs>" +
                "<arg-xml>" +
                "<attrib_list>35009,35004</attrib_list>" + // attribute numbers you need
                "</arg-xml>" +
                "</cmdArgs>" +
                "</inArgs>";
            cCoreScannerClass.ExecCommand(opcode1, ref inXML1, out outXMLRetrieve, out status);
            Console.WriteLine(status + "\r\n" + outXMLRetrieve);

            if (System.Diagnostics.Debugger.IsAttached)
                Console.ReadLine();
        }
    }
}

1 Answers1

0

Array type attribute should an issue as space separated hex buffer.

So 35002 should format as 0x00 0x0e 0x08 0x80 0x00 0x80 0xb0 0x40 0x3c 0x00 0x00 0x00 0x0c 0x01 0x5f 0x85 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00.

Can you please tell me what is the reason for setting attribute number 35008?

Bhushan Kawadkar
  • 28,279
  • 5
  • 35
  • 57
  • thank you for quick reply. 1. The "separated hex buffer" format is exactly one of the options I tried. 2. 35008 with value 1 means READ. The xml code is from page 5 of this document: http://goo.gl/crcnlG – user3573337 Jun 17 '14 at 19:20