This Structured DataType is used to provide the metadata for a field of a BitFieldType VariableType. The BitFieldDefinition is formally defined in Table 299.
Table 299 – BitFieldDefinition Structure
Name |
Type |
Description |
BitFieldDefinition |
Structure |
|
Name |
String |
A name for the field that is unique within the BitFieldDefinition. |
Description |
LocalizedText |
A localized description of the field. |
Reserved |
Boolean |
True if the range of bits is reserved for future use by the defining Namespace. |
StartingBitPosition |
UInt32 |
The bit position of the first bit used by this field. |
EndingBitPosition |
UInt32 |
The 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 300.
Table 300 – BitFieldDefinition definition
Attributes |
Value |
||||
BrowseName |
BitFieldDefinition |
||||
IsAbstract |
FALSE |
||||
References |
NodeClass |
BrowseName |
DataType |
TypeDefinition |
ModellingRule |
Conformance Units |
|||||
|
The following example is intended to illustrate the use of the BitFieldType VariableType. In this example the MyBitFieldType, defined in Table 301 and Table 302, 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 303 and Table 304. The three bits which are not defined can be utilized by SubTypes defined in any Namespace.
Table 301 – MyBitFieldType VariableType Example
Attribute |
Value |
|||||
BrowseName |
MyBitFieldType |
|||||
IsAbstract |
False |
|||||
ValueRank |
−1 (−1 = Scalar) |
|||||
DataType |
UInt16 |
|||||
References |
NodeClass |
BrowseName |
DataType |
TypeDefinition |
MR |
|
Subtype of the BitFieldType defined in 7.29 |
||||||
HasProperty |
Variable |
MyBitFieldDefinitions |
BitFieldDefinition[] |
PropertyType |
M |
|
HasComponent |
Variable |
Counter |
Int16 |
BaseDataVariableType |
M |
|
HasComponent |
Variable |
Enabled |
Boolean |
BaseDataVariableType |
M |
|
HasComponent |
Variable |
Status |
Boolean |
BaseDataVariableType |
M |
Table 302 – MyBitFieldDefinitions BitFieldDefinition Example
Name |
Description |
Reserved |
StartingBit Position |
EndingBitPosition |
Counter |
A 6-bit counter representing a signed integer value. As a signed integer the 6th bit (position 5) is the sign bit. |
N |
0 |
5 |
MyReservedBit |
A single bit reserved for future extension |
Y |
6 |
6 |
Enabled |
A single bit representing a Boolean enable value |
N |
7 |
7 |
Status |
A single bit representing a Boolean status value |
N |
8 |
8 |
MyReserveBlock |
A range of 4 reserved bits for future extension |
Y |
12 |
15 |
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 303 – MyBitFieldSubType VariableType Example
Attribute |
Value |
|||||
BrowseName |
MyBitFieldSubType |
|||||
IsAbstract |
False |
|||||
ValueRank |
−1 (−1 = Scalar) |
|||||
DataType |
UInt16 |
|||||
References |
NodeClass |
BrowseName |
DataType |
TypeDefinition |
MR |
|
Subtype of the MyBitFieldType defined in Table 301 |
||||||
HasProperty |
Variable |
MyBitFieldSubDefinitions |
BitFieldDefinition[] |
PropertyType |
M |
|
HasComponent |
Variable |
SubStatus |
Boolean |
BaseDataVariableType |
M |
Table 304 – MyBitFieldSubDefinitions BitFieldDefinition Example
Name |
Description |
Reserved |
StartingBit Position |
EndingBitPosition |
Counter |
A 6-bit counter representing a signed integer value. As a signed integer the 6th bit (position 5) is the sign bit. |
N |
0 |
5 |
SubStatus |
A single bit representing a Boolean substatus. This field is utilizing the MyReservedBit reserved bit defined in the parent Type |
N |
6 |
6 |
Enabled |
A single bit representing a Boolean enable value |
N |
7 |
7 |
Status |
A single bit representing a Boolean status value |
N |
8 |
8 |
MyReserveBlock |
A range of 4 reserved bits for future extension |
Y |
12 |
15 |
The following is another BitFieldType VariableType example intended to illustrate the use of an Array DataType. In this example the MyBitFieldArrayType, defined in Table 305 and Table 306, 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 305 – MyBitFieldArrayType VariableType Example
Attribute |
Value |
|||||
BrowseName |
MyBitFieldArrayType |
|||||
IsAbstract |
False |
|||||
ValueRank |
1 (1 = Array) |
|||||
DataType |
UInt16[] |
|||||
References |
NodeClass |
BrowseName |
DataType |
TypeDefinition |
MR |
|
Subtype of the BitFieldType defined in defined 7.29 |
||||||
HasProperty |
Variable |
MyBitFieldArrayDefinitions |
BitFieldDefinition[] |
PropertyType |
M |
|
HasComponent |
Variable |
Counter |
Int32 |
BaseDataVariableType |
M |
|
HasComponent |
Variable |
Enabled |
Boolean |
BaseDataVariableType |
M |
Table 306 – MyBitFieldArrayDefinitions BitFieldDefinition Example
Name |
Description |
Reserved |
StartingBit Position |
EndingBitPosition |
Counter |
A 24-bit counter representing a signed integer value. As a signed integer the 24th bit (position 23) is the sign bit. |
N |
0 |
23 |
MyReservedBit |
A single bit reserved for future extension |
Y |
24 |
24 |
Enabled |
A single bit representing a Boolean enable value |
N |
25 |
25 |
Figure 12 – MyBitFieldArrayType Example Illustration