Barcode scanner bluetooth question

I hope someone can help me with the following question:

I can use a USB wired barcode scanner without any problem with Coda. We can program the scanner with either an enter or a tab key simulation to enter values in a table (we use enter to go directly go to the next row/line after a code is scanned). This works on the canvas and in tables.

We want to use a bluetooth barcode scanner and we have tested it for the correct settings (with a wired base-station). When we connect the barcode scanner with a laptop it works mostly as expected with spreadsheets and documents. With Coda it works OK to scan barcodes to the canvas, but it fails with tables (either with a barcode + tab or barcode + enter). The strange thing is, when you scan one or multiple barcodes, coda advances one row, but leaves the fields blank.
If you activate the field by hand (i.e. click on the field to show a cursor) it will accept the barcode just fine.
It seems like I am missing a prefix when transmitting a code to a ‘not-activated’ field. Does anyone have a suggestion as to how to fix this?

Thanks in advance for any tips.
Greetings, Joost

Hi Joost,

We not totally sure what’s going on here because it half depends on where we put focus on certain events and half depends on what the scanner is actually sending over as data. So we can try some troubleshooting experiments to see if we can get a better idea of what’s going on.

First, are you intending for only one scanned barcode to go into a cell or are you scanning multiple items and sending an array to the cell?

Second, can you try mouse clicking on a cell so that the cell is highlighted and then scan the barcodes and let us know if that works. And as a followup if so, does it then fail on the next scan when Coda automatically moves the cursor.

Third, can you try scanning the values you’re having trouble with into a text editor so we can see if there’s a difference in how the data is being sent over between the two?

Hello @BenLee ,

The answers to your questions:

  1. I put the focus on the first empty row with an objectlink(). When scanning with a USB attached scanner it fills the first cell (number column) of the first available field and upon accepting a value it advances to the next row (in the scanner you can choose between a barcode + tab or barcode + enter - we use the enter.
    When using the bluetooth scanner it does more or less the same thing, but the barcode is not accepted, just the enter. So scanning 6 barcodes makes us end up in the 7th available row. If I scan into a field that is already populated, it does not overwrite the existing value, but just advances a line when scanning a new barcode. When I do the same with a USB attached scanner, it will overwrite an existing value (and advance one line).
    Short answer: one scan value per field, not an array.
  2. No, that does not work either. Everything is exactly the same is in answer 1).
  3. I can scan with either scanner to a canvas and get identical results - the barcode arrives, it does a line feed and accepts the next code. In a row of scanned codes, alternating a couple of times between the scanners, you can’t see any difference - all the barcodes are identical, and so are the line feeds.

There is one more thing - for either scanner:
when the scanning session hits the last available row, it does not advance and create a new line. When I do an enter on the keyboard, it does. After I have done that, I can use my scanner again and from that point on, it will advance and create a new blank line after every scan. This is expected behavior, except for the one time required manual enter. This is a guarantee for mistakes, because the quantity of required scans is never know in advance and the scanner person is not looking at the computer all the time to check if the last row has been reached already. Here, both scanners act the same (other than that the bluetooth scanner does not enter a barcode).

It would be really helpful if we can solve these issues, including the last one (we knew about the scanner input not causing the creation of a new row, but we didn’t know the little ‘enter’ trick to get it to work as expected. So, know that we know, we would like for Coda to accept new lines automatically when using a scanner.

edit: it turns out that making new lines takes to long. Scanning 10 items in, say 3 seconds, works good if the rows already exist. But if new rows are made automatically, some barcodes are lost or incomplete when scanning a batch in quick succession. So for the near future I will make sure enough empty rows will be available.

For the record, we can use wireless barcode scanners with a USB base station. This is not ideal (they are more expensive for one thing and it requires the base station), but we can get by until this is solved. The last issue, about creating new lines, is actually more critical.

Thanks for your attention to this,
Greetings, Joost

Thank you for the detailed notes here.

Since the output in the text editor is the same, it would be helpful to know for each scanner if characters are sent individually (like typing on a keyboard) or pasted. If pasted, it would be helpful to know what the clipboard paste data looks like.

This tool might work with the scanner, not totally sure, but it might be worth a try. Clipboard Inspector

For the “Enter trick”, yes, when you’re at the last row of a table, the first Enter sort of submits the value you just typed and the second Enter adds a new row. The reason is that we need a keystroke to trigger any calculations and sort of “submit” the data, but we can’t be sure that you want a row added as well. So allowing for Enter at the last row to always add a new row means many people would need to regularly delete an unwanted row a the end of their list.

Your strategy for adding multiple rows to start with is a great workaround for this scenario and probably what you’ll need to use in this case.

I did not get the Clipboard Inspector to give me anything useful. I agree the question about entering like keyboard enter or pasting might make a difference, although I am not sure I understand why the result would be different - in particular because on a Coda canvas both scanners create identical results. I will contact the manufacturer and see what they have to say about this.

About the workaround: it works, but it’s error prone. We would really benefit from an action trigger in a row. Obviously, we have one through automations, but that’s way to slow to solve this kind of problems. By the time it fires many scans will be lost before the new rows exist. There is a great need for an action trigger that fires immediately upon meeting certain conditions in a row. I would be perfectly happy with a button that has a trigger condition, like “: new row”, “changed field”, or based on a condition (field x > y). Ideally it would work in it’s own thread, so we can continue to work while the button action is executed. In this case I would do the following: if(rows.filter(name.isblank()).count()=20,sequence(1,50).addrows(thistable),_noOP()).
It would take some testing, but by the time the last 10 rows are filled, the next 50 would be ready to go. This would only work if it triggers immediately. There are a couple of caveats, but I am sure I can find a solution).