Author Topic: Modbus map?  (Read 15183 times)

John_Parker

  • Newbie
  • Posts: 3
    • View Profile
Modbus map?
« on: November 09, 2013, 10:21:50 AM »
Can anyone explain how a relay status can be assigned to modbus address?
Thanks

EDGAR

  • Jr. Member
  • Posts: 60
  • Automating concepts around the world!
    • View Profile
    • Kinemics
Re:Modbus map?
« Reply #1 on: July 30, 2014, 04:37:46 AM »
Not sure I understand your question? The PLC comes with the data sheet that shows you the Modbus address table and reference of each PLC IO.

Ed
Low cost Modbus OPC DA Server, supporting Modbus RTU, ASCII, and TCP. Download your demo today! Go to www.kinemics.com/modbus.

williamsj

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:Modbus map?
« Reply #2 on: August 26, 2015, 06:45:58 PM »
Hi,

I'm assuming here that you want to connect over the LAN and not RS485.

Firstly you need to connect to the plc you want to write to/read from. The following command will do that:

PRINT #4 "<MBTCPCONNECT 192.168.0.40:502>"

The 192.168.0.40 IP address is the one for the destination plc. The 502 at the end is necessary as it is the port number that is used by MODBUS over tcp/ip

Next, write to a location on the destination plc use the following command:

WRITEMODBUS 4,1,1101,DM[50]

In this instance I am writing to an DM location on the destination PLC from a DM location on the source PLC. How do I know the destination is a DM location? It is the 1000 at the beginning of the 1101 (check chapter 14, pg 10 of the manual). I am actually writing to DM[100] on the destination PLC, you can read the manual to see how the numbers work out.
The 4 at the beginning is the port I'm going out on the source, 4 because I'm using the ethernet socket. The following 1 is the Id of the destination plc, seems redundant but necessary
The DM[50] is the location of the data on the source plc.

Hopefully this makes some sort of sense. It will be very similar for RS485.

cheers,

john

There are 10 types of people that understand binary,
those who do and those who don't

BetterBath

  • Newbie
  • *
  • Posts: 17
    • View Profile
« Last Edit: March 07, 2023, 03:00:41 AM by BetterBath »