Saltar al contenido principal

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.

NodoNodeIdSignificado
Rooti=84UA_WELL_ROOT_FOLDER · Raíz del espacio de direcciones
Objectsi=85UA_WELL_OBJECTS_FOLDER · Base de datos operativa
Typesi=86UA_WELL_TYPES_FOLDER · Definición de tipo raíz
Viewsi=87UA_WELL_VIEWS_FOLDER · Raíz de la vista
Serveri=2253UA_WELL_SERVER · El propio objeto «Server»
ServerStatusi=2256UA_WELL_SERVER_STATUS · Estructura del estado del servidor
ServerStatus.Statei=2259UA_WELL_SERVER_STATE · Estado (Running / Failed / ...)
ServerStatus.CurrentTimei=2258UA_WELL_CURRENT_TIME · Hora actual del servidor
Referencesi=31UA_WELL_REFERENCES · ReferenceType Raíz
HierarchicalReferencesi=33UA_WELL_HIERARCHICAL_REFERENCES · Raíz de las referencias jerárquicas
Organizesi=35UA_WELL_ORGANIZES · ReferenceType
HasTypeDefinitioni=40UA_WELL_HAS_TYPE_DEFINITION · ReferenceType
HasPropertyi=46UA_WELL_HAS_PROPERTY · ReferenceType
HasComponenti=47UA_WELL_HAS_COMPONENT · ReferenceType
ServerStatus.StartTimei=2257SDK Sin macros · Tiempo de inicio del servidor
ServerStatus.BuildInfoi=2260SDK Sin macros · Fabricante / Producto / Versión
ServerArrayi=2254SDK Sin macros · Matriz del servidor
NamespaceArrayi=2255SDK Sin macros · Matriz de espacios de nombres
HasSubtypei=45SDK 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).

Siguiente paso​