OPC UA

OPC UA

Implementation of the library eclipse milo to access devices connected through OPC UA. This is the hardware module that give support to OPC UA Datastreams.

To access source code click here.

Dependencies

This module requires the following modules:

  • Commons: Provide the OPC UA APIs, exceptions and types and the basic APIs to register the service.
  • Scada Tables: Provide the information of the data to read from the OPC UA server (address, datastreamID, deviceId).

Configuration

To configure OPC UA Hardware module, a file named es.amplia.oda.hardware.opcua.cfg must be created with the next parameters:

  • url: Required data. URL of the endpoint of OPC UA server
  • subscription.publish: Required data. Indicates the number of miliseconds of data publishing.
  • subscription.list: Required data. Indicates the data we want to retrieve with the format : namespaceIndex1;nodeId1;samplingInterval1|namespaceIndex2;nodeId2;samplingInterval2| ....
  • user: Optional data. Indicates the user to use to authenticate with the OPC UA server.
  • password: Optional data. Indicates the password to use to authenticate with the OPC UA server.
  • insecure: Optional data. Indicates if we want to use security in the connection with the OPC UA server.
  • certificate.file.client: Optional data. Indicates the file which contains the certificate used to connect securily to the server.
  • certificate.file.publicKey: Optional data. Indicates the file which contains the public key used to connect securily to the server.
  • certificate.file.privateKey: Optional data. Indicates the file which contains the private key used to connect securily to the server.
  • certificate.validator.directory: Optional data. Indicates the directory where certificates are stored
  • endppoint.select.index: Optional data. Indicates the index of the endpoint of the OPC UA server that we want to connect to. In case it is not defined, it will try to connect to the first server returned by the discovery endpoint.

es.amplia.oda.hardware.opcua.cfg will have a similar format to:

url=opc.tcp://opcua.nl:4840
subscription.publish=10000
subscription.list=1;6057;5000|1;6192;5000|1;6159;5000

user=OPCUA_user
password=testPass
insecure=true

certificate.file.client=certs/my_cert.pem
certificate.file.publicKey=certs/clientPublicKey.pem
certificate.file.privateKey=certs/my_private_key.pem
certificate.validator.directory=certs

endppoint.select.index=1

To determine the datastreamId of the variables read we use the ScadaTables bundle. The configuration file es.amplia.oda.service.scadatables.cfg will have a format similar to:

*,6057 = datastream:BombaActiva,device:testDevice1
*,6192 = datastream:AlarUndervoltage,device:testDevice2
*,6159 = datastream:AlarDispProteccionTermica,device:testDevice1