# BarcodeScannerInput not reading scan with Zebra Handheld terminal

**URL:** <https://forum.inductiveautomation.com/t/barcodescannerinput-not-reading-scan-with-zebra-handheld-terminal/94071>\
**Category:** Ignition\
**Tags:** vision, perspective\
**Created:** [August 1, 2024, 5:16pm UTC](https://forum.inductiveautomation.com/t/barcodescannerinput-not-reading-scan-with-zebra-handheld-terminal/94071 "2024-08-01T17:16:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cal](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@Cal](https://forum.inductiveautomation.com/u/Cal)\
**Post date:** [August 1, 2024, 5:16pm UTC](https://forum.inductiveautomation.com/t/barcodescannerinput-not-reading-scan-with-zebra-handheld-terminal/94071/1 "2024-08-01T17:16:45Z")

</div>

Currently I have a Perspective View that has a BarcodeScannerInput with a defined regex that is:  
`P(.*?):`

I can type in the designer, using the preview mode, the following string:  
`P12345:`

The BarcodeScannerInput data field will populate with:  
`0:12345`

When I use a _Zebra MC930P_ to scan a barcode into the perspective view (using Chrome) nothing is added to the data field. Though, the data will appear as it did above if I type it with the hard keyboard on the _Zebra MC930P_ in the same perspective view (using Chrome).

Also, when using a _Zebra MC930P_ to scan a barcode the barcode will populate a text field when focused on, but the BarcodeScannerInput with not recognize it so the data is not output to the BarcodeScannerInput data field.

Does anyone know what I may be missing or not doing correctly?

---

<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:** [August 1, 2024, 5:29pm UTC](https://forum.inductiveautomation.com/t/barcodescannerinput-not-reading-scan-with-zebra-handheld-terminal/94071/2 "2024-08-01T17:29:34Z")

</div>

It is not reliable to use the dot wildcard in such a regex. Probably shouldn't have the question mark there, either. Rewrite it to use proper character ranges that actually match your expected content.

---

<div class="post-metadata">

**Author:** ![Cal](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@Cal](https://forum.inductiveautomation.com/u/Cal)\
**Post date:** [August 1, 2024, 5:47pm UTC](https://forum.inductiveautomation.com/t/barcodescannerinput-not-reading-scan-with-zebra-handheld-terminal/94071/3 "2024-08-01T17:47:06Z")

</div>

I changed the regex to:  
`P([^:]+):`

Still not able to get BarcodeScannerInput to read the scan in the Perspective View (using Chrome)

---

<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:** [August 1, 2024, 6:42pm UTC](https://forum.inductiveautomation.com/t/barcodescannerinput-not-reading-scan-with-zebra-handheld-terminal/94071/4 "2024-08-01T18:42:21Z")

</div>

Hmm. Not obvious to me.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [August 1, 2024, 7:41pm UTC](https://forum.inductiveautomation.com/t/barcodescannerinput-not-reading-scan-with-zebra-handheld-terminal/94071/5 "2024-08-01T19:41:10Z")

</div>

What is your barcode format? Looks like it always starts with `P` and always ends with `:`. Is there any format rules in-between those two characters?

If you just want what is between `P` and `:`, don't use regex, instead use them for your prefix and suffix as framing.

---

<div class="post-metadata">

**Author:** ![simeonw](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@simeonw](https://forum.inductiveautomation.com/u/simeonw)\
**Post date:** [August 1, 2024, 11:42pm UTC](https://forum.inductiveautomation.com/t/barcodescannerinput-not-reading-scan-with-zebra-handheld-terminal/94071/6 "2024-08-01T23:42:32Z")

</div>

Given that you can see the scanned data appear in a text field, I assume the data is indeed coming across in the correct format; that is, you have configured the barcode scanner with the correct prefix and suffix values? In the past, I've usually found this to be the problem.

As @dkhayes117 suggested, using the prefix and suffix values is definitely the way to go. However, as a quick test, to confirm that the barcode scanner component is receiving data, try setting your regex to `(.+)` and bind the data to a label. Might give you some insights.

---

<div class="post-metadata">

**Author:** ![Cal](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@Cal](https://forum.inductiveautomation.com/u/Cal)\
**Post date:** [August 3, 2024, 5:37pm UTC](https://forum.inductiveautomation.com/t/barcodescannerinput-not-reading-scan-with-zebra-handheld-terminal/94071/7 "2024-08-03T17:37:30Z")

</div>

@simeonw and @dkhayes117 Thank you for the suggestions.

My current scanner settings are not able to be changed. I ended up using a **Text Field** to send the data over an **onChange Script** and clearing the text field after 2 seconds.

By setting `rejectUpdatesWhileFocused` to `false` on the Text field, I was able to achieve the results I was looking for.
