1
votes

I am a full newbie in OPC. Some things are not obvious for me.

I am using opcua stack (uaserver) from: https://github.com/digitalpetri As a client software (for now, just for tests) I am using UAExpert from United Automation.

Each customer has a few units. Each unit can have some values. Everything is in a postgres db. I need to expose those values via OPC for customers.

Now I see it like I have to implement:

  • A Folder Node per each customer.
  • Each Folder has References for multiple Nodes which are units
  • Each unit has some Nodes which are values (not really matter here)

My concerns:

  1. I don't know if such model is ideologically correct for OPC-UA.
  2. It seems unclear for me how shall I notify the OPC client if a unit has been added or removed.
  3. Also it seems I need to prepare all the nodes for all customer folders, units etc., just on my OPC server start. And to keep them even for customers which would have never connected. Is there any correct way to avoid this?
  4. The UAExpert client subscribes to a Server Object just after connect to the server. Is it required for all clients?

Sorry, I really guess the most of these questions could be answered while reading the OPC UA Spec, but maybe someone could just reply it before I dig tons of papers)

1

1 Answers

1
votes

Ad 1. Basically, yes. With some additional rules to follow - for example, the "nodes with values" should be modelled as Variables (which are nodes again, with some prescribed attributes and behavior etc.)

Ad 2. In many cases this is not required. But if you need it, it is done using ModelChangeEvents (see Part 3 of the spec)

Ad 3. This is not a question to the OPC UA specs, but rather to a particular stack/SDK/toolkit you are using. Many of them have a concept of abstract "node manager" which can keep the nodes in memory, or it can provide them dynamically - only when needed. So you need to look into the particular tool you have at hand. Unless the address space is very large, or accessing the underlying information very slow, it is common to prepare all nodes upfront.

Ad 4. Basically, yes. There are things that all reasonable clients need from the Server object (such as the namespace table), plus some requirement in the OPC compliance testing that require the clients to actively use that information. Most SDKs/toolkits will provide the Server object automatically anyway, without extra programming on your part.