Mobile Barcode Scanner Not Updating Memory Tag

I’m attempting to follow the Barcode Scanned example in the Ignition 8.1 documentation (Perspective Session Event Scripts - Ignition User Manual 8.1 - Ignition Documentation). When I scan the barcode from the mobile app (iOS), it scans, but the table doesn’t change.

I have my memory tag in the root of my tag browser, and I also put in a vibration call as well as some logging to keep track. Based off that, I can confirm that It is getting the barcode scan data and it’s getting the text from the barcode, but it doesn’t seem to be updating the memory tag.

A few other things I’ve tried:

  • writeBlocking instead of writeAsync
  • Pulled the inputs to writeAsync outside of the array brackets
  • Binding the memory tag to a label and a text input field

Here is my code:

logger = system.util.getLogger(Barcode Logger)|

system.perspective.vibrateDevice()|
logger.info(data.text)|
system.tag.writeBlocking([[Tags]Barcode_Tag], [data.text])

Replace this:

system.tag.writeBlocking([[Tags]Barcode_Tag], [data.text])

with:

system.tag.writeBlocking(["[Tags]Barcode_Tag"], [data.text])

I tried adding the quote marks, and it still isn’t updating the tag or the bound field.

You’ll have to show more of your scripting and your tag provider layout.

Tag Provider Layout:
java_RbfixCj9wE

Binding to text field (the idea is to have the option to scan the serial number or type it manually):

Session Events Script:

Button onClick Event:

Hmm. Not obvious to me.

If you make a copy of Barcode_Tag, and use that path in the script, does that tag write?

I made a copy of Barcode_Tag and it created “Barcode_Tag 1”. I copied the path (i.e. right-click the tag, Copy Path) and pasted the new path in the session event script. No dice.

Alright, a new development. I created a blank project to test it out and the barcode example worked flawlessly. I noticed that when it worked, I was using a different Tag Provider. I tried using the original tag provider and it stopped working! I went back to my original project and tried using the incorrect tag provider and it started working!

I checked both projects’ properties to look for any differences and couldn’t see any. I decided to look at the settings for the tag providers and I found that the original tag provider was set to Read Only. I turned that off, and not surprisingly, the barcode scanner started working.

I’m kind of surprised nothing came up in the logs about trying to write to a Read Only tag provider. Is this something that can be added in future versions?

You would have been able to see that status in the return value from system.tag.writeBlocking or in the callback from system.tag.writeAsync.

Ahh, ok. I didn’t know they had return values. Thanks!