Jump to content

Can PHP connect to an OPC Server?


lbillett

Recommended Posts

I want to fetch information from an OPC Server and was hoping to use PHP to do it. However, googling hasn't gotten me very far. It doesn't appear to be a very popular thing to do, which I find strange considering the reasonably large presence and multitude of other connectors OPC seems to have.

 

Anybody out there ever try something like this? My problem could be that it's so simple I just don't realize the way through. I'm trying to display values from a Foxboro DCS on our intranet with PHP via OPC.

 

Thanks!

Link to comment
Share on other sites

I think establishing a direct connection sounds a little over my head. At this stage my experience has been limited to making sql connections/queries and coming up with cute customized output in our mediawiki installation.

 

It looks like I might be able to connect to this same type of resource using ODBC, which would be preferable but I can't seem to get any meaningful data from it... It seems I could also purchase some kind of connector, but I'm not confident I could make it work either.

 

I found one thread about folks using SOAP to connect to OPC, but I couldn't quite figure out wtf they were talking about. If somebody could embellish it I might have a chance, though I still don't really understand what SOAP accomplishes. Guess I may have to figure that out before too long.

Link to comment
Share on other sites

Let's demystify for a moment.  This is windows operating system technology.  When you get right down to it, you're talking about microsoft specific specifications allowing components to be used by a variety of different microsoft languages.  All this stuff started out as DLL's, evolved into COM around the time that VB components were the rage, and then were enhanced into DCOM, once people got the idea that hey might want to make use of objects on other machines.

 

PHP can be used for many things, but rarely do people seek to do something with it that is better done via a client application running under the windows OS. 

 

I'm not entirely clear what your aim is here, but I'll warrant a guess.  You have a webserver that is not running on the same machine as your DCS terminal, that you want to interface to.  The library the company pointed you to would certainly allow you to do what you stated you wanted... allow a php application running on a microsoft windows server to make a client connection to an OPC server by integrating the COM component they provide.  I can't by any means tell you what parameters you would need to use to setup this in a true client/server application where the client and server are not on the same machine, but rather are networked together.     

 

If your PHP server is running on a windows server, then this looks like a viable solution.  If however, your PHP server is a LAMP box, this would be of no use to you.  The same company offers another toolkit that appears to setup a web interface that could be connected to by a web application.

 

http://www.opclabs.com/Products/QuickOPCWeb.aspx

 

The first thing you need to do is clarify for everyone you're talking to about this, what the specific architecture is of the various machines involved-- how they are networked together and what operating systems they are running. 

Link to comment
Share on other sites

  • 4 months later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.