PHP Classes

Help /?

Recommend this page to a friend!

      ModbusTcp  >  All threads  >  Help /?  >  (Un) Subscribe thread alerts  
Subject:Help /?
Summary:Request further explanations
Messages:3
Author:Peter De Ceulaer
Date:2008-01-16 13:29:47
Update:2008-01-30 20:17:41
 

  1. Help /?   Reply   Report abuse  
Picture of Peter De Ceulaer Peter De Ceulaer - 2008-01-16 13:29:47
I am a total newbie. It would be hard for me to totaly reverse-engineer the class to figure out how all elements fit together.

Would it be possible to elaborate on the various parameters that can be passed, and the functionality that they offer ?

Also, a general description of the class structure, what element does what and how all are linked ?

By the way : my goal is to read coils from a modbustcp-compatible server, and whenever there is a change in a status then a) write the new value toa mysql db and b) initiate the appropriate process (if any). Not sure if I should step b should be fired by the process that reads the coils and evaluates changes or by a trigger on the db.

Any hints in how you feel I should go about implementing thsi are welcome. Also, I would have to run the modbus reader as a continuous process (I understand that such would be a daemon). Again, any help or hints on where I can start are welcome.

  2. Re: Help /?   Reply   Report abuse  
Picture of fuchs yves fuchs yves - 2008-01-20 13:18:00 - In reply to message 1 from Peter De Ceulaer
this class is like a 'low level' network class. You need to develop around this class to achieve what you ask...
This is what I have done in our factory.
I use this class to pol process values from PLCs and store it into a mysql database.
Yes you need to develop like a daemon a process based on this class.
In our case, the php clie script is running on a Win 2003 server and is rised each 30s from 'planning' service. This script first query the database to retrieve modbus adresses, scaling, etc. from 'points' table, read values in PLCs and store results to 'values' table.


  3. Re: Help /?   Reply   Report abuse  
Picture of Peter De Ceulaer Peter De Ceulaer - 2008-01-30 20:17:41 - In reply to message 2 from fuchs yves
Cher Yves,
I understand your class would be a big step forward for me, if I could get it to work. I am too new to PHP (and programming) to make sense of it myself. For example, I don't even know what the most basic script would be to send one hard-coded request to a modbus PLC on a fixed ip, and then insert the response in a table or log file.

Your code looks beautiful, but that makes it harder for a newbie to discover the underlying raw action.

My other problem is that the device I am eager to interface with has a couple of proprietary semi-modbus functions, described on

sealevel.com/software/seamax/mbbd_s ...

Any idea on how these could best be included in your class ?

Looking forward to your assistance,
Salutations de Bahrain, Peter