Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Modbus Plugin
#8
Looks like you have made a good start.

A few suggestions:
1. You may find that the address of the USB port on the Pi changes from time to time. This can cause some strange problems. You can set a persistent address for the port:
hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/

2. Instead of looping to get 8 values from the ventil array you can use "slice".
http://stackoverflow.com/questions/50921...e-notation

for example if you have 16 values in the array you can do:
first_8 = ventil[:9]
second_8 = ventil[9:]

3. you can send all 8 values at once using modbus function 16:
instrument.write_registers(0, first_8). Also, simpleMosbusSlave v10 supports function 6.

The MODBUS specification calls for using twisted pair cable like phone or network cable. I have been using non-twisted pair wire (sprinkler wire) without a problem with lengths of over 100 feet (30 M).

Dan
Reply


Messages In This Thread
Modbus Plugin - by cyberthom - 2017 Mar 07, 03:54 PM
RE: Modbus Plugin - by dan - 2017 Mar 07, 10:54 PM
RE: Modbus Plugin - by cyberthom - 2017 Mar 08, 10:30 AM
RE: Modbus Plugin - by dan - 2017 Mar 08, 04:41 PM
RE: Modbus Plugin - by cyberthom - 2017 Mar 09, 07:11 PM
RE: Modbus Plugin - by dan - 2017 Mar 10, 03:00 AM
RE: Modbus Plugin - by cyberthom - 2017 Mar 23, 09:50 PM
RE: Modbus Plugin - by dan - 2017 Mar 24, 04:38 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)