# Barcode Scanner Input data n d Enter

**URL:** <https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 16, 2025, 6:07pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436 "2025-06-16T18:07:38Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [June 16, 2025, 6:07pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/1 "2025-06-16T18:07:38Z")

</div>

I am trying to use 2D Barcode scanner to scan the downtime reason on the floor. I have a tab container and in one of the tab, I have a embedded view that has the barcode BarcodeInput component.  
no matter what I scan I get below response on the screen

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/e/0e148e8e31dadbfb58987c2a0d63df2f7701d522.png)

I tried directly on the perspective page without the embedded component and still I see the same behavior.  
Any suggestions ?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [June 16, 2025, 7:17pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/2 "2025-06-16T19:17:40Z")

</div>

What regex/pattern matching(if any) is applied to the barcode input component? Show a screenshot of the component properties if you can.

What model of scanner are you using? What is the output of that scanner configured for? (Prefix, suffix, termination character?) What is the content of the barcode you are scanning supposed to be?

---

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [June 16, 2025, 8:47pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/3 "2025-06-16T20:47:09Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/0/30ac3e67c24aae00b1043752ad059005cd815043.png)  
There is no specific pattern, I was looking to scan numbers and alphanumeric values to store to a memory tag.  
This is the [datalogic scanner](https://download.delfi.com/SupportDL/Datalogic/Handheld%20scanners/GM4500/Manual/gryphon_I_gd-gm-gbt_4500_prg_eng.pdf) we have, I don't know how it was set up  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/0/10d33c5db2b811c63075af1c201a07f0a97eec87.jpeg)

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [June 16, 2025, 9:05pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/4 "2025-06-16T21:05:26Z")

</div>

Open notepad (or notepad++, if you have it) on the device connected to the scanner. Create a new text file or tab, and make sure your cursor is on an empty line and scan something using the scanner. It should write to the line in notepad, and you should be able to see the general output format of the scanner.

If that doesn't work, you'll need to connect to the scanner using their config software and see how it is configured, and use that to configure Ignition to look for the same things to properly parse the data.

---

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [June 16, 2025, 9:15pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/5 "2025-06-16T21:15:47Z")

</div>

@ryan.white, I created two barcodes using this site [Free Online Barcode Generator: Create Barcodes for Free!](https://barcode.tec-it.com/en/?data=Not%20Scheduled%20)

```python
1. number 100 
2. text "Not Scheduled"

```

I tried scanning in excel and in notepad and I got `100 & "Not Scheduled"` text.  
Just to confirm, I did scan many times and every single time I got the correct value through the scan.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [June 16, 2025, 9:24pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/6 "2025-06-16T21:24:56Z")

</div>

Looking through the documentation and based on the results you got, the scanner is running with no prefix and a carriage return as the suffix.

Trying setting the barcode scanner input component's suffix value to `\r`

---

<div class="post-metadata">

**Author:** ![VinceV](https://avatars.discourse-cdn.com/v4/letter/v/bb73d2/32.png) [@VinceV](https://forum.inductiveautomation.com/u/VinceV)\
**Post date:** [June 17, 2025, 12:43pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/7 "2025-06-17T12:43:17Z")

</div>

The regex pattern is applied to the buffer on _every_ keypress, which makes it rather finicky. When you scan a barcode `nd`, the scanner will send a keypress `n` then a keypress `d` and finally a keypress `Enter`.

You're lucky though, because your scanner also sends a literal `Enter` after the input, so you can look for that. A regex like this might work:

```python
^([A-Za-z0-9\-\/]+)(?:\n|\r\n|Enter)$

```

which should allow any alphanumeric characters, dashes, forward slashes and spaces. Add other characters as required.

---

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [June 17, 2025, 2:30pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/8 "2025-06-17T14:30:04Z")

</div>

> [@VinceV](#):
>
> `^([A-Za-z0-9\-\/]+)(?:\n|\r\n|Enter)$`

@VinceV you are the Man.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/a/5ae1a309161cecbeaa7bf2b18af8eba963dcbe04.png)

Thank you so much for your help

---

<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:** [June 17, 2025, 2:36pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/9 "2025-06-17T14:36:31Z")

</div>

Be aware that using a "catch all" regex for your barcode scanner component will basically break any other text input field you place on the page. If you want reliable barcode scanning while also allowing other input, you should configure your scanner to emit a non-typable prefix and suffix.

---

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [June 17, 2025, 2:49pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/10 "2025-06-17T14:49:40Z")

</div>

`^~([A-Za-z0-9\-\/]+)(?:\n|\r\n|)~$` something like this you mean ?  
or  
`^~([A-Za-z0-9\-\/]+)(?:\n|\r\n|Enter)~$`

---

<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:** [June 17, 2025, 3:05pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/11 "2025-06-17T15:05:36Z")

</div>

Prefix and suffix should be different, and would typically be control codes (hard to accidentally type).

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 17, 2025, 3:17pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/12 "2025-06-17T15:17:17Z")

</div>

Control codes are all in the first column.

 ![Standard-ASCII-Table_large](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/5/357e6472e4edeed0e9bffad9fb39274e1ee48de3.jpeg)  
_ASCII table. Image source: [commfront.com](https://www.commfront.com/pages/ascii-chart)._

STX and ETX look like good choices.

---

<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:** [June 17, 2025, 4:10pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/13 "2025-06-17T16:10:03Z")

</div>

> [@Transistor](#):
>
> STX and ETX look like good choices.

Extremely commonly chosen for this kind of thing.

---

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [June 18, 2025, 9:30pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/14 "2025-06-18T21:30:24Z")

</div>

`BarcodeScannerInput` is not working right at all.  
I tried adding a Input `TextField` in perspective and It is matching the scan. for example `8400` in the Text field shows as `8400` however the same scan in `BarcodeScannerInput` object for a brief moment is flashes as` 8400 vertically like`

```python
8
4
0
0

```

and only 0 stays. Same behavior after changing the captureMode and Regex = (.\*)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/2/92b0630db288a3a3805dd3db731c8ce77b46e28a.png)

The regex setting that @VinceV gave does not work after removing the Return carriage behavior by scanning the scancode given by the Datalogic support team to capture .

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/f/af9c97dcb48bb50b36bfae34ed84ef5fce59ae6e.png)

In both `Regex` setting it is capturing all the keys from the keyboard of the laptop as well.

Here is my setup

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/9/596a5c3785d435c165fe9531c5f67d060ab21c62.jpeg)

---

<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:** [June 18, 2025, 10:39pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-data-n-d-enter/107436/15 "2025-06-18T22:39:06Z")

</div>

Your behavior is as expected since you lack a distinct prefix and suffix. You **must** reconfigure your scanner.
