Prosys OPC UA Web Client released
A public demo of our new OPC UA Web Client was released today. This demo release is meant to serve as an example on how developers can take advantage of both the Java EE platform and the Node.js APIs when delivering highly scalable UA clients.
The OPC UA functionalities of the web client were implemented by using our own OPC UA Client SDK. It currently supports basic features such as browsing the server address space, reading and writing variable values, and monitoring variables for value changes.
The service layer implements the actual OPC UA client functionality. It sits between the web browsers and OPC UA servers, and manages the UA connections. The service runs on Java 8 and uses Project Avatar for added Node.js compatibility and for implementing the web services interfaces used to communicate between the web browsers and OPC UA servers.
Using the web client
The first step is to connect to an OPC UA server. Start by typing in the endpoint URI of a public OPC UA server, and clicking connect. Prosys provides these two OPC UA servers for your convenience:
- Prosys OPC UA Simulation Server: opc.tcp://localhost:53530/OPCUA/SimulationServer
- Prosys Weather Station: opc.tcp://10.50.100.129:48401
- Read more about our weather station here: http://prosysopc.com/blog/raspberry-pi-java-sdk-based-opc-ua-weather-station/
Next you will be greeted with the landing page of the web client. The header bar changes to indicate that you are now connected to an OPC UA server and to show the current server state which should be Running. The tree view on the left sidebar shows a hierarchical view of the server address space, and the main view shows information about the selected node, which happens to be the browse root of the address space.
To browse the address space, expand a tree node by clicking on a folder icon in the address space browser. In order to view a node’s attributes and references, click on a label in the address space browser. To write the value attribute of a selected node, click on the value in the details view, type a new value, and hit enter.
You can access a node-specific context menu by right-clicking a node in the address space browser. Several other operations are available in the context menu, which you can access by right-clicking on a node in the address space browser. You will be presented with three options: monitor, subscribe to events, and read history.
Choose Monitor to subscribe to data changes in the selected node. The monitored data values will be shown in the Subscriptions tab. Choose Subscribe to Events to listen on the selected node for events. The received events will be shown in the Events tab. Choose Read History to read historical data of the selected node. The history values will be shown in the History tab both in tabular and graph formats.
You can disconnect from the server by clicking the disconnect button. Note that any existing subscriptions will be removed when you disconnect.
Next I will be giving a brief introduction to Node.js and Project Avatar.
The basic idea behind node’s single-threaded programming model is that I/O operations are expensive, and that blocking operations are bad as they waste CPU cycles. Therefore, instead of creating a new thread for each incoming HTTP request, Node performs I/O operations asynchronously and lets the programmer provide callback functions that should be called when the I/O operations have finished. In this way Node can accept multiple simultaneous HTTP requests that each initiate a database query, without having to wait for the first query to finish first.
There are several reasons to consider using Avatar instead of plain Node.js, the most obvious one being the possibility to leverage existing Java code base, including the standard Java API.
Another reason to use Avatar has to do with scalability. By design, Node applications utilize only one thread, and in order to scale the applications up, multiple Node processes should be forked from the main process. To facilitate this, Node comes with a cluster module, which allows the main process to spawn worker processes that communicate with each other via the master process. Cluster module allows multiple worker processes to listen on the same server port for incoming connections, and lets the OS take care of load balancing across those processes. In contrast, the Avatar framework has built-in support for utilizing multiple CPU cores. Unlike Node, it does not require manual management of the worker procesesses by the developer. It does so by creating multiple service threads, and automatically load balancing incoming connections between them. Shared state between threads is achieved either through message passing or via an application scoped or session scoped state accessor.
Future versions of the client continue to add features, such as parameterized history reads, adding support for method calls, multi-server support, improved event handling, support for small display sizes, and re-usable view components in the form of custom AngularJS directives.
You can find the public demo of the OPC UA Web Client here: http://uaclient.prosysopc.com/
Expertise and responsibility areas: OPC & OPC UA product development, project work
Prosys is a leading provider of professional OPC software and services with over 10 years of experience in the field. OPC and OPC UA (Unified Architecture) are communications standards used especially by industrial and high-tech companies.
Newest blog posts
OPC UA is getting popular in real-world installations and also going towards real-time with the latest announcements about support for field level.
Watch the short videos to get a quick overview of how to get started with OPC UA end-user products or with development. They are represented by Jouni Aro, the CTO of Prosys OPC.