Author Topic: communicating with modbus-rtu device  (Read 10977 times)

Allan

  • Guest
communicating with modbus-rtu device
« on: June 05, 2002, 12:06:59 PM »
Hi
We have a 5V analogue input/ RS-485 output MODBUS-RTU device connected to T100MD888+ via COMM3 port.  We using a voltage source to simulate an input to the device and are attempting to monitor this known input signal via the PLC.

We're novices in using the MODBUS protocol and would appreciate some pointers to get started.

The READMODBUS command in the TBASIC reference manual gives an example of how to query a MODBUS-ASCII device.  Are there any examples on how to query an RTU device?

Just communicating with the device is a challenge for us.  Assuming we can eventually read the 16-bit data from the MODBUS device into one of the PLC's relay channels, the next challenge for us is the bit level manipulation using ladder logic to get back to the analogue voltage value.  Any pointers/ examples on how to do this?

Allan & Nuri:'(
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: communicating with modbus-rtu device
« Reply #1 on: June 06, 2002, 07:51:29 AM »
To read from a MODBUS RTU device via COMM3, use the form:

 ? DM[1] = READMODBUS(13, ......)

When the port number is 13, it means to use RTU protocol via COMM3. Likewise, for RTU via COMM1, use port number 11 instead of 1.

Once you have read the value into the DM[1] (just a 16-bit memory variable), that already represents the signal strength at the RTU's analog input. ?The full range depends on the resolution of your RTU's ADC and you should consult the technical spec of your RTU device. Most likely if it is a 12-bit device, the range would be from 0 to 4096, with 0 correspond to 0V and 4096 correspond to 5V. Some ADCs also cover negative range(e.g. -2048 to +2048 ) so it really depends on the device itself.

I don't ?see why you need to read analog value into relay channel and use ladder logic to manipulate? You may need to do that for other PLC brands such as AB or Omron, but not for our M-series PLC - The TBASIC language is totally comfortable in handling the value read from your RTU :)!
« Last Edit: December 31, 1969, 04:00:06 PM by -1 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS