Internet PLC Forum

General => Technical support => Topic started by: Alan on April 16, 2003, 03:05:44 PM

Title: WRITEMODBUS command
Post by: Alan 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
Title: Re: WRITEMODBUS command
Post by: support 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.

Title: Re: WRITEMODBUS command
Post by: Alan on April 17, 2003, 06:21:10 AM
I see.  What Function Code does READMODBUS use?
Title: Re: WRITEMODBUS command
Post by: support 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.