# How to connect a Handheld barcode scanner directly to a tag

**URL:** <https://forum.inductiveautomation.com/t/how-to-connect-a-handheld-barcode-scanner-directly-to-a-tag/99186>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [November 27, 2024, 3:54pm UTC](https://forum.inductiveautomation.com/t/how-to-connect-a-handheld-barcode-scanner-directly-to-a-tag/99186 "2024-11-27T15:54:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Jaffe](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@Alex\_Jaffe](https://forum.inductiveautomation.com/u/Alex_Jaffe)\
**Post date:** [November 27, 2024, 3:54pm UTC](https://forum.inductiveautomation.com/t/how-to-connect-a-handheld-barcode-scanner-directly-to-a-tag/99186/1 "2024-11-27T15:54:38Z")

</div>

I Have a DS3678 Zebra handheld Barcode Scanner.

Currently it works as a keyboard wedge, and I have a text Input field where operators can touch, scan a barcode and then hit a button to enter that barcode into a table.

I want to get it to where the operators don't have to do all of that. I want to get it to where the barcode scanner is tied directly to a tag, and I can write a transaction group to update the table based on the tag changing. Much more user friendly for the operators. Then the operator would only need to to use the text field to manually remove an entry.

The problem i am having is that i am unsure of how to go about tying a specific handheld scanner to a tag. We have 7 of these on site, 1 at each station. I want to get 7 tags set up to point to 7 specific handheld scanners.

If anyone know how to configure a handheld scanner to be tied to a specific tag that would be very helpful. Thank you!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 27, 2024, 4:08pm UTC](https://forum.inductiveautomation.com/t/how-to-connect-a-handheld-barcode-scanner-directly-to-a-tag/99186/2 "2024-11-27T16:08:55Z")

</div>

Generally, you would configure the scanner to communicate directly to the gateway, perhaps with an Ethernet-to-serial converter. Then use Ignition's TCP driver to receive the scans. (You will want to configure a delimiter in the scanner for that driver to catch.)

(This solution avoids Perspective, because Perspective can't really do this. A scanner connected to a Vision client's serial port can do this, as long as the client is running.)

---

<div class="post-metadata">

**Author:** ![Alex\_Jaffe](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@Alex\_Jaffe](https://forum.inductiveautomation.com/u/Alex_Jaffe)\
**Post date:** [November 27, 2024, 4:15pm UTC](https://forum.inductiveautomation.com/t/how-to-connect-a-handheld-barcode-scanner-directly-to-a-tag/99186/3 "2024-11-27T16:15:48Z")

</div>

Unfortunately our scanners are connected to the HIM directly through USB. And the project is done entirely in perspective.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 27, 2024, 4:21pm UTC](https://forum.inductiveautomation.com/t/how-to-connect-a-handheld-barcode-scanner-directly-to-a-tag/99186/4 "2024-11-27T16:21:50Z")

</div>

So, you were given poor advice when selecting Perspective vs Vision. 🤷‍♂️

Seems to me you have limited paths to follow:

- Connect scanners direct to gateway
- Convert HMI to Vision so you can run a background script in the client to monitor the scanner's USB serial option. (Most USB scanners on the market can be configured as keyboard wedges or as virtual serial ports.)
- Make sure you have a Perspective Barcode Scanner Input on every page, with a reliable start/stop delimiters, with a script to write to the correct tags. (Probably need to use Client IP address for that latter.)

---

<div class="post-metadata">

**Author:** ![Alex\_Jaffe](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@Alex\_Jaffe](https://forum.inductiveautomation.com/u/Alex_Jaffe)\
**Post date:** [November 27, 2024, 4:37pm UTC](https://forum.inductiveautomation.com/t/how-to-connect-a-handheld-barcode-scanner-directly-to-a-tag/99186/5 "2024-11-27T16:37:36Z")

</div>

is connecting scanners directly to the gateway a solution in itself or is it part of the 2 steps below it?

if it is a solution, are you able to point me towards directions for how to do that?

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [November 27, 2024, 4:39pm UTC](https://forum.inductiveautomation.com/t/how-to-connect-a-handheld-barcode-scanner-directly-to-a-tag/99186/6 "2024-11-27T16:39:35Z")

</div>

I've never used a barcode scanner before so pardon my ignorance but could you configure it to send you a string of characters right before it actually sends you the barcode numbers? So for example if you scan the barcode **012345** you get **regexTest\_012345** as a keystroke?  
Then, on your perspective Session Events you add a Keystroke regex match script to look for the Pattern **regexTest\_** , use it to send a message to your input field component so it to sets focus to itself.

> [@Alex\_Jaffe](#):
>
> hit a button to enter that barcode into a table

This could be done with a script that when the input field is filled with the correct ammount of the type of string you're expecting (Filter for lengh and numericals only maybe?) it does the exact same thing the button does now.  
Seems very convoluted, i know.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 27, 2024, 4:39pm UTC](https://forum.inductiveautomation.com/t/how-to-connect-a-handheld-barcode-scanner-directly-to-a-tag/99186/7 "2024-11-27T16:39:45Z")

</div>

Yes, you can connect the USB scanners directly to the gateway if they are close. You'll need to use Ignition's serial port scripting functions in that case--more trouble than the TCP/UDP driver.

Consider something like this (not a sponsor) for quick conversion of your existing scanners:

[https://www.keelog.com/morphstick-keyboard-host-2-ethernet-poe-converts-from-usb-keyboard-and-barcode-reader-to-network-and-internet-with-power-over-ethernet/](https://www.keelog.com/morphstick-keyboard-host-2-ethernet-poe-converts-from-usb-keyboard-and-barcode-reader-to-network-and-internet-with-power-over-ethernet/)

---

<div class="post-metadata">

**Author:** ![Alex\_Jaffe](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@Alex\_Jaffe](https://forum.inductiveautomation.com/u/Alex_Jaffe)\
**Post date:** [November 27, 2024, 4:43pm UTC](https://forum.inductiveautomation.com/t/how-to-connect-a-handheld-barcode-scanner-directly-to-a-tag/99186/8 "2024-11-27T16:43:53Z")

</div>

configuring it to send a set string before might work, ill take a look at that.

Unfortunately the barcodes being scanned do not have a set length, so i cant filter for that.

I wont be on site until next week but ill let you know if that works,

Thank you

---

<div class="post-metadata">

**Author:** ![Alex\_Jaffe](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@Alex\_Jaffe](https://forum.inductiveautomation.com/u/Alex_Jaffe)\
**Post date:** [November 27, 2024, 4:44pm UTC](https://forum.inductiveautomation.com/t/how-to-connect-a-handheld-barcode-scanner-directly-to-a-tag/99186/9 "2024-11-27T16:44:46Z")

</div>

Ill take a look at this, see what i can do, thank you, ill let you know if anything comes from it

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 27, 2024, 4:46pm UTC](https://forum.inductiveautomation.com/t/how-to-connect-a-handheld-barcode-scanner-directly-to-a-tag/99186/10 "2024-11-27T16:46:40Z")

</div>

To make the Perspective Barcode Scanner component reliable, you must specify start **and** end delimiters, and those must be distinct from the content. Setting your scanners to add ASCII control code prefix and suffix is most reliable.

For the TCP/UDP driver, you generally just need a reliable suffix delimiter.
