AE Refresh behaviour|Classic OPC: DA, A&E, HDA, XML-DA, etc.|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
AE Refresh behaviour
Avatar
Siyuan Xu
Member
Members
Forum Posts: 8
Member Since:
06/29/2023
sp_UserOfflineSmall Offline
1
09/20/2024 - 01:24
sp_Permalink sp_Print

Hello, could you help me to understand the Refresh() process when there were not any active nor unacknowledged condition on AE server?
Should the AE server send an empty list of EventNotifications with Refresh and LastRefresh flags true?

I get some mixed result with a customer’s server. The server sometimes send nothing, and sometimes send empty pEvents to  OpcCom.Ae.Subscription.OnEvent(

int hClientSubscription,
int bRefresh,
int bLastRefresh,
int dwCount,
OpcRcw.Ae.ONEVENTSTRUCT[] pEvents)

which will cause exception:

System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=OpcNetApi.Com
StackTrace:
at OpcCom.Ae.Subscription.Callback.OnEvent(Int32 hClientSubscription, Int32 bRefresh, Int32 bLastRefresh, Int32 dwCount, ONEVENTSTRUCT[] pEvents) in xxxxxxxxxx\NetCore\OpcNetApi.Com\Ae\OpcCom.Ae.Subscription.cs:line 523

This exception was originally thrown at this call stack:
OpcCom.Ae.Subscription.Callback.OnEvent(int, int, int, int, OpcRcw.Ae.ONEVENTSTRUCT[]) in OpcCom.Ae.Subscription.cs

Avatar
Randy Armstrong
Admin
Forum Posts: 1578
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
09/20/2024 - 07:26
sp_Permalink sp_Print

Do you have the code for the NET API?

Avatar
Siyuan Xu
Member
Members
Forum Posts: 8
Member Since:
06/29/2023
sp_UserOfflineSmall Offline
3
09/22/2024 - 23:49
sp_Permalink sp_Print

Yes, as member of OPC Foundation, I do have the access to the NET API source code. Is OPC AE server expected always reply on Refresh() even if there were not any active nor unacked conditions? What would recommend? I am not sure am I allowed to put any source code here though.

Avatar
Randy Armstrong
Admin
Forum Posts: 1578
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
09/23/2024 - 00:03
sp_Permalink sp_Print

The issue is the null pointer exception should not occur. The code should check dwCount and if zero it should not access pEvents.

If you fix the null pointer exception in your copy of the code we can see if the issue goes away.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 21
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1444
Posts: 4887