Author Topic: Modbus master and slave  (Read 13189 times)

Petty_boy

  • Jr. Member
  • **
  • Posts: 53
  • I'm a llama!
    • View Profile
Modbus master and slave
« on: May 28, 2009, 10:02:43 AM »
Hi,

I want to use the T100MD-2424 as a remote modbus master on one of the communication ports to collect some values and store them in DM
  • .


On the other port I want the T100MD-2424+ to act as a MB slave so I can collect data from multiple T100MD-2424 that I have in the field.

Looking on your website, you indicate this is possible but I cannot find any further information in the manuals?  Is this possible?

Cheers

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Modbus master and slave
« Reply #1 on: May 28, 2009, 11:20:43 AM »
Yes, there is a sample program in your sample folder called "RemoteIO-Mseries.PC6".

You can also go to our "Application Note" download link to download the sample program for using the PLCs as remote I/Os for a master PLC via RS485:

http://www.tri-plc.com/appnotes/AppnoteMain.htm
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Petty_boy

  • Jr. Member
  • **
  • Posts: 53
  • I'm a llama!
    • View Profile
Re:Modbus master and slave
« Reply #2 on: May 29, 2009, 01:29:52 AM »
Hi,

I'm not looking to use the PLC's as remote IO's.

My SCADA will be the MB master, this will collect data from the slave PLC's via the RS485 port.

The local (slave)PLC will need to collect data from local devices i.e power meters etc on the RS232 (master).

is this OK?  will the communication work OK?

Cheers


support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Modbus master and slave
« Reply #3 on: May 29, 2009, 07:13:51 AM »
Yes, you can do that.

What kind of protoocol does your power meters use? I assume it is MODBUS RTU  then you can use the READMODBUS (11,xx,yy) command to read data from the power meter with slave ID = xx and holding register location = (40001+yy) - See Chapter 5 of T100MD+ User Manual for the MODBUS mapping details.

You can read from the power meters or other slave as often as you like by using a clock pulse (e.g. 1.0 second) to drive a {dCusF} function that contains the READMODBUS command.

If your power meter uses simple ASCII protocol you can use a modified NETCMD$ command to send an ASCII query string to it and it will return an ASCII response. You then can use the MID$ command to extract the data out from the response string.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Petty_boy

  • Jr. Member
  • **
  • Posts: 53
  • I'm a llama!
    • View Profile
Re:Modbus master and slave
« Reply #4 on: May 29, 2009, 07:49:14 AM »
Great thanks!

The modbus devices are all RTU.
« Last Edit: May 29, 2009, 08:11:17 AM by Petty_boy »