Errata exists for this version of the document.
These examples provide fairly simple content filters. Filter similar to these examples may be used in processing events.
The following conventions apply to these examples with regard to how Attribute operands are used (for a definition of this operand see 7.4.4):
- AttributeOperand: Refers to a Node, an Attribute of a Node or the Value Attribute of a Property associated with a Node. In the examples, the character names of NodeIds are used instead of an actual nodeId, this also applies to Attribute Ids.
- The string representation of relative paths is used instead of the actual structure.
- The NamespaceIndex used in all examples is 12 (it could just as easily have been 4 or 23 or any value). For more information about NamespaceIndex, see OPC 10000-3. The use of the NamespaceIndex illustrates that the information model being used in the examples is not a model defined by this standard, but one created for the examples.
For example the logic describe by ‘(((AType.A = 5) or InList(BType.B, 3,5,7)) and BaseObjectType.displayName LIKE “Main%”)’ would result in a logic tree as shown in Figure B.1 and a ContentFilter as shown in Table B.1. For this example to return anything AType and BType both must be subtypes of BaseObjectType, or the resulting “And” operation would always be false.
Figure B.1 – Filter Logic Tree Example
Table B.1 describes the elements, operators and operands used in the example.
Table B.1 – ContentFilter Example
Element[] |
Operator |
Operand[0] |
Operand[1] |
Operand[2] |
Operand[3] |
0 |
And |
ElementOperand = 1 |
Element Operand = 4 |
|
|
1 |
Or |
ElementOperand = 2 |
Element Operand = 3 |
|
|
2 |
Equals |
AttributeOperand = NodeId: AType, BrowsePath: “.12:A”, Attribute:value |
LiteralOperand = ‘5’ |
|
|
3 |
InList |
AttributeOperand = NodeId: BType, BrowsePath: “.12:B”, Attribute:value |
LiteralOperand = ‘3’ |
LiteralOperand = ‘5’ |
LiteralOperand = ‘7’ |
4 |
Like |
AttributeOperand = NodeId: BaseObjectType, BrowsePath: “.”, Attribute: displayName |
LiteralOperand = “Main%” |
|
|
As another example a filter to select all SystemEvents (including derived types) that are contained in the Area1 View or the Area2 View would result in a logic tree as shown in Figure B.2 and a ContentFilter as shown in Table B.2.
Figure B.2 – Filter Logic Tree Example
Table B.2 describes the elements, operators and operands used in the example.
Table B.2 – ContentFilter Example
Element[] |
Operator |
Operand[0] |
Operand[1] |
0 |
And |
ElementOperand = 1 |
ElementOperand = 4 |
1 |
Or |
ElementOperand = 2 |
ElementOperand = 3 |
2 |
InView |
AttributeOperand = NodeId: Area1, BrowsePath: ".", Attribute: NodeId |
|
3 |
InView |
AttributeOperand = NodeId: Area2, BrowsePath: ".", Attribute: NodeId |
|
4 |
OfType |
AttributeOperand = NodeId: SystemEventType, Brow"sePath: ".", Attribute: NodeId” |
|