Scanning labels for data entry

I need to be able to scan labels with barcodes and fill in label values on a Perspective view. Label 1 shows the format of our labels and the data they contain. Label 2 gives a bit more detailed info; the final image is a simplified sketch of our Perspective view layout.

On Label type 1 I have three barcodes

Using an iPad, I can scan each barcode individually and get the raw values shown next to each barcode but can’t get the Best by Date as there is no barcode for that.

On Label type 2 (GS1-128) I have a single barcode

Using the iPad, I can scan the GS1-128 label and get the UPC, Best by Date and Batch number but I cannot scan the Material number as there is no barcode for that.

GS1-128 Label gives the raw data shown in image Label2

]C1010006548798744617250906100012300123

Part 1”]C1” is the GS1-128 code ID

Parts 2, 4 and 6 are CODE-128 App IDs

β€œ01” = GTIN-14 or our UPC code represented by 14 digits

β€œ17” = Expiration Date or Best by Date or Enjoy by Date shown as 6 digits YYMMDD

β€œ10” = Batch Number shown as 10 digits

Parts 3, 5 and 7 are the App IDs values.

β€œ00065487987446” is the UPC number

β€œ250906” is the Best by Date

β€œ0012300123” is the batch number

I can scan the GS1-128 label, send the raw data to a PLC. Concat the data there then send it back to three ignition object tags to fill UPC, Best by Date, and Batch fields. I cannot fill in the Mat number field. I can only have one barcode script for project session event.

Is there a way to get all the data from a single scan of either label? What am I missing? What would be the best way to continue?

NOTE: I use the PLC to concat the data because I am new to ignition. Any scripting advice is very welcome. We are just beginning to use Ignition and I don't have very much to reverse engineer. I have been reading the forums and manuals for a few days now and I am slowly learning.

Tags: iPad IOS Android Mobile Camera Tablet Multiple Barcode Scan GS1-128

Forgetting for a second about the how to transform the data bit, the UPC code is unique to the material is it not? So you can load the UPC numbers in a database and just look up the material number via the UPC number to get the correct material to display?

1 Like

That may be correct. I am not sure so I will look into in.

I have done a bunch of stuff with the GS1-128 barcodes, Ignition makes it really easy to do string manipulation. One particular tool you can use is python scripting like so:


barcode = "]C1010006548798744617250906100012300123"
codeID = barcode[0:2] #this will grab the characters from position 0 to position 2 and put them in codeID
upcCode = barcode[5:19] #same thing but for the UPC
bestBefore = barcode[21:27]
batchNo = barcode[29:40]

print codeID
print upcCode
print bestBefore
print batchNo

You can run this in the script console to play around with it. It can be inserted in a binding to grab the barcode and return only one of the values to feed one of your elements on screen.

Once you have these values, you can play with running queries on the database using them pretty easily.

1 Like

Thank you David, that is pretty much what I did in the plc. I can usually fix syntax issues and figure out the needed code, but knowing where it goes is issue. If I were to put this in the UPC binding as you say, it doesn't work or I get syntax errors.

Here is my Session Event for barcode script

Here is my view

Script Version Raw Binding, the other bindings are the same tag binding.

Up to this point, everything works except the values that show "null".
I tried adding your script to the session barcode event but it does nothing. I also tried adding them to the individual tag binding scripts but it gives syntax or character errors. I understand what your script does, I'm just not sure how to (or where) use it.

Respectfully,
Anthony

you can use an expression binding, something like substring | Ignition User Manual applied to barcode.value

1 Like

I am also trying that but i still get errors

get rid of the term before the equals sign -- expressions don't need assignment

Tried that as well right before you suggested it lol

ohhhh, i see the issue. change the sidebar from tag binding to expression binding

1 Like

Thank you. that worked perfectly.

Is there a way to be able to scan other tag types? Right now the session scan is only going to work for GS1-128. I am hoping to get the material number as well. Can I scan an image with the tablet camera and it get the Material number text and convert it to serial and the the GS1-128 barcode? The material number is the last part of this task. The labels at the top are the ones I have to work with.

hmmm, that one i'm not sure about. Maybe something with PyTesseract for OCR?

I will look into it, again, thank you.