pyuaf.util.opcuaidentifiers
¶
This module contains a very long list of (more than 5000!) numerical identifiers, as defined by the OPC UA standard.
This list is not shipped with the UAF, it is generated from the stack include files.
The list is way too long to document here, so you are referred to the OPC UA specification documents.
All identifiers start with an OpcUaId_
prefix.
Here are some examples:
opcuaidentifiers.
OpcUaId_BaseDataType
= 24¶
opcuaidentifiers.
OpcUaId_Number
= 26¶
opcuaidentifiers.
OpcUaId_Integer
= 27¶
opcuaidentifiers.
OpcUaId_UInt32
= 7¶
opcuaidentifiers.
OpcUaId_VariableTypeNode
= 270¶
opcuaidentifiers.
OpcUaId_EUInformation
= 887¶
opcuaidentifiers.
OpcUaId_ConditionType_Disable
= 9028¶
opcuaidentifiers.
OpcUaId_ExclusiveDeviationAlarmType
= 9764¶
opcuaidentifiers.
OpcUaId_RootFolder
= 84¶
opcuaidentifiers.
OpcUaId_ObjectsFolder
= 85¶
opcuaidentifiers.
OpcUaId_TypesFolder
= 86¶
opcuaidentifiers.
OpcUaId_ViewsFolder
= 87¶
opcuaidentifiers.
OpcUaId_ServerType_VendorServerInfo
= 2011¶
opcuaidentifiers.
OpcUaId_Server_NamespaceArray
= 2255¶
opcuaidentifiers.
OpcUaId_Server_ServerArray
= 2254¶
And here’s a little script you can use to print all identifiers to the standard out (“stdout”, e.g. the Windows DOS Prompt or the Linux shell) or write them to a file:
# examples/pyuaf/util/how_to_print_all_opcua_identifiers.py """ Example: how to print all OPC UA identifiers ==================================================================================================== """ import pyuaf # create a list that will contain tuples of (<identifierName>, <numericIdentifier>) # such as ('OpcUaId_ObjectsFolder', 85) identifierItems = [] # add all identifier items from the module to the list for item in pyuaf.util.opcuaidentifiers.__dict__.items(): if isinstance(item[1], int) and item[0][0] != '_': identifierItems.append(item) # sort the list identifierItems = sorted(identifierItems, key=lambda x: x[1]) # modify these flags to instruct the script to print the items to # the screen and/or to write them to a file: printToScreen = True writeToFile = False # print the items to the screen if necessary if printToScreen: for item in identifierItems: print("%s %d" %item) # write the items to a file if necessary if writeToFile: f = open('opcuaidentifiers.txt', 'w') for item in identifierItems: f.write("%s %d\n" %item) f.close()