# Loading a value in client tag at startup

**URL:** <https://forum.inductiveautomation.com/t/loading-a-value-in-client-tag-at-startup/7480>\
**Category:** Ignition\
**Created:** [October 28, 2013, 7:42pm UTC](https://forum.inductiveautomation.com/t/loading-a-value-in-client-tag-at-startup/7480 "2013-10-28T19:42:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhortig](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jhortig](https://forum.inductiveautomation.com/u/jhortig)\
**Post date:** [October 28, 2013, 7:42pm UTC](https://forum.inductiveautomation.com/t/loading-a-value-in-client-tag-at-startup/7480/1 "2013-10-28T19:42:59Z")

</div>

I have a ignition project that serves as HMI for 9 similar machines. Each machine has a panel PC on which I launch the client.  
To link the client to a machine I have a client tag with a machine number.  
Every time I start up a client it automatically comes up with the machine number I entered the first time I created the project.  
How can I make each client to “remember” the machine number that was in the client tag before the client was shut down?

Thanks.

Ignition Version 7.5.10

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.inductiveautomation.com/u/Pat)\
**Post date:** [October 28, 2013, 8:03pm UTC](https://forum.inductiveautomation.com/t/loading-a-value-in-client-tag-at-startup/7480/2 "2013-10-28T20:03:35Z")

</div>

How about setting the machine number according to the clients IP address by using the sytem.net.getIpAddress() function?

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [October 28, 2013, 8:52pm UTC](https://forum.inductiveautomation.com/t/loading-a-value-in-client-tag-at-startup/7480/3 "2013-10-28T20:52:53Z")

</div>

Another option is, in Client Events Scripts - Shutdown, to store the client tag value in a file local to the computer (for Windows 7, use C:\users\public) and later, in Client Event Scripts - Startup, read from the same file to populate the Client tag.

---

<div class="post-metadata">

**Author:** ![jhortig](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jhortig](https://forum.inductiveautomation.com/u/jhortig)\
**Post date:** [October 28, 2013, 11:09pm UTC](https://forum.inductiveautomation.com/t/loading-a-value-in-client-tag-at-startup/7480/4 "2013-10-28T23:09:56Z")

</div>

> [@Pat](#):
>
> How about setting the machine number according to the clients IP address by using the sytem.net.getIpAddress() function?

That works great, Thank you.

I used the following script:

[code]ip = system.net.getIpAddress()

if ip == "10.20.0.253":  
system.tag.writeToTag('[Client]Client\_Inv\_Num', 2870101)

elif ip == "10.20.0.254":  
system.tag.writeToTag('[Client]Client\_Inv\_Num', 6870101)[/code]
