Quantcast
Channel: OPC Labs - OPC Labs - Recent Topics - OPC Labs Online Forums
Viewing all articles
Browse latest Browse all 1794

Client disconnect - by: novotnypetr

$
0
0
Hello,
we use QuickOPC library for communication with injection moulding machines via PHP and COM. Sometimes we have problems with reconnection to the machine (error BadUserAccessDenied) and we must restart the machine. After machine restart communication works again.
Maybe the problem is in unclosed session which is blocking new connections.
Is it possible to disconnect or end client session on client side? I couldn't find any example or mention in the documentation.

Our PHP code:

//Instantiate the client object
$opcUaClient = new \COM("OpcLabs.EasyOpc.UA.EasyUAClient");

//session settings
$opcUaClient->Isolated = TRUE;
$opcUaClient->IsolatedParameters->SessionParameters->EndpointSelectionTimeout = 3000
$opcUaClient->IsolatedParameters->SessionParameters->SessionConnectTimeout = 6000;
$opcUaClient->IsolatedParameters->SessionParameters->SessionTimeout = 6000;
$opcUaClient->IsolatedParameters->SessionParameters->SessionTimeoutDebug = 6000;
$opcUaClient->IsolatedParameters->SessionParameters->UserIdentity->UserNameTokenInfo->UserName = 'username';
$opcUaClient->IsolatedParameters->SessionParameters->UserIdentity->UserNameTokenInfo->Password = 'password';

//calling some method
$results = $opcUaClient->ReadMultipleValues($arguments);

//and now how to close session ? Is it possible?
//for example: $opcUaClient->closeSession();


Thanks for your help.

Viewing all articles
Browse latest Browse all 1794

Trending Articles