# Mobile Barcode Scanner Not Updating Memory Tag

**URL:** <https://forum.inductiveautomation.com/t/mobile-barcode-scanner-not-updating-memory-tag/56128>\
**Category:** Ignition\
**Tags:** perspective, ignition81, scripting\
**Created:** [February 14, 2022, 8:26pm UTC](https://forum.inductiveautomation.com/t/mobile-barcode-scanner-not-updating-memory-tag/56128 "2022-02-14T20:26:47Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Kelly](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe_kelly/32/30990_2.png) [@Joe\_Kelly](https://forum.inductiveautomation.com/u/Joe_Kelly)\
**Post date:** [February 14, 2022, 8:26pm UTC](https://forum.inductiveautomation.com/t/mobile-barcode-scanner-not-updating-memory-tag/56128/1 "2022-02-14T20:26:47Z")

</div>

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](https://docs.inductiveautomation.com/display/DOC81/Perspective+Session+Event+Scripts)). 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:

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

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

```

---

<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:** [February 14, 2022, 10:05pm UTC](https://forum.inductiveautomation.com/t/mobile-barcode-scanner-not-updating-memory-tag/56128/2 "2022-02-14T22:05:12Z")

</div>

Replace this:

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

```

with:

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

```

---

<div class="post-metadata">

**Author:** ![Joe\_Kelly](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe_kelly/32/30990_2.png) [@Joe\_Kelly](https://forum.inductiveautomation.com/u/Joe_Kelly)\
**Post date:** [February 14, 2022, 10:07pm UTC](https://forum.inductiveautomation.com/t/mobile-barcode-scanner-not-updating-memory-tag/56128/3 "2022-02-14T22:07:23Z")

</div>

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

---

<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:** [February 14, 2022, 10:11pm UTC](https://forum.inductiveautomation.com/t/mobile-barcode-scanner-not-updating-memory-tag/56128/4 "2022-02-14T22:11:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Joe\_Kelly](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe_kelly/32/30990_2.png) [@Joe\_Kelly](https://forum.inductiveautomation.com/u/Joe_Kelly)\
**Post date:** [February 14, 2022, 10:21pm UTC](https://forum.inductiveautomation.com/t/mobile-barcode-scanner-not-updating-memory-tag/56128/5 "2022-02-14T22:21:09Z")

</div>

Tag Provider Layout:  
 ![java_RbfixCj9wE](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/4/34d017f38d550475ac81f129ba1549df44dce683.png)

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

 ![java_tXlVdGi2LM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/8/e83ef0d97dd862525cb252fea9c454c41411090f.png)

Session Events Script:

 ![java_PX4whWBMcy](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/8/884fce330cd8f13ef871c963da05e4e6abeefcda.png)

Button onClick Event:

 ![java_X5UH4AeDmL](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/f/2fe18da83119ae1b5f2f6fafbbee8c6b0daf71a1.png)

---

<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:** [February 14, 2022, 10:42pm UTC](https://forum.inductiveautomation.com/t/mobile-barcode-scanner-not-updating-memory-tag/56128/6 "2022-02-14T22:42:10Z")

</div>

Hmm. Not obvious to me.

---

<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:** [February 14, 2022, 10:48pm UTC](https://forum.inductiveautomation.com/t/mobile-barcode-scanner-not-updating-memory-tag/56128/7 "2022-02-14T22:48:56Z")

</div>

If you make a copy of Barcode\_Tag, and use that path in the script, does _that_ tag write?

---

<div class="post-metadata">

**Author:** ![Joe\_Kelly](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe_kelly/32/30990_2.png) [@Joe\_Kelly](https://forum.inductiveautomation.com/u/Joe_Kelly)\
**Post date:** [February 15, 2022, 11:53am UTC](https://forum.inductiveautomation.com/t/mobile-barcode-scanner-not-updating-memory-tag/56128/8 "2022-02-15T11:53:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Joe\_Kelly](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe_kelly/32/30990_2.png) [@Joe\_Kelly](https://forum.inductiveautomation.com/u/Joe_Kelly)\
**Post date:** [February 15, 2022, 3:20pm UTC](https://forum.inductiveautomation.com/t/mobile-barcode-scanner-not-updating-memory-tag/56128/9 "2022-02-15T15:20:17Z")

</div>

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?

---

<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:** [February 15, 2022, 3:24pm UTC](https://forum.inductiveautomation.com/t/mobile-barcode-scanner-not-updating-memory-tag/56128/10 "2022-02-15T15:24:27Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![Joe\_Kelly](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe_kelly/32/30990_2.png) [@Joe\_Kelly](https://forum.inductiveautomation.com/u/Joe_Kelly)\
**Post date:** [February 15, 2022, 3:25pm UTC](https://forum.inductiveautomation.com/t/mobile-barcode-scanner-not-updating-memory-tag/56128/11 "2022-02-15T15:25:09Z")

</div>

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