有人能告诉我的语法吗?多节点在单一请求中读取到open62541中的服务器。
我一直在执行UA_Client_readValueAttribute(client, UA_NODEID_STRING(1, "variable"), &value)从open62541客户端到服务器的单个读取请求。
发布于 2017-12-01 21:49:34
您可以使用标准读取服务:
UA_Client_Service_read(UA_Client *client, const UA_ReadRequest request)请参阅:client.h#L203
例如:
UA_ReadRequest request;
UA_ReadRequest_init(&request);
UA_ReadValueId ids[2];
UA_ReadValueId_init(&ids[0]);
ids[0].attributeId = UA_ATTRIBUTEID_VALUE;
ids[0].nodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_NAMESPACEARRAY);
UA_ReadValueId_init(&ids[1]);
ids[1].attributeId = UA_ATTRIBUTEID_VALUE;
ids[1].nodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER_STATUS);
// set here the nodes you want to read
request.nodesToRead = ids;
request.nodesToReadSize = 2;
UA_ReadResponse response = UA_Client_Service_read(client, request);
// do something with the responseCrosspost:https://github.com/open62541/open62541/issues/1426
https://stackoverflow.com/questions/47591339
复制相似问题