12.45 BitFieldDefinition

This Structured DataType is used to provide the metadata for a field of a BitFieldType VariableType. The BitFieldDefinition is formally defined in Table 308.

Table 308 – BitFieldDefinition Structure
NameTypeDescription
BitFieldDefinitionStructure

Name

StringA name for the field that is unique within the BitFieldDefinition.

Description

LocalizedTextA localized description of the field.

Reserved

BooleanTrue if the range of bits is reserved for future use by the defining Namespace.

StartingBitPosition

UInt32The bit position of the first bit used by this field.

EndingBitPosition

UInt32The bit position of the last bit used by this field.

When Reserved is set to True, it indicates that the bitfield shall only be defined by a Subtype of a BitFieldType defined in the same Namespace. Bits not defined or reserved in the BitFieldType may be used by a Subtype which is defined in any Namespace. A Subtype of a BitFieldType shall include, in its BitFieldDefinition all the field definitions of the parent Type. A Subtype of a BitFieldType shall not reallocate bits defined in the parent Type unless they are Reserved. A Reserved field can be refined by a SubType of a BitFieldType however it shall not include any more bits than the parent. In a Subtype of a BitFieldType, a Reserved field may be broken into more than one field if the overall number of bits remain the same as the parent. The Name and Description of a Reserved field may be changed by a Subtype of a BitFieldType.

The StartingBitPosition field shall be equal to or less than the EndingBitPosition field. The StartingBitPosition and EndingBitPosition fields shall be defined as zero being the least significate bit and increasing to most significate. When the BitFieldType is an array the bit numbering begins with the least significate bit of the first element of the array and ends with the most significate bit of the last element of the array.

The DataType of the field is defined by the DataType of the BitFieldType’s child DataVariable for the field. When the DataType of the field is an Integer the most significate bit of the field shall be the sign bit.

Its representation in the AddressSpace is defined in Table 309.

Table 309 – BitFieldDefinition definition
Attributes Value
BrowseNameBitFieldDefinition
IsAbstractFALSE
References NodeClass BrowseName DataType TypeDefinition ModellingRule
Subtype of the Structure DataType defined in 12.2.12.
Conformance Units

The following example is intended to illustrate the use of the BitFieldType VariableType. In this example the MyBitFieldType, defined in Table 310 and Table 311, consists of three defined fields, a reserved bit, a reserved range of bits and three bits which are not defined. The reserved fields can be used by SubTypes that are defined within the same Namespace as the MyBitFieldType VariableType. Figure 11 illustrates how the fields are extracted from the example BitFieldType. An example of a SubType utilizing the reserved bit is the MyBitFieldSubType defined in Table 312 and Table 313. The three bits which are not defined can be utilized by SubTypes defined in any Namespace.

Table 310 – MyBitFieldType VariableType Example
Attribute Value
BrowseNameMyBitFieldType
IsAbstractFalse
ValueRank−1 (−1 = Scalar)
DataTypeUInt16
References NodeClass BrowseName DataType TypeDefinition MR
Subtype of the BitFieldType defined in 7.29
HasPropertyVariableMyBitFieldDefinitionsBitFieldDefinition[]PropertyTypeM
HasComponentVariableCounterInt16BaseDataVariableTypeM
HasComponentVariableEnabledBooleanBaseDataVariableTypeM
HasComponentVariableStatusBooleanBaseDataVariableTypeM
Table 311 – MyBitFieldDefinitions BitFieldDefinition Example
Name Description Reserved

StartingBit

Position

EndingBitPosition
CounterA 6-bit counter representing a signed integer value. As a signed integer the 6th bit (position 5) is the sign bit.N05
MyReservedBitA single bit reserved for future extensionY66
EnabledA single bit representing a Boolean enable valueN77
StatusA single bit representing a Boolean status valueN88
MyReserveBlockA range of 4 reserved bits for future extensionY1215

Note: Bits 9 to 11 are not defined in this example and therefore available to be used by any SubType in any Namespace.

Figure 11 – MyBitFieldType Example Illustration
Table 312 – MyBitFieldSubType VariableType Example
Attribute Value
BrowseNameMyBitFieldSubType
IsAbstractFalse
ValueRank−1 (−1 = Scalar)
DataTypeUInt16
References NodeClass BrowseName DataType TypeDefinition MR
Subtype of the MyBitFieldType defined in Table 310
HasPropertyVariableMyBitFieldSubDefinitionsBitFieldDefinition[]PropertyTypeM
HasComponentVariableSubStatusBooleanBaseDataVariableTypeM
Table 313 – MyBitFieldSubDefinitions BitFieldDefinition Example
Name Description Reserved

StartingBit

Position

EndingBitPosition
CounterA 6-bit counter representing a signed integer value. As a signed integer the 6th bit (position 5) is the sign bit.N05
SubStatusA single bit representing a Boolean substatus. This field is utilizing the MyReservedBit reserved bit defined in the parent TypeN66
EnabledA single bit representing a Boolean enable valueN77
StatusA single bit representing a Boolean status valueN88
MyReserveBlockA range of 4 reserved bits for future extensionY1215

The following is another BitFieldType VariableType example intended to illustrate the use of an Array DataType. In this example the MyBitFieldArrayType, defined in Table 314 and Table 315, uses a UInt16 array and consists of two defined fields, and a reserved bit. The reserved bit can be used by SubTypes that are defined within the same Namespace as the MyBitFieldArrayType VariableType.The example illustrates how the StartBitPosition and EndingBitPosition are used with Array DataTypes. The first element of the array identified as bit positions 0 to 15 represent the lower 16 bits of the Counter. The second element of the array represents the upper 8 bits of the Counter. Figure 12 illustrates how the fields are extracted from the example BitFieldType.

Table 314 – MyBitFieldArrayType VariableType Example
Attribute Value
BrowseNameMyBitFieldArrayType
IsAbstractFalse
ValueRank1 (1 = Array)
DataTypeUInt16[]
References NodeClass BrowseName DataType TypeDefinition MR
Subtype of the BitFieldType defined in defined 7.29
HasPropertyVariableMyBitFieldArrayDefinitionsBitFieldDefinition[]PropertyTypeM
HasComponentVariableCounterInt32BaseDataVariableTypeM
HasComponentVariableEnabledBooleanBaseDataVariableTypeM
Table 315 – MyBitFieldArrayDefinitions BitFieldDefinition Example
Name Description Reserved

StartingBit

Position

EndingBitPosition
CounterA 24-bit counter representing a signed integer value. As a signed integer the 24th bit (position 23) is the sign bit.N023
MyReservedBitA single bit reserved for future extensionY2424
EnabledA single bit representing a Boolean enable valueN2525
Figure 12 – MyBitFieldArrayType Example Illustration