Erweiterte Programmierung


The iPlus system supports communication with other external systems/devices via OPC Unified Architecture (OPC UA) standard. The client version of OPC UA is implemented in the iPlus system. The implementation in the iPlus is based on three components:

OPCUAClientACService - represents the root component under which we add one or more OPCUAClientACSessions, also this component implements the AplicationInstance from OPC UA library.

OPCUAClientACSession - the component which usually represents the device (OPC UA Server) which communicates with iPlus system, also under this component we add one or more OPCUAClientSubscr (subscriptions).

OPCUAClientACSubscr - the component that represents subscription under which we define Monitored Items 

How to add, configure and use OPC UA client in the iPlus will be explained in the following chapters.


The practice is that we add a communication components for the OPC UA client under the DataAccess project.  It is very important to respect the parent/child relationship (tree structure) when we add communication components. Example:

 

1) Shows  an example how components can be added to DataAccess project

2) Shows a relevant component which you need to setup OPC UA Client in the iPlus system, you can also see here, where these components are placed under project library.

To add a communication components, you need to use drag and drop technique:

  1. Select the target component in the project library, eg. you want add OPCUAClientACSession, then you need select OPCUAClientACSession
  2. Now drag target component (OPCUAClientACSession) to the destination component in the application project tree, eg. to the OPCUAClientACService
  3. Save changes 

*Note: Check if is component StartTyp in the state that you want. Usually is used in a automatic or disabled type.


OPCUAClientACService

To configure the OPCUAClientACService please use the Development Enviroment (Properties).

Under this component we can configure a following options:

  • ClientApplicationConfigrationPath - here you must specifiy the OPCUAClient configuration file. This configuration file you can find under iPlus installation's directory. The file name is OPCUAClient.Config.xml. 
  • UseCertificate - with this parameter you can configure that OPC UA service verify certificate.

 

OPCUAClientACSession

To configure the OPCUAClientACSession you can use the ControlDialog (Konfiguration) or the Development Environment (Properties). The following image shows the configuration in the Controldialog:

Here we can configure a following options:

  • EndpointURL - represents the address of the OPC UA server where you want connects from the client. e.g.: opc.tcp://localhost:51210/UA/SampleServer
  • UserAuthenticationMode - with this parameter you can choose client authentication mode to server
    • Anonymous - anonymous authentication mode
    • Username - authentication with user name and password, you must enter the target username and password in the configuration
    • Certificate - authentication with certificate, you must enter the target certificate token path and password in the configuration
  • ReconnectPeriod - represents the period (in ms) after that sessions start reconnection, if is connection to server lost. 
  • AutoReconnect - here you can configure that session automatically tries reconnect to the server if is connection lost.

 

OPCUAClientACSubscr

To configure the OPCUAClientACSubscr, use the Development Environment (Properties).

Here you can configure:

  • RequiredUpdateRate - represents the publishing interval of monitored item

 


The monitored items is used to define a subscription to the data on the OPCUA server. To create monitored items in the iPlus we use the OPCUAClientACSubscr component.

How to create monitored item in the iPlus system:

  1. Open the development environment and navigate to the OPCUAClientACSubscr component
  2. Then switch to Configuration tab
  3. Click on the button NewConfiguration(1) to create a new configuration item, which you can see in the items list(2)
  4. Now, you must define Property Name/ID, Data Type and Description(3)
  5. Turn on the Broadcast in Netw. and here you can configure is item Input (read) and/or Output (write) (4)
  6. Enter the OPCAddr (5) which represent the OPCUA NodeID 
  7. Save changes

 


The component OPCUAClientACSession can be added to the visualisation. How to add to the visualisation, please read chapter about  iPlus designs and designer, if you already not. On the visualisation component ilustration shows basic information is session connected or not. Also over this visualisation item context menu, you can initiate commands to connect/disconnect  session.