MODBUS TCP Plugin?

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
Forum rules
This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
trimixdiver1
Posts: 18
Joined: Mon Jul 02, 2012 8:59 am

MODBUS TCP Plugin?

Post by trimixdiver1 »

Has anyone tried to make some sort of plugin for MODBUS TCP? I wish I could and I would.

Thanks
loafbread
Posts: 137
Joined: Mon May 25, 2009 6:50 am

Re: MODBUS TCP Plugin?

Post by loafbread »

I would like to see the same thing.
trimixdiver1
Posts: 18
Joined: Mon Jul 02, 2012 8:59 am

Re: MODBUS TCP Plugin?

Post by trimixdiver1 »

How hard would it be? Jay?

Thanks
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: MODBUS TCP Plugin?

Post by jay (support) »

No idea what the MODBUS protocol even looks like or what types of devices it supports so I couldn't estimate. Perhaps there's other users that have some experience with it that can comment.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
trimixdiver1
Posts: 18
Joined: Mon Jul 02, 2012 8:59 am

Re: MODBUS TCP Plugin?

Post by trimixdiver1 »

jay (support) wrote:No idea what the MODBUS protocol even looks like or what types of devices it supports so I couldn't estimate. Perhaps there's other users that have some experience with it that can comment.
I have a link to the protocol. I wish I was more software writing savvy. Im a RSLogix geek.

http://www.rtaautomation.com/modbustcp/

http://www.prosoft-technology.com/kb/file.php?id=53

Modbus is a older but widely used way to talk to and control a lot of equipment and devices. Its pretty easy to set up and you can expand the possibilities of Indigo.
It does digital and analog.

Another cool thing is this
http://www.integpg.com/jnior/ethernet_io.aspx

They are ethernet connected, run MODBUS, one wire, have built in IO and have analog and RTD add on modules. There is also a energy software that takes pulses from a KWH meter or water meter and charts it. Also the company is in my backyard in Pittsburgh, and the support is awesome.


I have 10 of them
I think this would be a cost effective way to expand the use of Indigo.
trimixdiver1
Posts: 18
Joined: Mon Jul 02, 2012 8:59 am

Re: MODBUS TCP Plugin?

Post by trimixdiver1 »

Some more info

http://www.control.com/thread/1026206345

I sure wish I could do it, but I don't even know where to start...... :roll:

I know Homeseer was talking about it.... :lol:
trimixdiver1
Posts: 18
Joined: Mon Jul 02, 2012 8:59 am

Re: MODBUS TCP Plugin?

Post by trimixdiver1 »

Here is something relating to Python

http://code.google.com/p/pymodbus/

http://code.google.com/p/modscan/


Again, I wish I could do it, my mind is too full of PLC programming stuff.
loafbread
Posts: 137
Joined: Mon May 25, 2009 6:50 am

Re: MODBUS TCP Plugin?

Post by loafbread »

I thought about trying to write a plugin even though I have never written any python and am not a programmer, lol. I didn't get too far.

I installed the pymodbus libraries from here: http://code.google.com/p/pymodbus/
I struggled for about a day to write the code below to retrieve 18 I/O from an ADAM 6050 module and to retrieve numerous power meter values from a Conserv power meter. Most of my time was spent trying to figure out python. In the end it seems to be pretty simple code for the data retrieval. I don't have time or talent to turn it into a plugin.

There are numerous IO devices available that have some advantages. Their hardware is usually rugged and industrial. They usually have builtin opto isolation on the inputs and outputs. They are comparable in cost to the EZIO devices on a per port basis.

I am glad to see Berkinet developing a Phidgets plugin. I think when somebody has time to look at Modbus it would be a nice addition to the Indigo suite.

The Moxa product line looks reasonable: http://www.moxa.com/product/ioLogik_E1212.htm
Here is another device that is reasonably priced: http://gridconnect.com/ethernet-io.html
The ADAM modules are good but require Windows OS to configure.

------ code sample ----

#!/usr/bin/env python

from pymodbus.client.sync import ModbusTcpClient as ModbusClient
from struct import *

# read digital inputs from ADAM 6050 module
print '\n'
print ' read digital inputs from ADAM 6050 module'
print ''
client = ModbusClient('192.168.1.44')
result = client.read_discrete_inputs(0,17)

for i in range(0, 17):
print 'bit:', i, result.bits
client.close()

# read power meter via lantronix Ethernet/ModbusTCP converter
print '\n'
print ' read Conserv power meter via lantronix Ethernet/ModbusTCP converter'

client = ModbusClient('192.168.1.91')
result = client.read_holding_registers(3900, count=100, unit=1)

#print result.registers
print ''
for i in range(0, 56, 2):
f1 = unpack('f', pack('HH', result.registers, result.registers[i + 1]))[0]
print "address:", i + 3901, "float", f1
client.close()
Locked

Return to “Extending Indigo with Plugins and Python”