Hello Forum,
I spent some time now to get a server running which just contains one variable. Because I wanted to understand which files the modeller creates and where I have to put my code to datalog my variable.
It worked quite good so far but I cannot get the SetupDataLogger() work properly because I am using the wrong pointer/ NodeId.
I tried to copy the NodeId to a global variable of type OpcUa_NodeId* using a modified GetNode() just after the CreateNode- Call:
GetNode_Screen.jpg
Code: Select all
...
/* MeineVariable, PropertyOf MeinBasisObjekt */
referenceTypeId.Identifier.Numeric = OpcUaId_HasProperty;
/****************************************************************************************/
/* The next node is created, which is a child of "MeinBasisObjekt". The type is
property type and so a simple variable. */
/****************************************************************************************/
UaServer_CreateNumericNodeIdEx(&parentNodeId, NurEinKnoten_Objects_MeinBasisObjekt, g_UaProviderNurEinKnoten_uNamespaceIndex1);
UaServer_GetNode(pAddressSpace,
&parentNodeId,
&pParent);
/* I tried to copy the Node to the global variable g_pMeineVariableNodeId */
UaServer_GetNode(pAddressSpace,
&parentNodeId,
&g_pMeineVariableNodeId);
UaServer_CreateNumericNodeIdEx(&nodeInfo.TypeDefinition, OpcUaId_PropertyType, 0);
...
This is the modified SetupDataLogger() which creates a folder "newhistorian" and a tagconfig.txt-file in the folder containing only "00000001"
Code: Select all
void NurEinKnoten_SetupDataLogger()
{
/* create file logger */
#if HAVE_DATA_LOGGER_FILE_BACKEND
g_hDataLogger = UaServer_FileLogger_Create( "newhistorian" );
#endif
if (g_hDataLogger < 0) return;
/* start historian data logging */
UaServer_DataLogger_Start( g_hDataLogger );
/* add MeineVariable to data logging */
UaProvider_Helper_HistorizeItem(&g_pMeineVariableNodeId);
}
#endif /* HAVE_DATA_LOGGER */
Modeller_Screen.jpg
The UAExpert looks like this:
Expert_Screen.jpg
I hope you can help me, thanks in advance!
By the way, my name´s Michael