Author Topic: Clearing Output using Modbus  (Read 10677 times)

pjuangph

  • Newbie
  • Posts: 7
  • I'm a llama!
    • View Profile
Clearing Output using Modbus
« 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?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Clearing Output using Modbus
« Reply #1 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.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS