Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9210783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:09:21+00:00 2026-06-18T01:09:21+00:00

i’ve got problems with the barcode scanner MT2070 from Motorola. I use the EMDK

  • 0

i’ve got problems with the barcode scanner MT2070 from Motorola. I use the EMDK 2.6 for .NET(Update 2) to create strings from the scanned barcode, then transmit them to the host pc. But the transmit failed.

The MT2070 run with Windows CE5.0 and is connected over bluetooth to the cradle STB2078. But everytime i get “send failed” and the ResultCode is “E_INCORRECT_MODE”.

The problem is that dont understand what they mean with “INCORRECT_MODE” i set it to DECODE and by RawData what is mean with source?

        ScannerServicesClient scannerServices;
        scannerServices = new ScannerServicesClient();
        SCANNERSVC_MODE mode;

        if(scannerServices.Connect(true))
        {
            Logger("start service with decode rights"); // primitiv method to see what happen

            scannerServices.GetMode(out mode);

            if (mode != SCANNERSVC_MODE.SVC_MODE_DECODE)
            {
                mode = SCANNERSVC_MODE.SVC_MODE_DECODE;
                if (scannerServices.SetMode(mode) != RESULTCODE.E_OK)
                {
                    Logger("cant set mode: " + mode.ToString());
                }
            }

            // wanna know which connection is use
            string connection = "";

            switch (scannerServices.HostParameters.CurrentConnection)
            {
                case SCANNERSVC_DATA_CONNECTION.NO_CONNECTION:
                    connection = "Not connected";
                    break;
                case SCANNERSVC_DATA_CONNECTION.BLUETOOTH:
                    connection = scannerServices.HostParameters.BluetoothConnection.ToString();
                    break;
                case SCANNERSVC_DATA_CONNECTION.RS232:
                    connection = scannerServices.HostParameters.RS232Connection.ToString();
                    break;
                case SCANNERSVC_DATA_CONNECTION.USB_CABLE:
                    connection = scannerServices.HostParameters.USBConnection.ToString();
                    break;
            }
            Logger(connection);

            ScannerHostParameters scnHost = new ScannerHostParameters(scannerServices);



            //example hello
            string input = "hello";                     //what should send
            byte[] output = new byte[input.Length];     //field with converted data
            byte source = 0;    //<-- what mean source? i sum all byte-value but this cant be correct

            for (int i = 0; i < input.Length; ++i)
            {
                output[i] = Convert.ToByte(input[i]);
                source += output[i];
            }

            RawData rawData = new RawData(output, input.Length, source);
            //RawParameters rawParam = new RawParameters();

            //rawParam.BaudRate = RawParameters.RawBaudRates.RAWSERIAL_9600;
            //rawParam.Type = RawParameters.RawHostType.Auto;

            RESULTCODE result = scannerServices.SendRawData(rawData, 2000);

            if(result == RESULTCODE.E_OK)
            {
                Logger("successful send");
            }
            else
            {
                Logger("Send failed: " + result.ToString());
            }
            Logger("ScannerService kill");
            scannerServices.Disconnect();
        }
        Logger("\n");
        scannerServices.Dispose();

        scannerServices = null;

Thanks for your help! (and sorry for my english)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:09:22+00:00Added an answer on June 18, 2026 at 1:09 am

    At some point (somewhere where you’re setting the mode – I do it right after setting the mode) you’ll want to do this:

    //set raw mode
    if (RESULTCODE.E_OK != scannerServices.SetAttributeByte((ushort)ATTRIBUTE_NUMBER.ATT_MIA_HOSTNUM, (byte)ENUM_HOSTS.HOST_RAW))
    {
        throw new Exception("Can't set RAW mode");
        scannerServices.Disconnect();
        scannerServices.Dispose();
        return;
    }
    

    Where you have:

    RawData rawData = new RawData(output, input.Length, source);
    

    you can leave source as 0:

    RawData rawData = new RawData(output, input.Length, 0);
    

    Unfortunately I’m not the greatest when it comes to programming so I’ve only managed to stumble my way through getting my scanner to work. The documentation isn’t great, in fact I find it severly lacking. Even the people at Motorola don’t seem to know much about it or how to program it. I’ve been given misinformation by them on on at least one point.

    I use the CDC COM Port Emulation mode for the scanner so that it shows up under Ports in Device Manager (I need the scanner to work with an old program we have which uses COM ports). A driver is also needed for this.

    Depending on how you’re using the scanner, the above may or may not work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am confused How to use looping for Json response Array in another Array.
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
i got an object with contents of html markup in it, for example: string
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.