Every OPC Item may have so-called properties that contain further information about the item. Example properties would be the access rights or a description of the item. These OPC properties are modeled as a specific Python object, called OPCProperty, which contains the following information:
Listing 6 shows in line 1 to 5 how to create and access a PyOPC property object.
language=C
The OPC XML-DA standard specifies various common properties, which should be preferred over custom properties, if possible. A full list of these available properties is given in [OPCXMLDA]. The alternative are custom properties that will often be in the namespace of PyOPC. Therefore the framework offers a simple shortcut in creating properties: if the property name is a string instead of a QName, PyOPC searches in a table for a matching OPC property. If one is found, the OPC XML-DA namespace is used, moreover the description is filled out automatically. If the property is unknown, the PyOPC namespace will automatically be used. This behavior is reflected in line 7 and 8 in listing 6.
Properties will be associated with items, therefore an ItemContainer object provides the following methods to add, delete and list properties: