IndexRange
In OPC UA, IndexRange is a string parameter on Read, Write and CreateMonitoredItems that selects part of an array value instead of the whole thing. A single index is written as 4, a span as 1:5, and one range per dimension separated by commas addresses a matrix, as in 0:2,1:3.
Syntax and semantics
The range is inclusive at both ends and zero-based, so 1:5 returns five elements. A bare index such as 4 returns that one element. For a multidimensional value you supply one range per dimension, comma separated, matching the node's ValueRank. An empty or absent IndexRange means the entire value. The parameter is also valid on ByteString and String values, where it selects a byte or character range.
Why it is worth using
Large arrays are a common performance problem: a 10000-element trend buffer or a camera line profile read in full on every publishing cycle dominates the traffic. IndexRange lets a subscription monitor only the elements that matter, and lets a client page through a big array in chunks. On Write it enables a partial update, writing three elements of a recipe array without read-modify-write of the whole thing, which also avoids clobbering concurrent changes.
Errors and server support
Two errors distinguish the failure modes. BadIndexRangeInvalid means the string itself is malformed or its dimension count does not match the node. BadIndexRangeNoData means the syntax was fine but the requested elements do not exist in the current value, typically because a variable-length array is shorter than you assumed. Support for partial writes is patchier than support for partial reads, and some servers reject a ranged write with BadWriteNotSupported or require the WriteFullArrayOnly behaviour indicated in AccessLevelEx.
Example
IndexRange forms and what each selects
"" -> the whole value
"4" -> element 4 only (zero-based)
"1:5" -> elements 1,2,3,4,5 (inclusive)
"0:2,1:3" -> rows 0..2, columns 1..3 of a 2-dimensional value
BadIndexRangeInvalid : malformed, or wrong number of dimensions
BadIndexRangeNoData : valid syntax, but those elements are not present
Defined in: Part 4 - Services, NumericRange.
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.