Author Topic: WRITEMODBUS command  (Read 10757 times)

Alan

  • Guest
WRITEMODBUS command
« on: April 16, 2003, 03:05:44 PM »
I would like to use WRITEMODBUS to set a DO on a remote RTU.  The Modbus RTU command is:
              03 05 0000 FF00 ~2 byteCRC~
        (ID3,Command5,Address0,set on=255

I have configured Com 1 on the T100MD to SETPROTOCOL 1,3 and I am communicating fine over RF with the RTU at 9600.

How do I configure WRITEMODBUS for this command?

Alan
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: WRITEMODBUS command
« Reply #1 on: April 16, 2003, 06:41:23 PM »
Sorry, the WRITEMODBUS command only send out using MODBUS function 16 and not function 05.  Please consult your RTU supplier on how to address the DO using function 16 which is the most generic form of MODBUS command and should be supported by any RTU claimed to be MODBUS compliant.

If you are able to compute the CRC16, then you can also choose to send out MODBUS command using the OUTCOMM. First store the bytes inside the DMs and then use a FOR..NEXT loop to send out one byte at a time.

« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Alan

  • Guest
Re: WRITEMODBUS command
« Reply #2 on: April 17, 2003, 06:21:10 AM »
I see.  What Function Code does READMODBUS use?
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: WRITEMODBUS command
« Reply #3 on: April 17, 2003, 06:45:48 AM »
READMODBUS uses function code 03 to read 16-bit register from a MODBUS slave.

Note that if your slave is RTU, the COMM port number to use is 11 for communicaiton via COMM1 and 13 for communication via COMM3.
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS