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.

OPC in PHP

More
15 Dec 2011 08:28 #715 by admin
Replied by admin on topic Re: OPC in PHP
Some more information to this:
If you still have the client and server on the same machine, and you are getting "Access denied" from your PHP code but not from the console app, it could be because the PHP code runs with different users credentials than the console app (which you probably run from you user's interactive session). If your PHP code is running inside a Web server such as IIS, it probably is running under a dedicated account (such as IUSR_xxxx or IWAM_xxxx) with limited privileges.
In order to verify this, try to configure the Web server to use e.g. your own user account instead. If that helps, you will know that the problem is related to the account security settings.
Regards

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

More
14 Dec 2011 18:57 #711 by support
Replied by support on topic Re: OPC in PHP
Hello,
the picture resolution is too low - I cannot read anything - can you please attach a better picture? (it appears to be a problem with the original image file uploaded, not with the fact that it gets resized when displayed on the forums page; I have looked at the original file, too).
Thank you

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

More
14 Dec 2011 16:26 #710 by OndrejBlazek
Replied by OndrejBlazek on topic Re: OPC in PHP
I added some Try/Catch code and the error that I get is an Access Denied error when trying to use the Client. I do not get any error when establishing the COM object.
I have enclosed a screen shot of my testing...
EasyClientError.jpg
The top left corner is my browser (in this case FF but gives same problem in IE) still showing the error message that occured when I ran the page. Bottom left is my PHP code. Top right is my OPC Server that I am trying to connect to. Bottom right is a command prompt where I have use my OPC tool (not realed to the OPCLabs client) to prove that the server name and OPC tag is correct.
I am logged in as Administrator with administrator priviledges.
I also verified, using RegEdit, that the name of the client (currently installed), indeed, is "OPCLabs.EasyDAClient.5.1".

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

More
14 Dec 2011 13:40 #709 by support
Replied by support on topic Re: OPC in PHP
Hello,
.....
> I suppose that you are using some software recently downloaded from our side, and not the "old" version 5.0x.
Correct. I will try correcting the line as per your suggestion.
> I do not understand what you mean by "command-line OPC tool". Is it something that uses our component, too? It would be weird if it were referring to the component in the same way but worked.
No. The "Command Line OPC" tool is something that I wrote in VB6 that does not use your control. It is basically a small program, intended to be used from the command line, that allows you to write OPC tags. It is intended to be a testing tool to verify that a server or tags on the server are working correctly. The only reasons why I mentioned it was to show that I did verify that the server and server tags were working and were accessible when accessed using other software.
> If the code is not getting past certain statement, then it is probably throwing some exception.
> The best help for troubleshooting would be to catch the exception and obtain information from it, such as the associated message.
Thanks for the suggestion. I will try that and, if successful, will post what error I am getting.
Best Regards,
O.

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

More
13 Dec 2011 20:41 #702 by support
Replied by support on topic Re: OPC in PHP
First of all, I must say that the example on our Web site is actually obsolete, and you have allowed me to discover this. The example is for versions 5.0x, while we are currently shipping versions 5.1x. This means that the line you are referring to should actually be
$EasyDAClient = new COM("OPCLabs.EasyDAClient.5.1");
I will fix it on the Web.
Some more notes:

I suppose that you are using some software recently downloaded from our side, and not the "old" version 5.0x.
I do not understand what you mean by "command-line OPC tool". Is it something that uses our component, too? It would be weird if it were referring to the component in the same way but worked.
If the code is not getting past certain statement, then it is probably throwing some exception. The best help for troubleshooting would be to catch the exception and obtain information from it, such as the associated message.

If this does not help, or if you need more assistance, please let me know.
Best regards,
Zbynek Zahradnik

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

More
13 Dec 2011 20:32 #701 by support
OPC in PHP was created by support
From: .....
Sent: Tuesday, December 13, 2011 7:15 PM
To: Zbynek Zahradnik
Subject: OPC in PHP
When I try the simplest PHP example on your website, I don't get any response back. It seems that the web server (IIS) hangs on:
$EasyDAClient = new COM("OPCLabs.EasyDAClient.5.0");
And never gets to:
print $EasyDAClient->ReadItemValue("", "ICONICS.SimulatorOPCDA", "Extension_4001")
I have changed the OPC Server reference to "ICONICS.SimulatorOPCDA" and the tag to "Extension_4001". This is both a valid OPC-DA server and a valid tag on the OPC server.
When I use my command-line OPC tool to write the tag it works fine (so the server name is correct and so is the tag name). But through PHP using your Client, I get no response.
The IIS web server and the OPC Server are running on the same machine.
Any ideas what the problem might be?
Submitted By: O.

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

Moderators: support
Time to create page: 0.051 seconds