Easily monitor the indoor environment-⑥ Acquire operation information of industrial automation equipment in Java (OPC-UA / Eclipse Milo)-

Introduction

Operates from equipment compatible with the industrial network protocol OPC-UA, which is attracting attention from the perspective of Industry 4.0 / IIoT in the field of industrial automation. I have created a Java client rainy-opcua to get information. It should be noted that OPC-UA is only for simply acquiring operation information from the device.

The Eclipse project Milo is used for the Java implementation of the OPC-UA protocol stack and SDK. There seem to be several languages for implementing OPC-UA, but Milo is recommended for the Java version. If you ask a question on the mailing list about any questions, you will get a fairly good response.

rainy-opcua is a [sample code] for various OPC-UA clients included in Milo (https://github.com/eclipse/milo/tree/master/milo-examples/client-examples/src/main) / java / org / eclipse / milo / examples / client), and created specifically for the data acquisition function by the communication method of UA Binary Encoding. In that sense, it's an orthodox code that isn't strange at all. Data is acquired from the device by the general method of OPC-UA called Subscription & Monitored Item.

When creating it, I mainly read OPC Unified Architecture Specification Part 4: Services. .. Explains the RPC called from the OPC-UA client comprehensively for the services provided by the OPC-UA server. So, to create a client, you should read mainly Part 4. To access the OPC-UA documentation, you need to register as a user with the OPC Foundation.

For more information on implementing rainy-opcua, see Github Code Please refer. Milo supports the mechanism of "Part 4-6.5 Re-establishing connections", and rainy-opcua implements the interface prepared for this purpose. As a result, even if the OPC-UA server (device or protocol conversion server) goes down and the connection is lost, in many cases the session is restored (createSubscription & createMonitoredItems) when it is restarted. In the actual factory, it does not matter for the convenience of the OPC-UA client, and it is a response assuming that the device will stop.

As an aside, developing an OPC-UA server (not a client) with Milo can be a daunting task. The client sample code is good, but I don't think so about the server. In the first place, Milo doesn't have any documentation yet. Personally, it doesn't matter if the sample code is substantial ...

To obtain operation information from a device that does not support OPC-UA

Generally speaking, I think that there are still a small number of devices currently in operation that are compatible with OPC-UA. In this case, the industrial network protocol of the existing device (eg EtherNet / IP (CIP) or [Modbus](https://ja. wikipedia.org/wiki/Modbus) etc.) needs a mechanism to convert to OPC-UA. In fact, there are commercial products for such protocol conversion. (I haven't seen it in open source yet)

In general, the life cycle of equipment is relatively long, such as a dozen years, so I think it will take some time to migrate. In addition, there may be some fields that do not have to be OPC-UA in the first place.

A series of articles

This series consists of the following articles:

  1. Motivation and Concept
  2. Catch Bluetooth LE advertisement signal with Java (Bluetooth LE / bluez-dbus) The related Github is here.
  3. Get temperature / humidity / illuminance etc. from TI SensorTag CC2650 with Java (Bluetooth LE / bluez-dbus) The related Github is here.
  4. Obtain CO2 concentration from MH-Z19B with Java (serial communication / jSerialComm) The related Github is here.
  5. Get PM2.5 concentration from PPD42NS in Java (GPIO / Pi4J) The related Github is here.
  6. ** Acquire operation information of industrial automation equipment in Java (OPC-UA / Eclipse Milo) (this time) ** The related Github is here.
  7. Collect in a simple tool The related Github is here.
  8. Postscript

Postscript

[2019.11.16] For the latest information on simple tools, please refer to here.

Recommended Posts

Easily monitor the indoor environment-⑥ Acquire operation information of industrial automation equipment in Java (OPC-UA / Eclipse Milo)-
Easily monitor the indoor environment ~ ⑨ Get motion detection (HC-SR501 / RCWL-0516) in Java (GPIO / Pi4J) ~
Easily monitor the indoor environment-⑦ Summarize in a simple tool-
Easily monitor the indoor environment ~ ⑧ Postscript ~
Examine the system information of AWS Lambda operating environment in Java
Easily monitor the indoor environment-⑪ Obtain the illuminance with Java from BH1750FVI (substitute)-(I2C / Pi4J)-
Easily monitor the indoor environment- (1) Motivation and concept-
Easily monitor the indoor environment-② Catch the Bluetooth LE advertisement signal with Java (Bluetooth LE / bluez-dbus)-
Easily monitor the indoor environment-⑤ Obtain PM2.5 concentration from PPD42NS with Java (GPIO / Pi4J)-
[Java] Get the file in the jar regardless of the environment
Easily monitor the indoor environment-④ Obtain CO2 concentration from MH-Z19B with Java (serial communication / jSerialComm)-
Easily monitor the indoor environment-⑩ Obtain temperature / humidity / atmospheric pressure from BME280 (substitute) with Java (I2C / Pi4J)-