# Capturing input from a barcode scanner

**URL:** <https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640>\
**Category:** Ignition\
**Created:** [September 12, 2018, 5:54pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640 "2018-09-12T17:54:09Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![danieltalbot](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/danieltalbot/32/11201_2.png) [@danieltalbot](https://forum.inductiveautomation.com/u/danieltalbot)\
**Post date:** [September 12, 2018, 5:54pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640/1 "2018-09-12T17:54:09Z")

</div>

I am trying to set up an asset tracking system for computers in my organization. I have a usb barcode scanner and would like a text area to capture the input from the scanner so that it filters the power table below it. I just don’t know how to configure the text area to capture the scanner’s input. Can anyone help me with this?

Thank you,

Daniel

---

<div class="post-metadata">

**Author:** ![mrogers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrogers/32/4110_2.png) [@mrogers](https://forum.inductiveautomation.com/u/mrogers)\
**Post date:** [September 12, 2018, 6:01pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640/2 "2018-09-12T18:01:24Z")

</div>

It is my understanding that most barcode scanners can act like a keyboard and just type out the data - wouldn’t this do what you want if the focus was on the text area?

---

<div class="post-metadata">

**Author:** ![danieltalbot](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/danieltalbot/32/11201_2.png) [@danieltalbot](https://forum.inductiveautomation.com/u/danieltalbot)\
**Post date:** [September 12, 2018, 6:06pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640/3 "2018-09-12T18:06:00Z")

</div>

That’s what I thought too, but it doesn’t populate the text area when I scan the barcodes I’ve made. Maybe there’s something wrong with the barcode itself? I’m using a CODE\_128 barcode format, and it’s bound to a mac\_address datakey, so that it should decode to the computer’s mac address.

---

<div class="post-metadata">

**Author:** ![mrogers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrogers/32/4110_2.png) [@mrogers](https://forum.inductiveautomation.com/u/mrogers)\
**Post date:** [September 12, 2018, 6:07pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640/4 "2018-09-12T18:07:10Z")

</div>

Does it work when in something like just Notepad? If not, it sounds like theres an issue with the configuration there. Otherwise, it should input into the text area just fine.

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [September 12, 2018, 6:46pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640/5 "2018-09-12T18:46:41Z")

</div>

Also make sure the text area has focus when you’re scanning.

---

<div class="post-metadata">

**Author:** ![danieltalbot](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/danieltalbot/32/11201_2.png) [@danieltalbot](https://forum.inductiveautomation.com/u/danieltalbot)\
**Post date:** [September 12, 2018, 7:56pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640/6 "2018-09-12T19:56:25Z")

</div>

I’ve narrowed it down to the barcode itself. For some reason the barcode doesn’t get picked up by the scanner. I’m not sure what I need to do to remedy this. The barcode is made in a report, with the datakey bound to a parameter, then that parameter gets set through a binding in another window. The barcode appears to change according to the what data is selected. Any suggestions? It’s like the barcode isn’t actually encoding the data.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 12, 2018, 8:20pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640/7 "2018-09-12T20:20:01Z")

</div>

Can you use another scanner to verify the generated barcode is valid (ie an application on your phone)? If it appears to scan (ie, the scanner beeps) then it’s odd that you wouldn’t get any output. Depending on the make/model, there may be a configuration/debugging tool you can hook up to it (something like [123scan](https://www.zebra.com/us/en/products/software/scanning-systems/123scan.html) if it’s Motorola/Zebra)

---

<div class="post-metadata">

**Author:** ![danieltalbot](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/danieltalbot/32/11201_2.png) [@danieltalbot](https://forum.inductiveautomation.com/u/danieltalbot)\
**Post date:** [September 12, 2018, 8:26pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640/8 "2018-09-12T20:26:22Z")

</div>

I’m able to scan a totally different barcode into Notepad using this scanner. It’s just the barcodes I’m generating that have the problem. Both barcodes use the same format (CODE\_39) and are encoding the same data type (VARCHAR(45)).

A phone scanner can’t decode the barcodes I’m generating either.

Does the number of characters being encoded matter? The barcode I can scan is 9 characters and the barcode I’m generating (and can’t scan) is 17 characters… although I’ve tried it with a 4-character datakey and that didn’t work either.

I’m just wondering if there’s something special I have to do when generating the barcode?

---

<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:** [September 12, 2018, 8:30pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640/9 "2018-09-12T20:30:59Z")

</div>

Whitespace matters. Make sure there’s enough on either side of the printed barcode.

---

<div class="post-metadata">

**Author:** ![danieltalbot](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/danieltalbot/32/11201_2.png) [@danieltalbot](https://forum.inductiveautomation.com/u/danieltalbot)\
**Post date:** [September 12, 2018, 9:11pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640/10 "2018-09-12T21:11:57Z")

</div>

Thanks! This helped me figure it out. I just didn’t have enough space for the entire barcode on the labels.

---

<div class="post-metadata">

**Author:** ![ematschke](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ematschke/32/7544_2.png) [@ematschke](https://forum.inductiveautomation.com/u/ematschke)\
**Post date:** [October 9, 2019, 5:55pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640/11 "2019-10-09T17:55:41Z")

</div>

Related to this topic, I need to scan an employee badge to log in to the Ignition security system. Since the login is normally two fields, how would I go about reading the employee badge (I don’t yet know the format of what the input will be) and completing the login? Anybody have any ideas? Thanks.

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [October 9, 2019, 7:52pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640/12 "2019-10-09T19:52:19Z")

</div>

If performing this action in vision, you may need to create a separate project to capture the badge ID then forward to the project after logging in as the appropriate user.

In Perspective, They have implemented a badge system, which I am thinking could potentially be used with barcode scanning instead of RFID badges, but someone else might be able to clarify a bit more on that.

---

<div class="post-metadata">

**Author:** ![ematschke](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ematschke/32/7544_2.png) [@ematschke](https://forum.inductiveautomation.com/u/ematschke)\
**Post date:** [October 9, 2019, 11:28pm UTC](https://forum.inductiveautomation.com/t/capturing-input-from-a-barcode-scanner/19640/13 "2019-10-09T23:28:15Z")

</div>

After thinking about this, it seems like I could use a Text input field, select it, and scan the badge.  
Then with property change script, derive the user name and password from the scanned in badge data, then use that to log the operator in with system.security.switchuser()
