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 - Remote OPC Server (again)

More
15 Dec 2011 05:51 #713 by support
You are welcome. I am glad I helped at least a bit.
We have support for OPC-AE as well, so, after you review your model, you can get back to us. As long as the information you are looking for is somehow available through OPC-AE, there will be a way to use QuickOPC A&E part to gain access to it. It could be that there are events generated for changes in the information you are looking for. Whether the information is or is not available really depends on the server.
You can (hopefully) use the documentation of the server, plus some sample client (such as the one from Softing), to figure this out. Once you know how the information is presented in the server, I can help you writing code that accesses it using the component.
Best regards

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

More
14 Dec 2011 22:58 #712 by woolyg
Hi Zbynek
Thanks for your very informative answer.
It is the status of a hardware item that I wanted to retrieve, and from your information I see that I'm going about it wrongly - OPC Data Access is the way to go for it. It is both an OPC-DA and OPC-AE server I'm trying to connect to, but the OPC-DA element is restricted (licensed) due to the fact that the hardware manages mission-critical processes, so I was trying to get an OPC-DA item status from connecting with OPC-AE settings, which I see are wrong now.
Thanks so much for your input - my application's data/state acquisition model will need to be reviewed, as OPC-DA is not suitable for the time being.
Regards,
WoolyG

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

More
14 Dec 2011 06:22 #705 by support
Hello, thanks for detailed description.
First of all, we really need to determine whether you want to connect to OPC Alarms and Events (A&E) server, or to OPC Data Access (DA) server. In your post, these things are quite mixed:

you say that you want to connect to OPC AE
but you also say that "connection to a local OPC DA server worked fine"
you are instantiating our object that is for OPC Data Access (for OPC Alarms and Events, it would be "OPCLabs.EasyAEClient.5.1")
you say that you want "get the status of an item" which (by using the term "item") indicates OPC-DA (there are no "items" in OPC-A&E)
you are using syntax ("opcae://...") and server's ProgID (.... OPCEventServer ....) that seem to indicate (although not guarantee) that what you want is an A&E server.

Regardless of the above, here are one thing that definitely needs correction: the syntax you have used ("opcae://PGVM-W7V7/OPCES.OPCEventServer/{[CLSID]}") appears to come from the Softing or similar client, and is vendor-specific. Assuming that "PGVM-W7V7" is name of the computer, and "OPCES.OPCEventServer" is the ProgID of the server, a command to read OPC-DA item value would be, with our component:
$EasyDAClient->ReadItemValue("PGVM-W7V7", "OPCES.OPCEventServer", "257.Field.29");
Note that some servers support both OPC-DA and OPC-A&E, and in such case, they typically have two different ProgID's for that, although in theory it could also be the same.
If you want to deal with OPC Alarms and Events, you will have to use different object and methods altogether; there is no such thing as "reading" an alarm (the closest thing to it might be getting a condition status). If you need OPC A&E, please explain in plain words what you want to achieve, or how you have done it in some other client, and I will try to help.
Also, if you get any kind of exception that you do not expect and do not know why you are getting it, please obtain the exception message, and post it as well.
Best regards,
Zbynek Zahradnik

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

More
14 Dec 2011 02:54 #703 by woolyg
Hi all,
I'm attempting to connect to a remote OPC AE server using PHP, and need a little input. I've seen the previous thread on this subject, but it seemed to fall by the wayside as the thread starter was placed on another project. This one is a personal project, so no rush on replies.
I have absolutely ascertained that DCOM is working fine, and done the following
- connected using Softing tool
- set DCOMCNFG accordingly
- ensure a connection to a local OPC DA server worked fine
- connected with an alternative OPC-based application.

I think my connection parameters need a little work? Please see below.

I'm using the following string in PHP:
_______________
$EasyDAClient = new COM("OPCLabs.EasyDAClient.5.1");
$subscription1 = $EasyDAClient->ReadItemValue("", "opcae://PGVM-W7V7/OPCES.OPCEventServer/{[CLSID]}", "257.Field.29");
echo $subscription1;
_______________

Should I be using these parameters for connecting to a remote machine?
Other info:
- The last parameter (257.Field.29) is correct, I'm just looking to get the status of an item.
- Using opcae://PGVM-W7V7/OPCES.OPCEventServer/{[CLSID]} in softing works fine.

Can anyone provide any guidance? I'm quite new to the QuickOPC-COM tool.
All the best,
Regards
WoolyG

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

Moderators: support
Time to create page: 0.049 seconds