Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Latest commit

 

History

History
142 lines (98 loc) · 4.36 KB

README.md

File metadata and controls

142 lines (98 loc) · 4.36 KB

OPC-UA Sample Application

It provides example codes of both client and server. It will be helpful usage of opcua stack library.

How to build

Command

$ ./build.sh

build_exam

Executable binary
  • Server
    • Executable : target/opcua-server-0.0.1-SNAPSHOT-jar-with-dependencies.jar
  • Client
    • Executable : target/opcua-client-0.0.1-SNAPSHOT-jar-with-dependencies.jar

example_jars

Eclipse

Prerequisites
  1. Import opcua stack File - Import -Existing Maven Project - next -> select Root Directory in your source directory : protocol-opcua-java/edge-opcua -> finish

  2. Import sample application File - Import -Existing Maven Project - next -> select Root Directory in your source directory : protocol-opcua-java/example -> finish

  3. Run as 'java application' in both opcua-client and opcua-server projects

  • Reference : If you have some error related dependency in pom.xml, please update maven project following below - 'Select Project' -> 'Click Right button' -> 'Maven' -> 'Update Maven Project' -> Check 'Force Update of Snapshots/Releases' -> OK

How to run

Test

1. Executable binary

  • server
$ java -jar target/opcua-server-0.0.1-SNAPSHOT-jar-with-dependencies.jar

server_1


 start : start opcua server / create Node  -> first of all, you should input this command for testing

 getnode : get node information

 getnode2 : get node information with browse name

 quit : terminate server

 help : show menu
  • client
$ java -jar target/opcua-server-0.0.1-SNAPSHOT-jar-with-dependencies.jar

client_1


   start : start opcua client / connect with opcua server / intialize Service Provider

   quit : terminate client

   provider : get the provider list

   browse : browse all nodes with root node

   browse_m : multiple browse with several target nodes

   read_s : read attribute for server node

   read_t : read attribute for target node

   read_gp : multiple read attribute for target nodes

   write : write attribute to target node

   write_gp : multiple write attributes to nodes

   sub : subscription 

   sub_modify : modfiy subscription

   sub_delete : delete subscription

   endpoint : get endpoints from the server

   auto : run test automatically

   help : show menu

2. Start server

input start and then, input Your IP Address in OPC-UA Server. server_2

Then start OPC-UA Server. And create nodes. server_3

3. Start Client

input start and then, input opc.tcp://[OPC-UA Server's IP Addreess]/edge-opc-server in OPC-UA Client. client_2

Then, OPC-UA Client connect with OPC-UA Server.
And create service provider which indicate target node. client_3

And, Show the alias of the provider client_4

4. Read Command

input read_t and then, input the alias of the provider which indicate target node. (refer getting the alias of the Provider step).
Then read attribute from server node. client_5

5. Write Command

input write and then, input the alias of the provider which indicate target node.
Then write to the target node of the opcua server. client_6

6. Monitoring

input start CNC in OPC-UA Server.
Then update value of the 'cnc100' node server_8

input sub command in OPC-UA Client. And then, input the alias of the provider which indicate target node.
Then request subscription to target node. you can receive changed value from the target node. client_7 client_8