Barcoding with Ignition. Help please

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.

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

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

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

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/

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.

1 Like

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.