Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

PHP opc retrieving signals

More
23 Jul 2018 14:54 #6534 by alr1976
Replied by alr1976 on topic PHP opc retrieving signals
okay a quick update:

After installing everything and also PHP 7.2.8 and the latest OPC component sem that is workign we are still testing it but at least we don't have the previous error anymore until now I will keep you updated.

Please Log in or Create an account to join the conversation.

More
19 Jul 2018 10:10 #6529 by alr1976
Replied by alr1976 on topic PHP opc retrieving signals
sorry my mistake I didn't see the nts inside the name :) okay let me setup the server from scratch and give you feedback

Please Log in or Create an account to join the conversation.

More
19 Jul 2018 09:50 #6528 by support
Replied by support on topic PHP opc retrieving signals
That is clear from the info I provided, as each installer has a unique name. Hover over the link on the PHP site and you will see the name in the browser. "php-7.2.8-nts-Win32-VC15-x64", which I have used, is the installer for "VC15 x64 Non Thread Safe (2018-Jul-18 12:51:38)".

But they should all work with respect to QuickOPC (this is not to say that they all should work in IIS etc. - that's not our concern).

Regards

Please Log in or Create an account to join the conversation.

More
19 Jul 2018 09:39 #6527 by alr1976
Replied by alr1976 on topic PHP opc retrieving signals
Yes I know but which one of this 2 ?

VC15 x64 Non Thread Safe (2018-Jul-18 12:51:38)

or this one:

VC15 x64 Thread Safe (2018-Jul-18 12:51:20)

Please Log in or Create an account to join the conversation.

More
19 Jul 2018 08:57 #6526 by support
Replied by support on topic PHP opc retrieving signals
The PHP installs I tested were:

- php-5.6.36-Win32-VC11-x86
- php-7.2.8-nts-Win32-VC15-x64

Regards

Please Log in or Create an account to join the conversation.

More
19 Jul 2018 08:35 #6525 by alr1976
Replied by alr1976 on topic PHP opc retrieving signals
FYI:

which version of PHp on php.net did yo uinstalled x64 with NTS ?

Please Log in or Create an account to join the conversation.

More
19 Jul 2018 08:34 #6524 by alr1976
Replied by alr1976 on topic PHP opc retrieving signals
okay I will check ASAP and give you feedback positive or negative so also for you will be aware if yo ufixed it thanks

Please Log in or Create an account to join the conversation.

More
19 Jul 2018 08:20 #6523 by support
Replied by support on topic PHP opc retrieving signals
I attempted to reproduce the problem on Windows Server 2012 R2, but without success. I have used some older PHP version that we have tested with before (5.6.x), and then the latest one (7.2.8), from windows.php.net/download/ .

Nevertheless, I suspect the issue might be what we have already addressed in the upcoming QuickOPC 2018.3. We have therefore projected the fix back into 2018.2, and made a new build that is now available on the Download page of our Web site. Please download the latest build (it should identify itself as 5.53.293.1 or later on the 1st page of Setup) and re-test.

It is also possible that the error was an inappropriate indication of some other problem. If you still get problems, but a different error message, we would need the new error text.

Regards

Please Log in or Create an account to join the conversation.

More
17 Jul 2018 15:31 #6520 by alr1976
Replied by alr1976 on topic PHP opc retrieving signals
Here is one more small update now I got htis issue:

C:\php>php bdn.php
PHP Fatal error: Uncaught com_exception: Source: OpcLabs.BaseLib
Description: Attempt to add existing item into a set. in C:\php\bdn.php:12
Stack trace:
#0 C:\php\bdn.php(12): com->BrowseDataNodes('opcua.de...', 'nsu=http://te
st...')
#1 {main}
thrown in C:\php\bdn.php on line 12

Fatal error: Uncaught com_exception: Source: OpcLabs.BaseLib
Description: Attempt to add existing item into a set. in C:\php\bdn.php:12
Stack trace:
#0 C:\php\bdn.php(12): com->BrowseDataNodes('opcua.de...', 'nsu=http://te
st...')
#1 {main}
thrown in C:\php\bdn.php on line 12

FYI bdn.php is the renamed example that you provide under console example of php named Browsedatanodes.php

Please Log in or Create an account to join the conversation.

More
16 Jul 2018 13:06 - 16 Jul 2018 14:19 #6516 by alr1976
Replied by alr1976 on topic PHP opc retrieving signals
Now I have problem brosing nodes ....


Server is 2012 R2 so it is fully compatible and we use the latest COM opc component downloaded today

so when I use this in PHP DON'T WORK:

<?php

$opcServer = "opc.tcp://XXX.XXX.XXX.XXX:49320";
$opcPath = 'ns=2;s=MOYNORHB1.RHB1';

$client = new \COM("OpcLabs.EasyOpc.UA.EasyUAClient");
$monitoringParameters = new \COM("OpcLabs.EasyOpc.UA.UAMonitoringParameters");

try {
$nodeElements = $client->BrowseDataNodes($opcServer, $opcPath);
} catch (\Exception $e) {
echo $e->getMessage();
}
foreach ($nodeElements as $nodeElement) {
echo $nodeElement->BrowseName.' '.$nodeElement->NodeId.PHP_EOL;
}


the similar code in delphi on the same machine:

var
Client: OpcLabs_EasyOpcUA_TLB._EasyUAClient;
Count: Cardinal;
Element: OleVariant;
NodeElement: _UANodeElement;
NodeElementEnumerator: IEnumVariant;
NodeElements: _UANodeElementCollection;
begin
// Instantiate the client object
Client := CoEasyUAClient.Create;

NodeElements := Client.BrowseDataNodes(
'opc.tcp://XXX.XXX.XXX.XXX:49320/',
'ns=2;s=MOYNORHB1.RHB1');

NodeElementEnumerator := NodeElements.GetEnumerator;
while (NodeElementEnumerator.Next(1, Element, Count) = S_OK) do
begin
NodeElement := IUnknown(Element) as _UANodeElement;
Memo1.Lines.Add(NodeElement.BrowseName.ToString+ ' : ' + NodeElement.NodeId.ToString);
end;
end;

WORKS PERFECLT

so what is the issue ?


ah I got this error in PHP:


Source: OpcLabs.BaseLib
Description: Attempt to add existing item into a set.
C:\inetpub\wwwroot\opc>


PS. Your BroseDataNodex example return excatly same error .... this is with version of PHP 7.0.7 with 7.2.2 don't give me any error and no node showed... (Nice)
Last edit: 16 Jul 2018 14:19 by alr1976.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.061 seconds