# How to program to write a value to OPCUA node

**URL:** <https://forum.inductiveautomation.com/t/how-to-program-to-write-a-value-to-opcua-node/3629>\
**Category:** General Discussion\
**Created:** [November 20, 2011, 2:46am UTC](https://forum.inductiveautomation.com/t/how-to-program-to-write-a-value-to-opcua-node/3629 "2011-11-20T02:46:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wengzijue](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@wengzijue](https://forum.inductiveautomation.com/u/wengzijue)\
**Post date:** [November 20, 2011, 2:46am UTC](https://forum.inductiveautomation.com/t/how-to-program-to-write-a-value-to-opcua-node/3629/1 "2011-11-20T02:46:17Z")

</div>

I have read the example of OPCUA----Ignition-ModuleSDK-7.2.8\example\WeatherModule\_Gateway,the example show how to build nodes,and get node value from others sourse(In this example :Weather service from a web service),so it can read the node value,but how can I write a value to a node ,in other words: change the node’s value,and in response to change the value from others sourse,thank you very much.

---

<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:** [November 21, 2011, 7:52pm UTC](https://forum.inductiveautomation.com/t/how-to-program-to-write-a-value-to-opcua-node/3629/2 "2011-11-21T19:52:21Z")

</div>

The way the weather driver works is that there’s a lot of machinery going on in the background as a result of extending from NodeMapDriver that leads to values being asked of DataNode - not the other way around.

But for any driver what ultimately happens when a subscription is made is that you get a SubscriptionItem for each address. SubscriptionItem extends ReadItem, which has a setValue(DataValue) call on it. This call is how the driver communicates value changes back to the server.

These interfaces (SubscriptionItem, ReadItem) are documented in the javadocs as well.

---

<div class="post-metadata">

**Author:** ![wengzijue](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@wengzijue](https://forum.inductiveautomation.com/u/wengzijue)\
**Post date:** [November 22, 2011, 1:54am UTC](https://forum.inductiveautomation.com/t/how-to-program-to-write-a-value-to-opcua-node/3629/3 "2011-11-22T01:54:46Z")

</div>

Thank your very much.  
Can you give me more detailed inforamtion about it,A framework of code about how to read and write a value to a node will be appreciated.
