← Articles
OPC UA/8 min read/— views

OPC UA Client Commissioning: Record What the Server Revised, Not What You Asked For

Commissioning an OPC UA client means reading the revised values back: revisedSessionTimeout, revisedPublishingInterval, lifetimeCount, the 8192-byte buffer floor, and the top two bits of StatusCode — per OPC UA Part 4 and Part 6.

OPC UASCADAHistorianTroubleshootingChecklists

The historian had a 10 to 20 minute hole most nights. The client screen said connected, every node browsed, values came back. The configuration page said publishing interval 250 ms. What the server actually returned was 1000 ms. Nobody read the response.

What people write down during OPC UA commissioning is the value they requested. What runs in production is the value the server revised. That gap is where OPC UA differs from most industrial protocols, and it is the only thing that makes a commissioning record worth keeping.

Three steps of OPC UA connection setup — Hello answered by Acknowledge, CreateSession by revisedSessionTimeout, CreateSubscription by revisedPublishingInterval. The settings that run are the ones the server revised Client Server Hello CreateSession CreateSubscription Acknowledge · 8192 bytes revisedSessionTimeout revisedPublishingInterval revised by server

The values the server hands back changed

CreateSession, CreateSubscription and CreateMonitoredItems in OPC UA Part 4 are all request/revise pairs. The client sends requested... and the server is entitled to answer with revised.... The column worth writing into the commissioning record is the right-hand one.

RequestedServer answersWhat to check at commissioning
requestedSessionTimeoutrevisedSessionTimeoutIf it was cut, keepalive has to go below it
requestedPublishingIntervalrevisedPublishingIntervalThe real floor for trend resolution and historian interval
requestedMaxKeepAliveCountrevisedMaxKeepAliveCountHow often a keep-alive arrives when nothing changes
requestedLifetimeCountrevisedLifetimeCountPart 4 requires at least 3× keepAliveCount
ReceiveBufferSize / SendBufferSizeAcknowledgeThe OPC UA Part 6 floor is 8192 bytes

Lifetime bites the quietest. If revisedLifetimeCount × revisedPublishingInterval elapses while the server holds no Publish request from the client, the server deletes the subscription. The next call comes back Bad_SubscriptionIdInvalid, and plenty of clients never put that on a screen — the data just stops. That was the historian hole above. Keep several Publish requests outstanding; a client that keeps exactly one burns subscription lifetime in every round trip. More in session timeout and keepalive and sampling versus publishing.

Buffers are settled in Hello/Acknowledge and nowhere else. Bad_ResponseTooLarge or Bad_RequestTooLarge on a large structure or array is that negotiation, not a node permission problem. MaxMessageSize and MaxChunkCount use 0 for unlimited, so recording "no limit" because you received 0 is not a record.

Use the endpoint string GetEndpoints returned, verbatim

The IANA-registered port for opc.tcp is 4840. Nothing guarantees the discovery endpoint and the production endpoint share it, and the endpointUrl the server returns from GetEndpoints is the string the client is supposed to connect with. Substituting an IP address for the hostname in it breaks two things.

  • The server may compare the URL during session setup and return Bad_TcpEndpointUrlInvalid.
  • If that name is not in the certificate's SubjectAltName, you get Bad_CertificateHostNameInvalid.

There is a separate ApplicationUri trap. The SubjectAltName URI in the application instance certificate must match the applicationUri in the ApplicationDescription character for character; a mismatch is Bad_CertificateUriInvalid. The usual source is a cloned VM image with the hostname changed. Symptoms and the order to chase them are in endpoint and ApplicationUri mismatch.

Certificates leave evidence only in the rejected list

A connection you waved through a trust dialog left no record. What did get recorded is the rejected-certificates store on both ends. Emptying it before commissioning and reading it afterwards is the cheapest check available.

Three codes are worth telling apart. Bad_CertificateUntrusted means it is not in the trust list, Bad_CertificateTimeInvalid is a validity-period problem, and Bad_SecurityChecksFailed is the server deciding not to tell you why. The third one cannot be solved from the client log — open the server log.

Pick the security policy from the OPC UA Part 7 profiles. Basic128Rsa15 and Basic256 are policies the OPC Foundation deprecated, so there is no reason to choose either on a new commissioning. Basic256Sha256 or better with SignAndEncrypt should be the default, and if some device forces None, write down the reason and the network controls around it.

Secure channel tokens have a lifetime. The OpenSecureChannel description in Part 4 advises renewing before 75% of it has elapsed. When a connection drops every few hours, look here first — clients that never renew still exist. Replacement procedure is in the certificate renewal checklist.

Quality is the top two bits, and there is a middle

StatusCode severity lives in the top two bits: 0x00000000 Good, 0x40000000 Uncertain, 0x80000000 Bad. The one to test is Uncertain, not Bad. HMIs that draw Uncertain in the same colour as Good are still common, and the result is a last-known value sitting there in green after comms are gone.

  • When a queue overflows the value still arrives, with an Overflow info bit set in the StatusCode. A client that drops that bit cannot see that it lost data. See monitored item queues.
  • TimestampsToReturn is Source=0, Server=1, Both=2, Neither=3. Decide which one the historian stores, and if it is Source, verify device clock sync in the same pass. Cases in StatusCode and SourceTimestamp.
  • maxAge on the Read service is in milliseconds, and 0 means "go to the device". Whether you get a cached value is decided right there.

Subscription tuning starts at three deadband values

Running every point at one second kills a small gateway first. Work back from what the process needs.

samplingInterval uses -1 for "follow the publishing interval" and 0 for "as fast as the server can". A handful of monitored items left at 0 by accident can account for most of the server load.

The DataChangeFilter deadbandType is None=0, Absolute=1, Percent=2. Percent requires the node to expose an EURange, and without it the server rejects the filter — raw tags coming up from a PLC hit this constantly. trigger is Status=0, StatusValue=1 (default), StatusValueTimestamp=2, and choosing 2 means a notification per timestamp even when the value is unchanged, which changes the historian sizing. For a level tag I would set Absolute in engineering units; it is easier to defend to operations later. Detail in DataChange filters and deadband.

Writes are decided by two bits

A node's AccessLevel carries CurrentRead in bit 0 and CurrentWrite in bit 1. UserAccessLevel shows the same bits for the user currently logged in, and the two differing is normal. When a write is refused, Bad_NotWritable versus Bad_UserAccessDenied separates a configuration problem from a permission problem. A historian-only account with CurrentWrite set is something commissioning should catch. More in UserAccessLevel and WriteMask.

A successful write response does not mean the process accepted the command. If the controller refuses on mode, interlock, permissive or local status, OPC UA still reports Good and the equipment does not move. Read feedback from the process value.

The one page to leave before handover

Record values, not item names. The five revised values, the endpoint URL as a string, the expiry dates of both certificates, the NodeIds and data types you mapped, and what the screen did when you pulled the comms. Any of those left blank and the next engineer commissions it again.

The next thing to look at is the server's own diagnostic nodes. Many servers expose sessions, subscriptions and rejected request counts under ServerDiagnostics in the Server object, and they often answer the question before the client log does.