Author Topic: Modbus RTU  (Read 10770 times)

Matt

  • Newbie
  • *
  • Posts: 3
  • I'm a llama!
    • View Profile
Modbus RTU
« on: January 20, 2006, 05:05:02 AM »
I am trying to get a TM1001616+ Plc to talk to a micro motion flow meter using Modbus RTU protocal.The only programming that I set up was the, SETBAUD 3,&H63 on the first scan under custom function 1.Which should match the meter settings of( baud rate 9600,8 data bits,1 stop bit,odd parity). All I am trying to do is read values from DM holding registers.I also put values in the DM registers that I need to read from.Can anyone help me out.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Modbus RTU
« Reply #1 on: January 20, 2006, 09:19:20 AM »
I assume you are using COMM3 (RS485 port)?

First you should set up a single action circuit triggered by an input:

      IN1          TestMB
  |---||----------{dCusF}


Inside the TestMB custom function, try this:

  X = READMODBUS(13, nn, XXXX) ' 13 means Modbus RTU protocol.
                                ' use 3 for Modbus ASCII protocol.


nn is the ID of the MODBUS RTU slave and XXXX is the binary offset address of the registers in the RTU device

  typically xxxx = Modbus Holding Register (4xxxxx)  - 40001

So e.g. if MODBUS slave ID is 05, and MODBUS register address is 40015, then xxxx = 40015 - 40001 = 14.

  X = READMODBUS (13, 5, 14)

Go online monitoring and click on IN1 to trigger a single run of the TestMB function and check the value of X. If should show the read value of the MODBUS register 40015 of slave ID = 05.

Once you get this done, you would have succeeded in talking to the MODBUS RTU slave and you can take it from there. WRITEMODBUS is similar.

If your MODBUS register is at 3xxxx then you need to change READMODBUS and WRITEMODBUS to use function 04 instead of default function 03. Please refer to the following thread for details:

   http://www.tri-plc.com/yabbse/index.php?board=2;action=display;threadid=298

« Last Edit: January 20, 2006, 09:22:32 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Matt

  • Newbie
  • *
  • Posts: 3
  • I'm a llama!
    • View Profile
Re:Modbus RTU
« Reply #2 on: January 23, 2006, 06:55:21 AM »
I found out that Modbus RTU is only supported by firmware r30 or above.My version is r12.Is there any way that I can upgrade my firmware to make it capable of Modbus RTU protocol. :(

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Modbus RTU
« Reply #3 on: January 23, 2006, 12:28:24 PM »
The firmware cannot be upgraded because these are all mask ROM parts. Any change of firmware require replacement of the CPU.

However, there was a change in the hardware design after version r30 and therefore the current CPU version r49 cannot work on the older generation of PLC.  

You should acquire a new T100MD888+ which has a lot of enhancement compared to the older generation if you want to use it for MODBUS RTU communication with the external device.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS