# Memory to opc tag

**URL:** <https://forum.inductiveautomation.com/t/memory-to-opc-tag/4755>\
**Category:** Ignition\
**Created:** [July 3, 2012, 8:27pm UTC](https://forum.inductiveautomation.com/t/memory-to-opc-tag/4755 "2012-07-03T20:27:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnLynx](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@JohnLynx](https://forum.inductiveautomation.com/u/JohnLynx)\
**Post date:** [July 3, 2012, 8:27pm UTC](https://forum.inductiveautomation.com/t/memory-to-opc-tag/4755/1 "2012-07-03T20:27:13Z")

</div>

Hi,

I’m trying to base the value of my OPC tag depending on what my memory tag is set for. I’ve read the manual and have not had much luck in figuring this out. Below is what I expect it to look like but is not working. When I606 my memory tag is a 1 I want R606 my OPC tag to be a 4.

if system.tag.read(“I606”) == 1:  
system.tag.write(“R606”, 4)

What am I missing for this write script to work?

Thanks.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 3, 2012, 8:46pm UTC](https://forum.inductiveautomation.com/t/memory-to-opc-tag/4755/2 "2012-07-03T20:46:13Z")

</div>

system.tag.read() returns a QualifiedValue, which you then need to get the value from.

```auto
if system.tag.read("I606").value == 1:
	system.tag.write("R606", 4)
```

---

<div class="post-metadata">

**Author:** ![JohnLynx](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@JohnLynx](https://forum.inductiveautomation.com/u/JohnLynx)\
**Post date:** [July 3, 2012, 9:00pm UTC](https://forum.inductiveautomation.com/t/memory-to-opc-tag/4755/3 "2012-07-03T21:00:00Z")

</div>

Thanks Kevin
