how to add system.barcode.reader to web.config

dear all

 

i have a MK500 device which will read barcode and display the price from SQL database using .NET windows CE mobile application

 

now one of the client need web based instead of native application.

 

i made a .aspx web site for reading barcode entered on the text box and display price. - this is also working fine from browser of MK500.

now i need to open the reader/scanner on  the device while the .aspx opens and read the barcode to aspx page from the reader/scanner

 

i copied the dll files (symbol.dll, symbol.barcode.dll,symbol.standardforms.dll) to web site bin folder.

 

now i am getting below error while running the default.aspx page (both from device and desktop)

 

Could not load file or assembly 'Microsoft.WindowsCE.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes' or one of its dependencies. The system cannot find the file specified.


please advice

Faisal

Anonymous (not verified)
Those dlls are CE code, they

Those dlls are CE code, they will not run on your web server. 

The MK500 comes preloaded and prelicensed with our PocketBrowser, which gives you the ability to access the scanner using meta tags and/or JavaScript from your web app (you do not need or want those dlls).

Take a look on the support site and download the relevant version of PocketBrowser to your PC so you will have the help file so you can see how to use it. I think it was a 2.X version on the MK5, but it's been a while.

https://portal.motorolasolutions.com/Support/US-EN/Search?searchType=simple&searchTerm=pocketbrowser

I will paste in below some code I have used to show how this can work on an MK500.  If you point pocketbrowser to this page on your webserver, you should see the scanner working.

<HTML>

<HEAD>

<META HTTP-Equiv="all_decoders" Content="disabled">

<META HTTP-Equiv="upce0" Content="enabled">

<META HTTP-Equiv="upca" Content="enabled">

<META HTTP-Equiv="upce0-ConvertToupca" Content="true">

<META HTTP-Equiv="ean8" Content="enabled">

<META HTTP-Equiv="ean13" Content="enabled">

<META HTTP-Equiv="ean8-ConvertToEAN13" Content="true">

<Meta http-equiv="scanner" content="AIM_TYPE_PRESENTATION">

<Meta http-equiv="scannernavigate" content="Javascript:doScan('%s');">

<Meta http-equiv="scanner" content="enabled">

</HEAD>

<BODY onLoad="doSoftScan();">

  <SCRIPT LANGAUGE="JavaScript">

    var Generic = new ActiveXObject("SymbolBrowser.Generic");

    function doSoftScan()

    {

     Generic.InvokeMetaFunction('scanner', 'start');

    }

    function doScan(data)

    {

     bcode.innerHTML = data;

     doSoftScan();

   }

  </SCRIPT>

  <div id="bcode"></div>

</BODY>

</HTML>

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Faisal Kummangottu
Dear Dan Yes pocket browser

Dear Dan

Yes pocket browser is there in mk500 device, I can see it.

My question is , do we need to install pocketbrowser on the PC(web server) also ? or just use the javascript code you sent on to my default.aspx, so that scanner light will become red.

Please advice

Faisal

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
You don't need to install

You don't need to install anything special on your webserver.  The sample page I provided should be enough to get the scanner working for you. 

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Faisal Kummangottu
Dear Sir I added the code

Dear Sir

I added the code same as you given,

It loads the page, and calling the function dosoftscan() as well, but the scanner light is not active.

The code is below

Kindly check
































function fn1() {



if (event.keyCode == 13) {


document.Form1.btnSubmit.click(); return false;


}


}


function fn2() {



document.Form1.btnSubmit.click(); return false;


}



var Generic = new ActiveXObject("SymbolBrowser.Generic");




function doSoftScan() {


alert('dfdfd');


Generic.InvokeMetaFunction('scanner', 'start');


}




function doScan(data) {


bcode.innerHTML = data;


doSoftScan();


}



















































6291056180004AL AIN APPLE JUICE 1.8LTالعين عصير التفاح 1.8لتر8.2525 Mar 2014

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
The meta tags at the top of

The meta tags at the top of the page are important.  These would enable the scanner, which must happen before you call doSoftScan().  You could also do this via JavaScript, but the scanner must be enabled, and it also must be in presentation mode.  The last 3 meta tags shown would be the minimum needed.

Take a look in \application\SymbolPB on the device.  I think you will find a demo page in there (spb21.html) that should work if you point pocketbrowser to it (that would be where it was pointed out of the box).  If that works, grab that file and use it as a template.

If you have those and it is still not working, I think the name of the generic object changed between versions of PocketBrowser.  I think it was in version 3 we changed it from SymbolBrowser to PocketBrowser, so maybe try this both ways, but unless you have updated PocketBrowser on the unit, I think it would have V2 on it.

var Generic = new ActiveXObject("SymbolBrowser.Generic");

or if you are running V3

var Generic = new ActiveXObject("PocketBrowser.Generic");

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Faisal Kummangottu
Dear sir I even copied the

Dear sir

I even copied the SPB21.html to my web site and tried to browse the page from MK3000 device.

It responds to the start, stop buttons (I appened alert(“blah”) within those javascript functions and it works)

I also goes to the APPLICATION\SYMBOLPB FOLDER AND OPEN THE PAGE SPB21.html, still scanner is not enables.

I tried changing the code Symbolbrowser to pocketbrowser but still same.

But when I open pocketbrowser 3.0 application, I am getting a similar screen like spb21.html , and when pocketbrowser opened, the scanner light is getting enabled

Below is the code source for sbp21.html


























var IsImager = true;

var scanTimer = null; // Scan timer

var KEY_SOFT1 = 0x28;

var KEY_SOFT2 = 0x0D;

var KEY_SOFT3 = 0x26;

var genObj = new ActiveXObject("SymbolBrowser.Generic");

function SetIsImager()

{

var HKEY_LOCAL_MACHINE = 2;

var strData = "";

strData = genObj.GetRegistrySetting(HKEY_LOCAL_MACHINE, "Drivers
BuiltIn
BarCodeReader", "FriendlyName");

if ( strData.indexOf("1D") != -1 )

IsImager = false;

else

IsImager = true;

}

function doLoad()

{

genObj.InvokeMETAFunction('scanner', 'AIM_TYPE_TRIGGER');

// genObj.InvokeMETAFunction('battery', 'show');

// genObj.InvokeMETAFunction('signal', 'show');

stopScanner();

}

function doQuit()

{

genObj.InvokeMETAFunction('application', 'quit');

}

function flashSoftKey(keyEl)

{

keyEl.style.backgroundColor = 'white';

keyEl.style.color = '#438EB9';

setTimeout(function(){keyEl.style.backgroundColor = '#438EB9';}, 250);

}

function startScanner()

{

skey1.style.color = '#1E78AD';

skey1.style.borderColor = '#438EB9';

skey2.style.color = 'white';

skey2.style.borderColor = 'white';

genObj.InvokeMETAFunction('scanner', 'start');

}

function stopScanner()

{

if ( scanTimer != null ) // Kill the scan timer if it's running

{

clearTimeout(scanTimer);

scanTimer = null;

}

skey2.style.color = '#1E78AD';

skey2.style.borderColor = '#438EB9';

skey1.style.color = 'white';

skey1.style.borderColor = 'white';

genObj.InvokeMETAFunction('scanner', 'stop');

}

function doKeys(key)

{

if(key == KEY_SOFT1)

{

if(document.getElementById('skey1').style.color == 'white')

{

flashSoftKey(document.getElementById('skey1'));

startScanner();

}

}

else if(key == KEY_SOFT2)

{

if(document.getElementById('skey2').style.color == 'white')

{

flashSoftKey(document.getElementById('skey2'));

stopScanner();

}

}

else if(key == KEY_SOFT3)

{

flashSoftKey(document.getElementById('skey3'));

doQuit();

}

}

function doScan(code)

{

divStatus.innerHTML = 'Scanned Code:
  ' + code;

setTimeout("startScanner()", 1250);

}



function doSignal(SignalStrength, ESSID, MacAddress, AdapterName, DHCPServer, DHCPStatic, Gateway, IPAddress, RSSI, SubnetMask, Wins )

{

if(IPAddress == 'undefined')

divSignal.innerHTML = 'WLAN Details:
Not connected or configured.';

else

divSignal.innerHTML = 'WLAN Details:
  Signal = ' + SignalStrength + '  ESSID = ' + ESSID
+ '
  IP Address = ' + IPAddress
+ '
  MAC = ' + MacAddress;



}





body

.maindiv

.product

.moto

#skey1

#skey2

#skey3

#divStatus

#divSignal

.title















MK3000 Sample

Powered by PocketBrowser



Scanner Test:
  Tap start to enable the scanner...



WLAN Details:
  Please wait...



START



STOP



QUIT











For your advice

Faisal

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Is your MK500 a laser unit? 

Is your MK500 a laser unit?  If you look in the scanner, does it look like a camera with some LEDs, or is there a mirror in there?  If there's a mirror, it's a laser unit, and that would explain why my code didn't work. I would expect the sample code to work though.  I think on the laser units you have to keep re-enabling the scanner and you do not want it to use presentation mode.  Try the attached file, this one seems to have the re-enable code in it, but I don't have a laser unit here to try it.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Faisal Kummangottu
Dear sir My model is MK3000

Dear sir

My model is MK3000 (8”) display. Also I attached the picture of the scanner. I think it is with LED and camera (not mirror)

I tried the code you forwarded sir., the page is opening on device browser, but the scanner is not getting enabled

With regards

Faisal

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Sorry, I thought you were

Sorry, I thought you were trying to use an MK500.  If I'm understanding you correctly, when you start Pocketbrowser using the default page on the device, the scanner does work.  If you try to use the browser on the device it does not work.  This is as I would expect.  To get the scanner functionality, you need to use PocketBrowser. You should be able to use PocketBrowser to show the test page on your web server by editing the start page in \Application\PocketBrowser\Config\config.xml.  The default is        <StartPage value="FILE://\Program Files\spb21.html" name="MK3000 Demo"/>.  You could change this to something like <StartPage value="http://MyWebServer/spb21.html" name="MK3000 Demo"/>.

Copy that file to your PC, edit the start page, copy it back to the device, then cold boot the device (power reset) and try again.  During your development, you will probably also want to set debug buttons on so you can exit PocketBrowser during your development efforts.

    <DebugButtonsEnabled value="1" />

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Faisal Kummangottu
Dear sir I done as advised,

Dear sir

I done as advised, but still same exists. Now after editing config file , the pocket browser is not opening.

I can browse the spb21.html from PC and device.

Below is the config file

Kindly advice

With regards

Faisal

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
I don't see the config file.

I don't see the config file. Please attach it rather than pasting it in.  A lot can change during cut/paste.  I'm guessing that you have an issue with your config file and it might be related to cut/paste issues.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Faisal Kummangottu
Dear sir Please see the

Dear sir

Please see the attached config.xml

Kindly advice

Faisal

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
It seems to be having a hard

It seems to be having a hard time with your commented out line with the old start page.  If I remove that line, it appears to work here.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments