Author Topic: Modbus gateway  (Read 5558 times)

JRobinson

  • Newbie
  • Posts: 13
    • View Profile
Modbus gateway
« on: May 03, 2014, 06:47:26 PM »
I am using the FMD88-10 in a number of sites. One function is to act as Modbus master to a number of slave devices. One of the devices I also access (for diagnosis) using the gateway function from the TCP port. This works fine with read register (03) and write registers (06, hex 10) function codes. I am also using the EIT function code (hex 2B). This is transferred to the 485 bus from the IP successfully but when the device responds, only a single byte, the address is transferred back to the IP side. Question, is the gateway function only available for the modbus register read and write commands? I am hoping the gateway wasn't interpreting function codes.

Second gateway question. The device responds to an unimplemented function code (03) with an exception code of 01. The seems to be translated in the gateway to hex 0B. Is this intended?

Thanks for the help

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3170
    • View Profile
    • Internet Programmable PLCs
Re:Modbus gateway
« Reply #1 on: May 04, 2014, 06:49:36 AM »
The Modbus gateway feature supports only pass through of the following function codes to the RTU slaves:

01, 02, 03, 04, 05, 06, 15, 16, 22, 23.  

Other unsupported function codes (you mentioned 2B hex?) should not be used with the gateway.

Note that the gateway actually also supports remote programming of other TRI PLCs that are connected to the gateway via RS485/232 as slave. However, only one type of protocol (modbus or hostlink command) may be used at a time on the same comm port.
« Last Edit: May 04, 2014, 06:50:00 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

JRobinson

  • Newbie
  • Posts: 13
    • View Profile
Re:Modbus gateway
« Reply #2 on: May 04, 2014, 09:18:56 PM »
Thanks for the timely response. The gateway function works well using the standard function codes now.

I also noted that Exception responses, returned by our slave device with an exception code of 01, have the exception code translated to 0B consistently by the gateway. Is this expected? I understand the 0B code is used by the FMD gateway to indicate timeout but the response is within 30msec so this isn't the case.

Thanks again for your help



support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3170
    • View Profile
    • Internet Programmable PLCs
Re:Modbus gateway
« Reply #3 on: May 05, 2014, 07:00:58 AM »
The exception code of &H0B is returned if either the slave did not respond (time out) or respond with an invalid response code.

The gateway returns an exception code of 06 if the slave is busy or it receives more than one Modbus gateway request during a single scan of the ladder logic. That is to prevent the CPU from spending too much time servicing gateway request so that the CPU can focus on its main function, which is to control the equipment or process.
« Last Edit: May 05, 2014, 07:01:53 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS