Skip to main content

Advanced settings

These settings are not in the dialog. Send them in a message: msg.config, msg.mode and msg.ifRevision.

A flow file can hold a value of one of them in the node, from an old flow or an edit by hand. The names are request.maxRetry, request.initialDelay, request.maxDelay, request.subscriptions, request.namespaceAliases, mode and ifRevision. The node ignores these values. It warns once at deploy and names the fields, never the values.

Retry​

maxRetry, initialDelay and maxDelay set how the client waits when a connection fails or is lost. They are also fields of the OpcUa-Endpoint2 node, under Advanced parameters. A message changes the value of the endpoint while the settings of the message are in use.

FieldBoundsDefault
maxRetryinteger, 1 to 102
initialDelayinteger, 1000 to 60000 ms1000
maxDelayinteger, 1001 to 300000 ms, more than initialDelay10000
msg.action = "connect";
msg.config = { initialDelay: 2000, maxDelay: 30000 };
  • A value outside the bounds gets an error message on the field. The node never changes a value to fit the bounds.
  • The smallest maxDelay is 1001: it must be more than initialDelay, and the smallest initialDelay is 1000.
  • initialDelay and maxDelay control each new connection after a lost connection.
    • The client waits initialDelay before the first attempt.
    • After each failure, it waits two times longer, up to maxDelay.
    • Then it tries again without end, every maxDelay.
    • After each new loss, it starts again at initialDelay.
  • maxRetry limits the attempts of the first connection. After a lost connection, the node never stops trying.
    • It must be 1 or more. With 0, a lost connection is never repaired, so 0 is refused.
    • maxRetry has no effect yet. The first connection always uses 2 attempts. This changes when a version of the OPC UA client library that reads this setting is installed.
    • Get the settings shows applied: false for it, also when the endpoint node sets it.
  • The fields are combined one by one. In mode replace, a field that you do not send uses the value of the endpoint again.
  • Reset removes the retry values of the messages.
  • Get the settings shows each field with its origin, its bounds, and applied (true when the value is in effect).
  • After the last attempt, the node tries again every maxDelay, and it never stops. The state stays reconnecting. The Endpoint Events node reports each attempt (the event retry).

Subscriptions​

subscriptions changes the subscription profiles that the endpoint has. A Monitor or MonitorEvent node uses a profile by its id. Each entry names a profile by its id and holds the parameters to change. Use an id that Get the settings lists. The endpoint dialog numbers the profiles s0, s1 and so on, so a single default profile is s0.

ParameterBounds
maxNotificationsPerPublishinteger, 0 to 10000. 0 means no limit: the server decides
priorityinteger, 0 to 255
publishingEnabledtrue or false
msg.action = "connect";
msg.config = {
subscriptions: [ { id: "s0", parameters: { priority: 20, maxNotificationsPerPublish: 500, publishingEnabled: true } } ]
};
  • A message cannot add, rename or remove a profile. So a Monitor node never points to a profile that is not there.
    • An id that the endpoint does not have gets an error message on subscriptions[i].id.
    • A name gets an error message on subscriptions[i].name.
  • A message cannot set the publishing interval, the keep-alive count or the lifetime count. These three work together. If these three values do not match, the server deletes the subscription and sends no error. A message that names one gets an error message on subscriptions[i].parameters.<name>.
  • At most 64 entries.
  • The parameters are combined profile by profile and parameter by parameter. In mode replace, a parameter that you do not send uses the profile of the endpoint node again.
  • Reset removes all the parameters of the messages.
  • The values apply to the subscriptions of the new session. Every Connect opens a new session, so a running subscription does not change. The values are in use when a Monitor node subscribes again after the switch.
  • publishingEnabled: false pauses the subscription. The node creates it, and then pauses it before a node uses it.
    • A profile that the endpoint node saved with publishing off is still created with publishing on. Only a message pauses.
    • The subscription stays paused when node-opcua creates it again after a server restart.

Namespace aliases​

namespaceAliases is the alias table of the endpoint. A client node can write a node id with an alias: na=plant;s=Marker. For each message, the node finds the alias in the namespace list of the live session. After a switch to a server with other namespace numbers, the same node id reads the correct node.

msg.action = "connect";
msg.config = {
namespaceAliases: [ { alias: "plant", namespaceUri: "urn:plant:line" } ]
};
  • The table of the message replaces the whole table of the endpoint, in mode merge and in mode replace. The node never combines two tables.
  • An empty array removes all the aliases.
  • alias: letters, digits and _. It does not start with a digit. At most 64 characters. Each alias is unique in the table.
  • namespaceUri: the namespace URI, 1 to 512 characters. A URI that starts with ~ (a pattern) is refused.
  • An entry holds alias and namespaceUri only. A message cannot set isWellKnown or isDefault.
  • At most 64 entries.
  • A fault gets an error message on the entry, for example namespaceAliases[1].alias.
  • Without namespaceAliases, mode merge keeps the table in use. Mode replace and Reset use the table of the endpoint node again.

Mode: merge or replace​

msg.mode tells what happens to the values that a message does not send. It applies to Connect and Check.

  • merge (the default): only the values that you send change. The others keep the value in use.
  • replace: the values that you do not send use the settings of the endpoint again. They do not become empty.
msg.action = "connect";
msg.mode = "replace";
msg.config = { endpoint: "opc.tcp://line-b:4840", userIdentityType: "Anonymous" };

In both modes, the login is replaced as a whole. See Send values in a message.

Another value gets an error message on mode. A Reset with msg.mode gets an error message on mode.

If revision​

Two operators can change the same endpoint. The revision is a counter: it grows each time the settings change. msg.ifRevision stops the second operator from overwriting the change of the first.

  1. Send Get the settings. Keep the revision of the result.
  2. Send it back as msg.ifRevision with Connect, Check or Reset.
  3. If the revision changed in the meantime, the message gets an error message on ifRevision. Nothing changes.
msg.action = "connect";
msg.ifRevision = 7;
msg.config = { endpoint: "opc.tcp://line-b:4840", userIdentityType: "Anonymous" };

msg.ifRevision must be a whole number, 0 or more.