I need to find a resource to interface php with modbus/TCP, Is there anybody know a resource?
Hi,
Could you tell if your platform is Windows or Linux? If Windows, then there is a way to interface a dll into a PHP script. You can find many implementations of MODBUS in the form of a dll from various vendors.
If Linux, I am not too sure at the moment. Thanks.
Regards,
Ganesh Okade
Sunlux Technologies Ltd.
http://www.sunlux-india.com
Could you tell if your platform is Windows or Linux? If Windows, then there is a way to interface a dll into a PHP script. You can find many implementations of MODBUS in the form of a dll from various vendors.
If Linux, I am not too sure at the moment. Thanks.
Regards,
Ganesh Okade
Sunlux Technologies Ltd.
http://www.sunlux-india.com
There are free modbus/TCP drivers available. I will let others recommend particular libraries, but you can perhaps use the ones from pvbrowser (http://pvbrowser.de) or MAT (http://sourceforge.net/projects/mat/).
In either case, you will end up with a C library that you need to interface to PHP. Below are some URLs which show how to do this in the general case.
http://www.php.net/manual/en/zend.creating.php
http://www.zend.com/php/internals/index.php
In either case, you will end up with a C library that you need to interface to PHP. Below are some URLs which show how to do this in the general case.
http://www.php.net/manual/en/zend.creating.php
http://www.zend.com/php/internals/index.php
I've got a fairly generic modbus library written in C for linux at
http://www.seiner.com/ts7000/index.php/Modbus_and_Serial_Comm
It's GPL, so please read and understand the benefits and restrictions that places on the code use.
I am working on a TCP wrapper now; if anyone would like to contribute, please feel free.
Mostly it needs testing and debugging.
--Yan
http://www.seiner.com/ts7000/index.php/Modbus_and_Serial_Comm
It's GPL, so please read and understand the benefits and restrictions that places on the code use.
I am working on a TCP wrapper now; if anyone would like to contribute, please feel free.
Mostly it needs testing and debugging.
--Yan
I have a program called Modserver on Linux (Fedora, Suse). It is very reliable.
The whole system structure
PHP
|
Modservre
|
SCADA, PLC
-----------------------------
http://www.icscada.ca
The whole system structure
PHP
|
Modservre
|
SCADA, PLC
-----------------------------
http://www.icscada.ca
In reply to Roy Yin: I had a look at your web site as I was curious, and noticed your mention of "XML Modbus protocol", "XML Modbus command", and "XML Modbus message". Is this just your way of describing an implementation of a set of web services, or is there actually some formal "XML Modbus" standard that I haven't heard of?
Modserver is a service program, just like OPC server. To control a RTU, C, PHP, or any script language connect to Modserver by using TCP socket or Unix Socket, and send XML format command to Modserver. Modserver parses the XML command, optimizes , creates a RTU acceptable Modbus command, and sends to RTU. It will format the response from RTU to readable XML format, and send back.
To write 25.4 register 40179 on slave 15
<modbus tranid="1"
unitid="15"
address="40179"
number="2"
function="16"
datatype="float"
byteorder="DCBA"
data="25.4" />
and response:
<modbus tranid="1" function="16" data="" state="0" />
-------------------------------
http://www.icscada.ca
To write 25.4 register 40179 on slave 15
<modbus tranid="1"
unitid="15"
address="40179"
number="2"
function="16"
datatype="float"
byteorder="DCBA"
data="25.4" />
and response:
<modbus tranid="1" function="16" data="" state="0" />
-------------------------------
http://www.icscada.ca
Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2010 Nerds in Control, LLC. All rights reserved.
Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.
Fortune
The Abrams' Principle:
The shortest distance between two points is off the wall.



