modbus_mask_write_register.txt 917 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. modbus_mask_write_register(3)
  2. =============================
  3. NAME
  4. ----
  5. modbus_mask_write_register - mask a single register
  6. SYNOPSIS
  7. --------
  8. *int modbus_mask_write_register(modbus_t *'ctx', int 'addr', uint16_t 'and', uint16_t 'or');*
  9. DESCRIPTION
  10. -----------
  11. The *modbus_mask_write_register()* function shall modify the value of the
  12. holding register at the address 'addr' of the remote device using the algorithm:
  13. new value = (current value AND 'and') OR ('or' AND (NOT 'and'))
  14. The function uses the Modbus function code 0x16 (mask single register).
  15. RETURN VALUE
  16. ------------
  17. The function shall return 1 if successful. Otherwise it shall return -1 and set
  18. errno.
  19. SEE ALSO
  20. --------
  21. linkmb:modbus_read_registers[3]
  22. linkmb:modbus_write_registers[3]
  23. AUTHORS
  24. -------
  25. Martijn de Gouw <martijn.de.gouw@prodrive.nl>
  26. The libmodbus documentation was written by Stéphane Raimbault
  27. <stephane.raimbault@gmail.com>