# Barcoding with Ignition. Help please

**URL:** <https://forum.inductiveautomation.com/t/barcoding-with-ignition-help-please/5188>\
**Category:** Ignition\
**Created:** [September 25, 2012, 6:44pm UTC](https://forum.inductiveautomation.com/t/barcoding-with-ignition-help-please/5188 "2012-09-25T18:44:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![saltykarp](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@saltykarp](https://forum.inductiveautomation.com/u/saltykarp)\
**Post date:** [September 25, 2012, 6:44pm UTC](https://forum.inductiveautomation.com/t/barcoding-with-ignition-help-please/5188/1 "2012-09-25T18:44:43Z")

</div>

I just got a barcode scanner. I am able to have it scan my code and get its correct ASCII reading and put it in a text field on Ignition. I am new to Ignition, so this is the reason for my post.

With ignition, and probably scripting, is there a way to get the text in my field (from the scanner), and able to get the first symbol of its string. My goal is to designate empoyee badges and other sections with barcoding. For example: if the string started with a $ ($1234), that would designate an employee, whereas +1234 would designate something else.

Can anyone help?

Thanks.

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [September 25, 2012, 6:55pm UTC](https://forum.inductiveautomation.com/t/barcoding-with-ignition-help-please/5188/2 "2012-09-25T18:55:07Z")

</div>

As long as it is a string, you can use an index reference like so:

`x = "$string"
if x[0] = "$":
	# do stuff`

---

<div class="post-metadata">

**Author:** ![saltykarp](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@saltykarp](https://forum.inductiveautomation.com/u/saltykarp)\
**Post date:** [September 25, 2012, 8:26pm UTC](https://forum.inductiveautomation.com/t/barcoding-with-ignition-help-please/5188/3 "2012-09-25T20:26:19Z")

</div>

I guess my next question is can i refer a tag into my script.

For example if I have my string that is entered. That string is under the tag name StringName.

In my script, can I do:  
x = StringName[0]  
print x

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [September 25, 2012, 9:31pm UTC](https://forum.inductiveautomation.com/t/barcoding-with-ignition-help-please/5188/4 "2012-09-25T21:31:03Z")

</div>

You can use the system.tag.read() scripting function:

`x = system.tag.read("StringName").value
if x[0] == "$":
	# do stuff`

You can find all of our scripting functions in Appendix C of the user manual:

[inductiveautomation.com/support/ … /ignition/](http://inductiveautomation.com/support/usermanuals/ignition/)

---

<div class="post-metadata">

**Author:** ![thiruthnimonika](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@thiruthnimonika](https://forum.inductiveautomation.com/u/thiruthnimonika)\
**Post date:** [October 29, 2019, 1:41pm UTC](https://forum.inductiveautomation.com/t/barcoding-with-ignition-help-please/5188/5 "2019-10-29T13:41:51Z")

</div>

Hi i would like to know how do you connect barcode scanner to read the data input from scanner to ignition.

i am new to ignition please let mw noe.

thanks in advance.

---

<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:** [October 29, 2019, 2:02pm UTC](https://forum.inductiveautomation.com/t/barcoding-with-ignition-help-please/5188/6 "2019-10-29T14:02:33Z")

</div>

In the vision module, you have two options:

1. use a text entry component where the barcode scanner input simply emulates key strokes. The entry field must be in focus (selected) for it to populate from the scan.

2. Use the barcode scanner module from Sepasoft. You program your scanner with a prefix and suffix character. Then the scanner module will listen for those characters, when it detects them it will buffer the input in-between as a scan. then you can call this data from a dictionary in scripting to perform your logic. It does not matter what component is in focus with this method.
