This abstract DataTypeis the base DataTypefor all DataTypesrepresenting a bit mask which is larger than 64 bits or where the validity of the bits within the set are to be identified. All OptionSet DataTypesrepresenting bit masks shall inherit from this DataType. Its elements are described in Table 31.

Table 31– OptionSet Definition

Name

Type

Description

OptionSet

structure

Value

ByteString

Array of bytes representing the bits in the option set. The length of the ByteStringdepends on the number of bits. The number of bytes may be larger than needed for the valid bits in the case of a spare allocation.

ValidBits

ByteString

Array of bytes shall be the same size as value representing the valid bits in the value parameter. A Servershall return the StateCode BadOutOfRangeif it receives a different array size.

When the Serverreturns the value to the Client, the validBitsprovides information of which bits in the bit mask have a meaning. If a bit is 1 then the corresponding bit in the value is used by the Server. If it is set to a 0 it should be ignored as it has no meaning. When the Clientpasses the OptionSetvalue to the Server, it sets the bits of validBits to 1 for each bit the Clientexpects the Serverto apply to the value. The Servershall use the following logic when applying the requested change “new value = (value & validBits) | (current value & ~validBits)”.

A Servershall return the StateCode BadOutOfRangeif it receives validBits with a bit set to 1 which it does not consider a valid bit and shall not apply any bit changes.

The DataType Nodesrepresenting concrete subtypes of the OptionSetshall have an OptionSetValues Propertydefined in Table 16.

An OptionSetmay be subtyped, however, any subtype shall not add any fields to the OptionSet Structure. The subtype may refine the semantics for the bits which are defined by the supertype and may add additional bits if the length of the OptionSetis not exceeded (see next paragraph). That requires, that each entry of the OptionSetValues Property of the supertype is repeated or refined by each subtype. Refining a bit shall not invalidate the original semantic. New OptionSetValues Properties may also be added to the subtype. For example, changing a bit from “Pump is off” to “First Pump is off” is allowed, but changing it to “Motor is on” is not allowed.

The DataType Nodesrepresenting concrete or abstract subtypes of the OptionSetmay have an OptionSetLength Propertydefined in Table 16. This Propertydefines the length in bytes of the OptionSet. If the Propertyis not defined, the length of a concrete OptionSetis defined by the number of defined bits (in the OptionSetValues Property) rounded up to whole bytes. For example, if there are two bits defined the length is one byte, if there are 10 bits defined, the length is two bytes. Once, the length has been defined by an OptionSet, subtypes shall not change the length. That is, if a supertype defines the length (either explicitly with OptionSetLengthor implicitly by a concrete OptionSetwith the OptionSetValues) each subtype shall have the same length. If the correct length is not implicitly provided by the length of the OptionSetValuesthe subtype shall provide the OptionSetLength Propertywith the same value as the supertype.

Defining the length explicitly in the OptionSetLength Propertyallows to reserve bits that can be used in subtypes of the OptionSet.