Accessing the Line Scanner in IBM Anyplace Kiosk

29.12.2006 at 16:06

The last week I was busy searching a way to access the integrated Line Scanner as found in the IBM Anyplace Kiosks. The biggest hurdle was actually to get the damn thing to work, after reading through various documentation (JavaPOS, OPOS, UnifiedPOS), installing different devices drivers, I finally succeeded with a OPOS based Windows solution. I still try to convince management to deploy a Linux based solution, but do not yet know if there are the needed device drivers available. IBM seems to support it with IRES, we will see.

So the next step was to actually program the scanner in order to receive data. Since our "application" runs within a browser I had to use ActiveX and JScript to access the scanner. During coding this I learned that in order to capture ActiveX Events one has to use a slightly different event handling technique. I eventually got it to work with the code below.

<object classid="clsid:CCB90182-B81E-11D2-AB74-0040054C3719" id="Scanner" width="39" 

<script type="text/jscript" language="JScript">

onload = function(){
	MyScanner = function(){

		var scanner = Scanner;
		var dc = ec = function(){};

		/* see the following msdn-link for further 
		 * information on why this strange syntax actually works.

		function Scanner::DataEvent(){
			scanner.DataEventEnabled = true;

		function Scanner::ErrorEvent(ResultCode, ResultCodeExtended, 

ErrorLocus, ErrorResponse){
			ec(ResultCode, ResultCodeExtended, ErrorLocus, 


		var open = function(devname){
				return false;
			return true;

		var enable = function(devname){
				return false;
				return false;
			scanner.DeviceEnabled = true;
			scanner.DataEventEnabled = true;
			scanner.DecodeData = true;
			return true;

		return {
			init : function(devname,datacb,errorcb){
					return false;
				if(typeof datacb == "function")
					dc = datacb;
				if(typeof errorcb == "function")
					ec = datacb;
				return true;
			close : function(){
				return !scanner.Close();


	var status = MyScanner.init("LineScanner",function(v){ 
			alert("scanner " + v) 

		alert("could init");

onunload = function(){


An important point I would like to note is that only one application can access the scanner at the same time. Which means we must always call close to release the internal handle.

Hope this is useful for somebody.


Comments (3)

Scanner under Linux

18.06.2007 by Dave

Did you ever get the scanner working under linux? This link helped me to get the touch screen working:

Drivers for MSR

09.10.2011 by Melissa True (meltrue7[at]gmail[dot]com)

I am hitting a brick wall and want to know what your OPOS Solution was. That is my problem. Please let me know what you did to actually get the darned thing working. Thanks, True

MCX Tips | MCX Market Tips

05.06.2018 by Ways2Capital-Review (bhoomidesai74[at]gmail[dot]com)

This is the marvelous post that I have come over after huge searches. I am really thankful to you for providing this unique information..<a href="">mcx tips</a>