Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
TUaClient: multiple issues
October 13, 2023
11:02, EEST
Avatar
Guido Niewerth
Member
Members
Forum Posts: 13
Member Since:
August 23, 2022
sp_UserOfflineSmall Offline

Hello,

I’m running a stress test with the public OPC Foundation OPC/UA server (“opc.tcp://opcua.demo-this.com:51210/UA/SampleServer”, item “ns=2;i=10847”) and I’m running into multiple issues. I chose the public OPC/UA server, because it automatically disconnects/creates timeouts after a while, so I can check the client behaviour for those cases.

Test environment:
Windows 11 64bit
RAD Studio Alexandria 11.2
Prosys Sentrol OPC UA SDK 7.6.0 for Alexandria 11.x

OPC/UA server + item
opc.tcp://opcua.demo-this.com:51210/UA/SampleServer
ns=2;i=10847

1) I don’t receive OnDataChanged events for a 2nd subscription. Everything’s fine when I create the 1st subscription with one TUaMonitoredItem, but when I remove the subscription and create it again with the same parameters, there are no OnDataChanged events for the monitored item. When I explicitely call Reconnect() on the TUaClient I receive OnDataChanged events for the monitored item.

void __fastcall TForm1::OnClickButtonSubscribe( TObject* Sender )
{
if( UaClient->Connected && UaClient->SubscriptionCount == 0 )
{
TUaNamespace* srv_namespace = UaClient->NamespaceTable->Namespaces[2];
TUaNodeId node_id = TUaNodeId::Create( srv_namespace, 10847 );

// simulate 2 subscriptions, create and remove the 1st immediately, create the 2nd.
for( int i = 0; i operator _di_IUaSubscription();

TUaMonitoredDataItem* monitor = new TUaMonitoredDataItem( node_id );
_di_IUaMonitoredDataItem monitor_intf = monitor->operator _di_IUaMonitoredDataItem();
monitor_intf->OnDataChange = OnDataChanged;

sub_intf->AddItem( monitor_intf );
UaClient->AddSubscription( sub_intf );

// remove subscription after 1st pass
if( i == 0 )
{
UaClient->RemoveSubscription( UaClient->Subscriptions[0] );
}
}
// OnDataChanged events are generated for 2nd subscription when the client reconnects.
// When commented out no OnDataChanged events will be generated for the monitored item
// UaClient->Reconnect();
}
}

2) At some point the TUaMonitoredItem vanishes from the subscription list. The TUaSubscription object is still valid, but its data items list (obtained by calling GetDataItems()) is empty.I assume this happens sometime after the OPC/UA server actively disconnects and then something happens in the TUaClient, maybe a timeout? Is there a way of being notified when the TUaMonitoredItem is removed from the subscription? Or prevent the item from being removed?

3) Access Violation
After 48hrs an access violation occured in Prosysopc::UaClient::TUaCustomClient::GetRequestHeader. “access violation at 0x1b16886: read of address 0x00000068”. I made a screenshot of the callstack, but I am unable to post it here, so here’s the text version:

:01b16886 Prosysopc::Uaclient:TuaCustomClient::GetRequestHeader +0x12
:01b01104; RepublishAllAvailable
:01b10557; Reconnect
:01b07734; CheckserverStatus
:01b14d3a; Execute
:0059FE3C System::Classes::ThreadProc(Thread=:1727f7bc)
:004D618A System::ThreadWrapper(Parameter=????)
:76777d59 KERNEL32.BaseThreadInitThunk + 0x19
:77a6b74b ntdll.RtlInitializeExceptionChain + 0x6b
:77a6b6cf ntdll.RtlClearVits + 0xbf

Kind regards,
Guido

October 13, 2023
13:54, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Thanks for the report. We will investigate and get back to you by email to sort this out.

October 16, 2023
10:31, EEST
Avatar
Guido Niewerth
Member
Members
Forum Posts: 13
Member Since:
August 23, 2022
sp_UserOfflineSmall Offline

Hi Jouni,

glad to hear so. Let me know if you need additional information.

btw:
I made a copy & paste error. The line

for( int i = 0; i operator _di_IUaSubscription();

should be

for( int i = 0; i < 2; ++i )

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
10 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

TimK: 41

Member Stats:

Guest Posters: 0

Members: 683

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1