Alarms & CallAsync
Posted: 04 Aug 2014, 13:49
Hello,
When trying to ACK or confirm an alarm from UaExpert panel, CallAsync function is called. The code obtained from UaModeler is this:
What is the difference between both switches? I mean, the defference between UaProvider_Test_AcknowledgeableConditionType_CallAcknowledge and UaProvider_Test_CallAcknowledge and so.
Where is suposed to be stored the message introduced when ack/confirm of alarms in UaExpert? I am not able to view it.
Thanks in advance.
Best regards.
When trying to ACK or confirm an alarm from UaExpert panel, CallAsync function is called. The code obtained from UaModeler is this:
Code: Select all
for (i = 0; i < pRequest->NoOfMethodsToCall; i++)
{
if (pRequest->MethodsToCall[i].MethodId.NamespaceIndex == g_UaProviderTest_uNamespaceIndex1)
{
pMethodId = &(pRequest->MethodsToCall[i].MethodId);
if (pMethodId->IdentifierType == OpcUa_IdentifierType_Numeric)
{
switch (pMethodId->Identifier.Numeric)
{
case Test_Objects_Alarms_1_AddComment:
UaProvider_Test_ConditionType_CallAddComment(a_pCallContext, &pRequest->MethodsToCall[i], &pResponse->Results[i]);
break;
case Test_Objects_Alarms_1_Disable:
UaProvider_Test_ConditionType_CallDisable(a_pCallContext, &pRequest->MethodsToCall[i], &pResponse->Results[i]);
break;
case Test_Objects_Alarms_1_Enable:
UaProvider_Test_ConditionType_CallEnable(a_pCallContext, &pRequest->MethodsToCall[i], &pResponse->Results[i]);
break;
case Test_Objects_Alarms_1_Acknowledge:
UaProvider_Test_AcknowledgeableConditionType_CallAcknowledge(a_pCallContext, &pRequest->MethodsToCall[i], &pResponse->Results[i]);
break;
default:
break;
}
}
else if (pMethodId->IdentifierType == OpcUa_IdentifierType_String)
{
}
}
#if UASERVER_SUPPORT_EVENTS
else if (pRequest->MethodsToCall[i].ObjectId.NamespaceIndex == g_UaProviderTest_uNamespaceIndex1
&& pRequest->MethodsToCall[i].MethodId.NamespaceIndex == 0
&& pRequest->MethodsToCall[i].MethodId.IdentifierType == OpcUa_IdentifierType_Numeric)
{
switch (pRequest->MethodsToCall[i].MethodId.Identifier.Numeric)
{
case OpcUaId_AcknowledgeableConditionType_Acknowledge:
{
UaServer_Event *pEvent = UaServer_Events_GetConditionByNodeId(g_UaProviderTest_uNamespaceIndex1,
&pRequest->MethodsToCall[i].ObjectId);
if (pEvent != OpcUa_Null)
{
UaProvider_Test_CallAcknowledge(pEvent, &pRequest->MethodsToCall[i], &pResponse->Results[i]);
}
break;
}
case OpcUaId_AcknowledgeableConditionType_Confirm:
{
UaServer_Event *pEvent = UaServer_Events_GetConditionByNodeId(g_UaProviderTest_uNamespaceIndex1,
&pRequest->MethodsToCall[i].ObjectId);
if (pEvent != OpcUa_Null)
{
UaProvider_Test_CallConfirm(pEvent, &pRequest->MethodsToCall[i], &pResponse->Results[i]);
}
break;
}
case OpcUaId_ConditionType_AddComment:
{
UaServer_Event *pEvent = UaServer_Events_GetConditionByNodeId(g_UaProviderTest_uNamespaceIndex1,
&pRequest->MethodsToCall[i].ObjectId);
if (pEvent != OpcUa_Null)
{
UaProvider_Test_CallAddComment(pEvent, &pRequest->MethodsToCall[i], &pResponse->Results[i]);
}
break;
}
default:
break;
}
}
}
Where is suposed to be stored the message introduced when ack/confirm of alarms in UaExpert? I am not able to view it.
Thanks in advance.
Best regards.