Handheld Barcode Scanner & Data Entry with AHK’s Part 2- refinements

I now have an operating tool, and here is the input process:

It works, to an extent. Here is the setup:

It works , but it has a few issues.

Steps of scan process

  1. Scan Trigger code to start Script
  2. Scan Add Tab. Cursor ready for first input
  3. Scan Plant ID, it then tabs to next input
  4. Scan Plant Condition(1 of 6) it then tabs to next input
  5. Scan Height (1 of 8 at this point) So you actually have to measure. it then tabs to next position which is Button.
  6. Scan Carriage Return- this is for barcode reader
  7. Scan Something . This will then trigger carriage return for button
  8. Sound plays verifying that input has gone into file

Issues I need to address

I need it to play a sound when the script starts. You are looking at Card and plants, not at computer screen. So some way of confirming that the computer programme is ready.

Although there is beep/vibration from hand scanner, this does not necessarily mean that its been received by programme, so I need a confirmation beep from the PC. And so on for the next fields.

Here is the rub, when filling out the variables, they are only submitted on pressing the button at the end, that’s when the input data is pushed to the variables. I need a way to acknowledge the variable has been populated before the button is pushed. So I need some way of having the computer tell me that its received something after each input scan.

When you scan, the scanner vibrates, beeps and/or lights flash, so you know scanner has read the data, but how do you know its gone to the app? The sound from the computer is a good indicator that the programme is active.

The Scan Add Tab, this only goes to the scanner, and you need to rely on the scanner vibrating to aknowlege this. In fact, I might do this first before opening the app, so you can fully focus on App when it starts up. Because of modifications below, I may be able to eliminate this step.

The cursor is now in the first field, I would like a confirmation that something has been scanned in, I found the gLabel code (see video below)solves this, after the v(Variable) Tag , allows a subroutine to run, so it aknowleges that data has gone into the variable (Plant ID) so I make a different frequency sound (or maybe 2 short beeps( a different noticeable sound from startup sound). The gLabel also allows you to retrieve the variable straight away (not wait until you push the button at the end).

Then it bounces to 2nd input field, a repeat of the first process and so onto the 3rd input field.

As the information in the input fields have already been pushed into the variables, there is no reason to have a button. So it just goes through the rest of the script to put the information in the file. A further sound will aknowlege that the rest of the script has run.

Next, after the first item of data is scanned in, I need a different sound, this will tell me that the first variable (plant ID) has been scanned in.

The following video shows the gLabel:

So at the end of the enter box we have a goto label gSubmit1 that submits the information straight away and when it does that it makes a sound so that you know something has been entered.

This has simplified and improved the process in a number of ways:

  • The computer is aknowledging that the popup is ready for input by beeping after scanning programme trigger.
  • As soon as first item scanned (Plant ID) you get a different frequency beep, so you know computer has received scan for that bit of data
  • As soon as second item scanned (condition) you get a different frequency beep, so you know computer has received scan for that bit of data. If you scan and you get the same beep as before then you know that the ADD TAB is not working and the next piece of data has gone into the plantID variable, instead of condition variable. So this acts as a way of showing a fault in the setup
  • As soon as third item scanned (height) you get yet another different frequency beep, so you know computer has received scan for that bit of data.
  • Then script pushes info into the file, that process complete.
  • You then start over

So, potentially you only need to scan 4 barcodes now, one assumes that the Add TAB stays in the scanner.

  1. Scan Start Pogramme barcode
  2. Scan PlantID
  3. Scan Condition
  4. Scan Height
  5. ALL DONE- It writes to file

Setting up PC

I have my old surface 3 in kitchen now, I’ll need to upload the latest programme and have it so that it starts on startup, so its ready in background.

I’ll need to plug the Dongle into the Dock and have the dock powered up (I had a few “DUH!” moments where dock ports wouldn’t work with scanner as there was no power to dock).

I think I need to first turn on computer, and I’ll need a QR code for the pin for getting past lock screen. I need to turn off PC after. I also need to keep scanner charged too, which I’m doing via the dock.

As I have PC in kitchen it may be handy to have it display calendar or something to make it more useful.

Distance from Dongle & storing data

I did play with using the handheld scanner away from the dongle, and I got about 2.5m away from Surface book before it didn’t work. I need to do some more rigerous testing for this in the kitchen, and best location for PC.

I could store the data and just go and scan all the plants, then look at uploading them all at once, they would then all have exactly the same date/time, which would be fine. I should explore this and how to upload that data if I’ve stored it in scanner, how to I get it into file? This is definitely worth a little bit of investigation, especially if I go to the outside plants.

Or move the dongle to the PC tablet and have that nearby.

This is something that I was wondering about. By going down the AHK route, I cannot run that on my android device, so do I try and write a script {in Automate} theat I can use on my phone and pair scanner with Phone via bluetooth? Maybe that is another method to try.

End comment

I’m very pleased about being able to reduce the number of scans down to 4 from 7. I just need to practice using it so that I can fine tune it a bit more.

I’m interested in what to do in the case of a fault. Will I be able to do something about the popup now I’ve removed the button? Will I need to put the button back in as a shutdown tool, r just run refresh in the task tray for tha script?

After doing it, do I keep itas a .ahk file or to I make it an .exe file?

Once I gather enough info I can start looking at the next part of the exercise which is graphing & analysing the data and presenting in a dashboard?

I suppose with the Raspberry Pi bits I have I could look at a more live monitoring process? Maybe an idea for another time.

This has been an interesting project. I can now move onto looking at Freezer, and possibly kitchen inventory and doing that with an app.

How can this scanner capture process be adapted to Asset Management?

QR codes as inspection tool? Maybe a comparison with a webform with buttons? Will usually have to add notes/comments to report. Maybe good to download/find room/unit information quickly.