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 Linuxbased 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 whitin 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 (2)

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