Page 1 of 1

MODBUS TCP Plugin?

PostPosted: Mon Jul 02, 2012 4:53 pm
by trimixdiver1
Has anyone tried to make some sort of plugin for MODBUS TCP? I wish I could and I would.

Thanks

Re: MODBUS TCP Plugin?

PostPosted: Mon Jul 02, 2012 7:04 pm
by loafbread
I would like to see the same thing.

Re: MODBUS TCP Plugin?

PostPosted: Fri Jul 06, 2012 7:13 pm
by trimixdiver1
How hard would it be? Jay?

Thanks

Re: MODBUS TCP Plugin?

PostPosted: Fri Jul 06, 2012 7:53 pm
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.

Re: MODBUS TCP Plugin?

PostPosted: Sat Jul 07, 2012 12:18 pm
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.

Re: MODBUS TCP Plugin?

PostPosted: Sun Jul 08, 2012 12:03 pm
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:

Re: MODBUS TCP Plugin?

PostPosted: Tue Jul 10, 2012 1:40 pm
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.

Re: MODBUS TCP Plugin?

PostPosted: Mon Dec 03, 2012 7:38 am
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[i]
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[i], result.registers[i + 1]))[0]
print "address:", i + 3901, "float", f1
client.close()