I have the following node: "Root->node->DataSet1->Int32" and I would like to read the value inside "int32". what should I add in the main function to read the value?
this how the node is created:
Code: Select all
void createDataSet1TargetVariables(NodeManagerConfig* pNM, OpcUa::FolderType* pParentFolder, UaMutexRefCounted* pSharedMutex)
{
UaVariant defaultValue;
OpcUa::BaseDataVariableType* pVariable = NULL;
OpcUa_UInt16 nsIndx = pNM->getNameSpaceIndex();
OpcUa_Byte accessLevel = OpcUa_AccessLevels_CurrentReadOrWrite;
UaStatus addResult;
UaString sParentNodeId = pParentFolder->nodeId().toString();
UaString sName;
UaString sNodeId;
sName = "Int32";
defaultValue.setInt32(0);
sNodeId = UaString("%1.%2").arg(sParentNodeId).arg(sName);
pVariable = new OpcUa::BaseDataVariableType(UaNodeId(sNodeId, nsIndx), sName, nsIndx, defaultValue, accessLevel, pNM, pSharedMutex);
addResult = pNM->addNodeAndReference(pParentFolder, pVariable, OpcUaId_Organizes);
if (addResult.isBad()) { pVariable->releaseReference(); return; }
}
Code: Select all
UaStatus NodeManagerDemo::readValues(const UaVariableArray& arrUaVariables, UaDataValueArray& arrDataValues)
Best,