# Simple java OPC UA Client

**URL:** <https://forum.inductiveautomation.com/t/simple-java-opc-ua-client/8161>\
**Category:** Module Development\
**Created:** [March 17, 2014, 8:38pm UTC](https://forum.inductiveautomation.com/t/simple-java-opc-ua-client/8161 "2014-03-17T20:38:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lvboque](https://avatars.discourse-cdn.com/v4/letter/l/9f8e36/32.png) [@lvboque](https://forum.inductiveautomation.com/u/lvboque)\
**Post date:** [March 17, 2014, 8:38pm UTC](https://forum.inductiveautomation.com/t/simple-java-opc-ua-client/8161/1 "2014-03-17T20:38:59Z")

</div>

Hello,

I would like to create a really simple java application to get some opc variables …

Is anybody can provide me some sample code ?  
(connections to opc server, get tag values, etc.)

Many Thanks,

Laurent

---

<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:** [March 17, 2014, 8:44pm UTC](https://forum.inductiveautomation.com/t/simple-java-opc-ua-client/8161/2 "2014-03-17T20:44:09Z")

</div>

You should be using a Java-based OPC-UA SDK to accomplish this, not the Ignition module SDK, which does not provide a general purpose UA SDK.

Try the Prosys client SDK… it looks pretty easy to get started with.

---

<div class="post-metadata">

**Author:** ![lvboque](https://avatars.discourse-cdn.com/v4/letter/l/9f8e36/32.png) [@lvboque](https://forum.inductiveautomation.com/u/lvboque)\
**Post date:** [March 18, 2014, 12:38pm UTC](https://forum.inductiveautomation.com/t/simple-java-opc-ua-client/8161/3 "2014-03-18T12:38:27Z")

</div>

Is there any open-source alternative to this?

---

<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:** [March 18, 2014, 2:55pm UTC](https://forum.inductiveautomation.com/t/simple-java-opc-ua-client/8161/4 "2014-03-18T14:55:51Z")

</div>

Not that I’m aware of.

---

<div class="post-metadata">

**Author:** ![saurabh.samber](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@saurabh.samber](https://forum.inductiveautomation.com/u/saurabh.samber)\
**Post date:** [February 9, 2018, 4:04pm UTC](https://forum.inductiveautomation.com/t/simple-java-opc-ua-client/8161/5 "2018-02-09T16:04:42Z")

</div>

Hello kevin

I am using the prosys OPC UA Java SDK and i dont understand from where i can start to develop the opc ua client

what will be the first step to develop a OPC ua client in java.

can you please help me how can i implement the code

---

<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:** [February 9, 2018, 4:12pm UTC](https://forum.inductiveautomation.com/t/simple-java-opc-ua-client/8161/6 "2018-02-09T16:12:54Z")

</div>

> [@saurabh.samber](#):
>
> what will be the first step to develop a OPC ua client in java.

Read the Prosys documentation.

> [@saurabh.samber](#):
>
> can you please help me how can i implement the code

I believe they have sample code as well.

---

<div class="post-metadata">

**Author:** ![Kevin.Collins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.collins/32/13497_2.png) [@Kevin.Collins](https://forum.inductiveautomation.com/u/Kevin.Collins)\
**Post date:** [February 9, 2018, 6:33pm UTC](https://forum.inductiveautomation.com/t/simple-java-opc-ua-client/8161/7 "2018-02-09T18:33:35Z")

</div>

You can connect to an OPC UA server via Node-RED… I’ve used it in the past for some quick mockups… Worth a look:

> **[node-red-contrib-opcua](https://flows.nodered.org/node/node-red-contrib-opcua)**
>
> A Node-RED node to communicate via OPC UA based on node-opcua library.

Granted, this doesn’t help you if you _must_ have it in Java, but alas, it is a nice quick way to get some data out.

---

<div class="post-metadata">

**Author:** ![saurabh.samber](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@saurabh.samber](https://forum.inductiveautomation.com/u/saurabh.samber)\
**Post date:** [February 9, 2018, 8:05pm UTC](https://forum.inductiveautomation.com/t/simple-java-opc-ua-client/8161/8 "2018-02-09T20:05:38Z")

</div>

Hello Klevin,

yes they have a code inside , but i dont know how to use this sample code in my own application.

Can you please explain me what will be my first step for OPC UA java development

first i have create a client… how to create a client  
second add the SDk  
third add the Stack to the code

This is right or something else i have to do

Please explain…thanks in advance

best regards

SAM

---

<div class="post-metadata">

**Author:** ![saurabh.samber](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@saurabh.samber](https://forum.inductiveautomation.com/u/saurabh.samber)\
**Post date:** [February 9, 2018, 8:08pm UTC](https://forum.inductiveautomation.com/t/simple-java-opc-ua-client/8161/9 "2018-02-09T20:08:03Z")

</div>

One more thing i dont understand anything from the prosys documentation.
