# Use an SQLTag from a PLC in a script?

**URL:** <https://forum.inductiveautomation.com/t/use-an-sqltag-from-a-plc-in-a-script/1557>\
**Category:** Ignition\
**Created:** [February 19, 2010, 8:08pm UTC](https://forum.inductiveautomation.com/t/use-an-sqltag-from-a-plc-in-a-script/1557 "2010-02-19T20:08:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GarbeVic](https://avatars.discourse-cdn.com/v4/letter/g/c6cbf5/32.png) [@GarbeVic](https://forum.inductiveautomation.com/u/GarbeVic)\
**Post date:** [February 19, 2010, 8:08pm UTC](https://forum.inductiveautomation.com/t/use-an-sqltag-from-a-plc-in-a-script/1557/1 "2010-02-19T20:08:47Z")

</div>

Beginner question: What is the proper syntax needed to add 10 to an SQLTag value in a script?  
It’s a global Event script, Timer type.  
Simply putting the tagname in the line does not work: simTankLevel = simTankLevel + 10  
Searched all the keywords I could think of. Probably won’t know the correct search keyword until I know the answer… 🙂  
Please point me to an example if one is available. Thanks, Vic

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [February 19, 2010, 10:06pm UTC](https://forum.inductiveautomation.com/t/use-an-sqltag-from-a-plc-in-a-script/1557/2 "2010-02-19T22:06:24Z")

</div>

In a python script you need to use a function to get and set tag values.

`value = system.tag.getTagValue("[]mytag")
system.tag.writeToTag("[]mytag", value+10)`  
You can take a look int the manual under Scripting-\>Python-\>API References-\>system.tag to see all the the functions available for working with tags. If you search for ‘write tag’ in the manual it’s the second hit.  
🙂

---

<div class="post-metadata">

**Author:** ![GarbeVic](https://avatars.discourse-cdn.com/v4/letter/g/c6cbf5/32.png) [@GarbeVic](https://forum.inductiveautomation.com/u/GarbeVic)\
**Post date:** [February 22, 2010, 1:16pm UTC](https://forum.inductiveautomation.com/t/use-an-sqltag-from-a-plc-in-a-script/1557/3 "2010-02-22T13:16:01Z")

</div>

Robert,  
That will get me going, Thanks!  
Vic
