Barcode Scanner/Reader with Intuiface (Workaround)

This is an example for my workaround (with third party software Autohotkey) to scan products with a barcode scanner.

Requirements

Autohotkey Configuration

Download and unzip Autohotkey


In the Autohotkey Folder create a new File called Barcodereader.ahk
In this file copy the following code:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.

SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

Loop 10
Hotkey, % “$~” A_Index-1, BarCodeHandler, on
BarCodeHandler:
Accu .= SubStr(A_ThisHotkey, 0)
If Strlen(Accu) > 4 && A_TimeSincePriorHotkey < 60
SetTimer, TheBigShebang, -60
If (A_TimeSincePriorHotkey > 100)
Accu := SubStr(A_ThisHotkey, 0)
return
TheBigShebang:
If Accu
req := ComObjCreate(“Msxml2.XMLHTTP”)
req.open(“GET”, “http://localhost:8000/intuiface/sendMessage?message=”+Accu, true)
req.send()
return

This code is copied & modified from the following two links:

https://www.autohotkey.com/boards/viewtopic.php?t=28720

Create a Shortcut to start Autohotkey with the script:
Right Click on Desktop/New/Shortcut
2019-06-24_15h11_22
Insert the link to AutoHotkeyU64.exe Scriptname.ahk
For example:
e:\Users\Anwender\Downloads\AutoHotkey_1.1.30.03\AutoHotkeyU64.exe Barcodescanner.ahk


2019-06-24_15h14_23

To autostart Autohotkey+script copy the shortcut from description above to Autostart:
Windows+R
Shell:startup
2019-06-24_15h09_15

Intuiface Experience



Autohotkey will call the URL http://localhost:8000/intuiface/sendMessage?message=BARCODE
How is the experience arranged?

  • A scene where you “attract” the customer
  • A scene with product view
  • Excel sheet with product catalogue
  • Local Network Trigger Interface Asset (with trigger, when message received in any scene, then clear all column filters, filter columns by barcode where barcode = message of the Local Network trigger, go to scene product view)

That the Local Network Trigger works, you have to open Intuiface Configuration Tool and enable Accept remote actions at Port 8000
2019-06-25_17h03_33

Adding the Local Network Trigger:






If the barcode is not registered in the excel, there is also a message showing.

Intuiface experience:
https://my.intuiface.com/share/72acba80-aae3-4af8-b501-12d0ea0e5b07

Working Example Barcodes:
123456789

987654321

This should work with every scanner in HID mode
Successfully tested with:

  • Datalogic Magellan 800i (in USB HID mode)
  • Opticon OPN-2006 (in USB HID mode)

Currently known bugs:

  • No reaction, if you scan barcodes with nearly no pause in between (maybe i can fix this, or somebody has improvment suggestions in the AutoHotKey code)

I hope I explained my workaround for this problem in an understandable way.
Questions/Inputs are welcome :wink:

6 Likes

Thanks for the great tip @sandro.kollreider! :+1:

1 Like

Nice workaround ! How many seconds do you have between the scanning and the finding ?

1 Like

Thanks @sandro.kollreider for this very detailed guide about barcode scanners and the usage of Local Network Triggers.

Could you maybe share with us the model of scanner you’ve been using here?

1 Like

@vincent1
From scanning to switched scene it takes 1-2 seconds

@Seb
This should work with every scanner in HID mode
I tested

  • Datalogic Magellan 800i (in USB HID mode)
  • Opticon OPN-2006 (in USB HID mode)

Added this information at the original post

The only bug i currently found is, that it doesn’t react, if you scan barcodes with nearly no pause in between (maybe i can fix this, or somebody has improvment suggestions in the AutoHotKey code)

@sandro.kollreider

I am trying to implement this and am getting an error from AHK saying "Error: Missing “)” before “:” . with a callout pointing to Line 17. Any advice on what’s missing here?

HI @it16 and welcome to Intuiface community!

I’ll let @sandro.kollreider answer your question about AHK, but I’m curious about your usage. Could you tell us more about the scanner your are using? It will be connected to a Windows device, right?

Seb

Just thought i would update everyone wanting to use a Barcode/QR code scanner,

In RS232 mode,

I used this thread: Communicating with RS232 with an IA

I have a scanner called: Datalogic GFS4400. This has HID mode and RS232 mode the scanner is irrelevant as long as it supports RS232, I used the RS232 project on the page provided i also used the local network triggers and bind the response to a GET HTTP request which enabled me to send the request on the local network.

If your device can not work with RS232 then you can use an adapter or emulate utility.

This should allow you to get this to work within Intuiface without no AHK script.

Kind Regards

3 Likes

The key thing to understand with these weird devices is how to configure them properly to send the right information through the right protocol.
Once you know which code you need to scan first to set your barcode scanner in the proper serial (RS232) mode, the link @Promultis mentioned is indeed the best solution to go with, in my opinion.

2 Likes