12

I am looking for some libraries and some examples to create an client OPC application in Java which could connect with opc server. Thanks in advance.

L. G.
  • 9,642
  • 7
  • 56
  • 78
user1519221
  • 631
  • 5
  • 13
  • 24

4 Answers4

9

Have you checked out OPC Client Programming with Java?

They offer different links for this area:

  • Utgard - pure Java OPC library

Utgard is an open source project offering an OPC library written in pure native Java, i.e. with no dependency on JNI or other DLLs. It is licensed under the GPL.

  • JEasyOPC Client

Antonín Fischer's Java OPC Client is now greatly enhanced and hosted on SourceForge. It uses a JNI layer coded in Delphi. Full source code (both Java and Delphi) is provided.

I think what you are looking for is Utgard, you can find sample code in the documentation sections, respectively in the project source code under documentation.

Konrad Reiche
  • 27,743
  • 15
  • 106
  • 143
  • I have been in this website and there is: git://git.openscada.org/org.openscada.documentation.git and this is one of the option by which I can get this samples. But my question is how to download it and get into my project, because it's git? – user1519221 Aug 09 '12 at 10:38
  • @user1519221 You need the source control management tool [git](http://git-scm.com/) with it you can get the code/documentation with `git clone [URL]` – Konrad Reiche Aug 09 '12 at 11:01
  • 1
    we just finished a short tutorial to Utgard, have a look here: https://openscada.atlassian.net/wiki/display/OP/HowToStartWithUtgard – Mauli May 16 '13 at 09:32
  • Notice that Utgard is not strictly GPL: "The Utgrad Project itself is licensed under the LGPL (unless noted otherwise).". Source: http://openscada.org/projects/utgard/ – Eirik W Feb 05 '15 at 07:46
2

You have two options:

  1. to go for the traditional OPC DCOM as suggested by platzhirsch. DCOM requires JNI and works only in Windows environments.

  2. to go for OPC UA (Unified Architecture), which is the new version of OPC. OPC UA is available in pure Java and available in all Java SE 6 environments. OPC UA includes many advanced features, such as built-in security, information modeling, etc.

OPC UA makes you better future proof, since OPC UA is where all the development happens at the moment. You can also connect to OPC DCOM servers from OPC UA clients with the help of wrappers, such as the UaGateway

For OPC UA, I can suggest Prosys OPC UA Java SDK which is the most advanced option for Java at the moment (commercial, and yes, I am involved myself).

You can read more about OPC UA from here

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97
Jouni Aro
  • 2,099
  • 14
  • 30
  • Is still Prosys for java maitained? – Daniel Henao Apr 05 '19 at 17:00
  • Yes, Prosys OPC UA SDK for Java is and will be maintained as usual and we just released version 4.0 with OPC UA 1.04 support. https://www.prosysopc.com/news/prosys-opc-ua-java-sdk-400-released/ – Jouni Aro Apr 08 '19 at 07:29
0

Here are some open source UPC UA implementations on GitHub:

They're emerging and not complete, but if you're researching or prototyping, that the right way to start as opposed to full-featured commercial libraries.

Sergei Rodionov
  • 4,079
  • 6
  • 27
  • 44
0

Implement OPC API in C++. Make it a DCOM object and running as a windows service.

You can connect to DCOM objects through J-Interop or JACOB both are JAVA-DCOM bridge.