adccommunitymod (AutomationDirect) asked a question.

Open-source Modbus software

Created Date: May 25,2012

Created By: AlbertL

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

I 've come across a couple of open-source Modbus implementations which might be of interest: Jamod - Java implementation of Modbus RTU, TCP, UDP: http://jamod.sourceforge.net/ PhpModbus - PHP implementation of Modbus TCP, UDP: http://code.google.com/p/phpmodbus/ I 've played with both (as a "recreational " programmer) and found them pretty easy to use, even with my limited skills. I'm currently working on a web-based (AJAX) status-monitoring application for my Click PLC, using the PHP package. Albert


  • adccommunitymod (AutomationDirect)

    Created Date: June 26,2012

    Created by: deep6ixed

    Ive run a across PHP modbus doing some web digging and was hoping that someone could figure out how to get this to work with a C-More HMI.

  • adccommunitymod (AutomationDirect)

    Created Date: June 29,2012

    Created by: deep6ixed

    Im very interested, could you upload some of your notes?

  • adccommunitymod (AutomationDirect)

    Created Date: July 03,2012

    Created by: AlbertL

    Sorry for the slow reply. Sure, I'll be glad to post what I have. I 've just begun playing with the code, so let me clean it up a little first so it's more-or-less presentable :)

  • adccommunitymod (AutomationDirect)

    Created Date: July 03,2012

    Created by: deep6ixed

    Thanks. I know my way around PHP and if I can help then Id be glad to.

  • adccommunitymod (AutomationDirect)

    Created Date: July 05,2012

    Created by: AlbertL

    At the moment I'm working on a PHP function that converts a Click address to the curresponding Modbus address; e.g. you give it the string "DS1 " and it returns the integer 16384. I think that will be a useful building block.

  • adccommunitymod (AutomationDirect)

    Created Date: July 06,2012

    Created by: deep6ixed

    really dumb question, how are you connecting the Click to network for PHP to talk to it.

  • adccommunitymod (AutomationDirect)

    Created Date: July 06,2012

    Created by: AlbertL

    Not a dumb question at all!

    I'm using the GridConnect Net485-MB Modbus RS485 Adapter:

    http://gridconnect.com/industrial-protocols/modbus/modbus-rs485.html

    Automation Direct has a product which I think performs the same function, but I haven't compared the two side by side:

    http://www.automationdirect.com/adc/Shopping/Catalog/Communications/Ethernet/Ethernet_Converters_-a-_Gateways/MB-GATEWAY

    If you 're using a Click model which doesn't have an RS-485 port, there's an RS-232 version of the GridConnect adapter:

    http://gridconnect.com/industrial-protocols/modbus/modbus-rs232.html

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: July 06,2012

    Created by: AlbertL

    The attached PHP program is a very crude example of using the PhpModbus package to read a Click address; in this case SD9 (_Scan_Counter).

  • adccommunitymod (AutomationDirect)

    Created Date: July 13,2012

    Created by: AlbertL

    Thanks. I know my way around PHP and if I can help then Id be glad to.

    One thing that will be needed is to add some Modbus function codes to the ModbusMaster class, so it can access all of the Click address types. For example, reading the "X " addresses requires FC 2, which ModbusMaster doesn't provide.

    Fortunately, the PHP code is very well organized, so it should be pretty easy to add the required functions.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: July 15,2012

    Created by: AlbertL

    File ClickPLC.php in the attached zip file contains a function which converts a Click address string (e.g. "DS17 ") into the corresponding Modbus address.

    The function uses a lookup table which contains all of the static information, from the Address Picker, about the Click addresses for each memory type (X, Y , DS, etc.). For each memory type, it gives the data type, Modbus address increment, valid Modbus function codes, and the Click numeric address range(s) and corresponding Modbus starting addresses.

    File test-FC03.php is a crude driver script to demonstrate use of the conversion function, and reading a Click integer address via the PhpModbus package.

    Expand Post
10 of 12