Glossary · Data

ArrayDimensions

In OPC UA, ArrayDimensions is an optional Variable attribute giving the length of each dimension of an array value. It has one entry per dimension declared by ValueRank, and an entry of zero means that dimension has no fixed length. It exists so a client can size buffers and validate writes before sending them.

Shape, not content

ArrayDimensions describes the declared shape of the variable, which is not necessarily the length of the value you get back right now. A node with ArrayDimensions of zero is a variable-length array and the actual length can change between reads. A node with ArrayDimensions of 8 is fixed at eight elements, and a server is entitled to reject a Write of any other length. The attribute is only meaningful when ValueRank is zero or positive; on a scalar it is absent.

Multidimensional arrays on the wire

A matrix travels inside a Variant as a flat array plus a Dimensions field, in row-major order. ArrayDimensions on the node tells you how to interpret that flattening before you ever read a value, which matters for image and profile data where a mistaken row and column order produces plausible-looking nonsense rather than an error. Confirm the order against the vendor's model rather than assuming.

Using it with IndexRange

The main practical use is bounding IndexRange requests. If ArrayDimensions is 1000 and you only need the last ten elements, request an IndexRange of 990:999 instead of reading the whole array on every cycle. Requesting a range beyond the declared or actual bounds gives BadIndexRangeNoData, or BadIndexRangeInvalid when the syntax or dimension count does not match the node.

The mistake people make: Sizing a client buffer from ArrayDimensions and never re-checking. When the entry is zero the array is variable-length, and a server that grows it - a rolling trend buffer or an alarm list - will overrun a fixed allocation or silently truncate.

Defined in: Part 3 - Address Space Model, Variable attributes.

Last verified 7 September 2026 against OPC UA 1.05.07. OPC UA Connect is an educational resource and is not affiliated with the OPC Foundation.

Free download
OPC UA Server Acceptance Test Pack
A 40-check acceptance test you run against a vendor's server before commissioning sign-off. Weighted scoring, three hard gates, and a one-page verdict for the supplier meeting.
Get the free test pack →
Free, no course, no login