Howto Debug an odd problem – “Load Datalogic Scanner XML Settings Failure!”

I had an odd problem today with a USB barcode scanner and its OPOS driver. The scanner in question is a DataLogic 2200VS USB scanner and I’m using its OPOS Driver (USBScanner is the OPOS Device name) on a Windows Vista machine with UAC switched on.

When I lauched the application I was running it kept giving a error when it tried to open the device “Load Datalogic Scanner XML Settings Failure!” No amount of searching online was able to reveal the answer to this error and because its load via the OPOS control which is in my application via COM.Interop there is no easy way to step into the code and see why its going wrong.

After a little testing and debugging I discovered that it works if the application is “Run As Administrator” it’ll work fine so it had to be a permission problem just wasn’t sure which permissions were wrong.

If only there was a way to see which files and registry entries the driver was trying to access and which failed because of a access denied error… Thats where this cool tool called Process Monitor comes in. Lauching the app it’ll show you everything going on in your system, a few quick filters so that it only shows my apps calls then tried to use the scanner, it gave the error again but this time I could track down the cause.

It turned out that it was trying to write to the C:\Program Files\DLSOPOS\ folder and was failing and was trying to access these 2 parts of the registry and getting access denied errors.

HKEY_LOCAL_MACHINE\SOFTWARE\OLEforRetail\ServiceOPOS\Scanner\USBScanner and HKEY_LOCAL_MACHINE\SOFTWARE\DATALOGIC\DL_OPOS_Service

Changing the permissions on those registry keys and the folder fixed the problem.

Get a Samsung SCX 4200 Working On Ubuntu 9.04

I have a Samsung SCX-4200 Printer/Scanner it works rather nicely and I like it alot, even though I don’t use it often. Tonight I plugged it into my Ubunut machine and it printed first time, with no setups. Unfortunately the scanner didn’t work.

A few quick search’s revealed this forum entry on the Ubuntu Forums and from there I found this site with .deb packages for the Samsung Unified MFP drivers. After installing the packages the scanner suddenly work in XSane and I could scan. I’m really like the fact that more and more hardware “just works” now in Linux, or works with minimal tweaking. I haven’t had to compile a kernel or any other software in a very long time.

After getting the scanner to work I found 2 nice apps to use instead of XSane, the first is flegita a nice little app that makes it easy to scan things from the scanner to png, jpg, tif and PDF and the other app is gscan2pdf which allows you to scan to pdf.