WellKnownNodes (C)
C SDK opcua_node_id.h Utiliza UA_WELL_* macros (literales de NodeId cadena con el valor ns=0) para mejorar la legibilidad,SDK sustituyendo las cadenas escritas manualmente por macros. En el resto de nodos estándar que no se hayan sobrescrito, escribe directamente los literales.
Accesorios
- Véase la búsqueda inversa de espacios de nombres Namespaces.
- Para NodeId consultar los datos, véase Read / Write.
SDK Macros UA_WELL_* disponibles
/* opcua_node_id.h — Nodo OPC UA estándar (ns=0) */
/* Raíz */
#define UA_WELL_ROOT_FOLDER "i=84"
#define UA_WELL_OBJECTS_FOLDER "i=85"
#define UA_WELL_TYPES_FOLDER "i=86"
#define UA_WELL_VIEWS_FOLDER "i=87"
/* El propio servidor */
#define UA_WELL_SERVER "i=2253"
#define UA_WELL_SERVER_STATUS "i=2256"
/* ServerStatus Estructura */
#define UA_WELL_CURRENT_TIME "i=2258"
#define UA_WELL_SERVER_STATE "i=2259"
/* Norma ReferenceType */
#define UA_WELL_REFERENCES "i=31"
#define UA_WELL_HIERARCHICAL_REFERENCES "i=33"
#define UA_WELL_ORGANIZES "i=35"
#define UA_WELL_HAS_TYPE_DEFINITION "i=40"
#define UA_WELL_HAS_PROPERTY "i=46"
#define UA_WELL_HAS_COMPONENT "i=47"
Comparación de usos
/* No recomendado: codificación fija */
DarraUa_DataValue* dv = DarraUa_Session_ReadNode(
h, "i=2258", UA_ATTR_VALUE, &st);
/* Recomendación: utilizar macros */
#include <opcua_node_id.h>
DarraUa_DataValue* dv = DarraUa_Session_ReadNode(
h, UA_WELL_CURRENT_TIME, UA_ATTR_VALUE, &st);
ServerStatus Ejemplo de lectura completa
const char* nodes[] = {
UA_WELL_SERVER_STATE,
UA_WELL_CURRENT_TIME,
UA_WELL_SERVER_STATUS,
UA_WELL_SERVER,
};
DarraUa_DataValue* dvs[4] = { NULL };
DarraUa_Session_ReadNodes(h, nodes, NULL, 4, dvs);
for (int i = 0; i < 4; ++i) {
if (!dvs[i]) continue;
const DarraUa_Variant* v = DarraUa_DataValue_GetValue(dvs[i]);
printf("%-30s -> ", nodes[i]);
/* Formatear por tipo (omitido; véase el apartado Variant correspondiente) */
DarraUa_DataValue_Delete(dvs[i]);
}
Lista completa
Las líneas que incluyen UA_WELL_* son macros SDK proporcionadas por ; el resto son estándar OPC UA de NodeId, SDK no se han proporcionado macros, por lo que se escriben directamente como literales de cadena.
| Nodo | NodeId | Significado |
|---|---|---|
| Root | i=84 | UA_WELL_ROOT_FOLDER · Raíz del espacio de direcciones |
| Objects | i=85 | UA_WELL_OBJECTS_FOLDER · Base de datos operativa |
| Types | i=86 | UA_WELL_TYPES_FOLDER · Definición de tipo raíz |
| Views | i=87 | UA_WELL_VIEWS_FOLDER · Raíz de la vista |
| Server | i=2253 | UA_WELL_SERVER · El propio objeto «Server» |
| ServerStatus | i=2256 | UA_WELL_SERVER_STATUS · Estructura del estado del servidor |
| ServerStatus.State | i=2259 | UA_WELL_SERVER_STATE · Estado (Running / Failed / ...) |
| ServerStatus.CurrentTime | i=2258 | UA_WELL_CURRENT_TIME · Hora actual del servidor |
| References | i=31 | UA_WELL_REFERENCES · ReferenceType Raíz |
| HierarchicalReferences | i=33 | UA_WELL_HIERARCHICAL_REFERENCES · Raíz de las referencias jerárquicas |
| Organizes | i=35 | UA_WELL_ORGANIZES · ReferenceType |
| HasTypeDefinition | i=40 | UA_WELL_HAS_TYPE_DEFINITION · ReferenceType |
| HasProperty | i=46 | UA_WELL_HAS_PROPERTY · ReferenceType |
| HasComponent | i=47 | UA_WELL_HAS_COMPONENT · ReferenceType |
| ServerStatus.StartTime | i=2257 | SDK Sin macros · Tiempo de inicio del servidor |
| ServerStatus.BuildInfo | i=2260 | SDK Sin macros · Fabricante / Producto / Versión |
| ServerArray | i=2254 | SDK Sin macros · Matriz del servidor |
| NamespaceArray | i=2255 | SDK Sin macros · Matriz de espacios de nombres |
| HasSubtype | i=45 | SDK Constantes no incluidas · ReferenceType (escrito a mano "i=45") |
Completo OPC UA Norma NodeId Para más detalles, véase el Apéndice OPC UA Part 6 y las Opc.Ua.NodeIds.csv tablas proporcionadas OPC Foundation (válidas para todos los idiomas).