Internet PLC Forum

General => Technical support => Topic started by: pjuangph on July 02, 2012, 07:10:07 AM

Title: Clearing Output using Modbus
Post by: pjuangph on July 02, 2012, 07:10:07 AM
WriteModbus sets the bit of the slave device but what about setting the bit to 0. Is there a way for me to clear the bit?
Title: Re:Clearing Output using Modbus
Post by: support on July 02, 2012, 10:10:37 AM
WRITEMODBUS command uses Modbus function 16 to write to the slave 16 bit at a time. So it depends on what data you write to the slave it can be 0 or 1 at any bit position. Remember that it is not setting a single bit, but setting 16-bit.

E.g. if the slave is another FMD or Nano-10 PLC and you WRITEMODBUS to the register 16 it will set outputs #1 to #16 simultaneously. However notes that any output that is under control of the PLC program will only be changed for one scan time and the next I/O update it will be set back to the ON/OFF value computed by the PLC program.