Commit 561700b0e41a131930473e864374dc1ef8b56b71
Committed by
Stéphane Raimbault
1 parent
c4290368
Add documentation for modbus_mask_write_register (closes #91)
Showing
2 changed files
with
40 additions
and
0 deletions
doc/Makefile.am
| @@ -14,6 +14,7 @@ MAN3 = \ | @@ -14,6 +14,7 @@ MAN3 = \ | ||
| 14 | modbus_get_socket.3 \ | 14 | modbus_get_socket.3 \ |
| 15 | modbus_mapping_free.3 \ | 15 | modbus_mapping_free.3 \ |
| 16 | modbus_mapping_new.3 \ | 16 | modbus_mapping_new.3 \ |
| 17 | + modbus_mask_write_register.3 \ | ||
| 17 | modbus_new_rtu.3 \ | 18 | modbus_new_rtu.3 \ |
| 18 | modbus_new_tcp_pi.3 \ | 19 | modbus_new_tcp_pi.3 \ |
| 19 | modbus_new_tcp.3 \ | 20 | modbus_new_tcp.3 \ |
doc/modbus_mask_write_register.txt
0 → 100644
| 1 | +modbus_mask_write_register(3) | ||
| 2 | +============================= | ||
| 3 | + | ||
| 4 | + | ||
| 5 | +NAME | ||
| 6 | +---- | ||
| 7 | +modbus_mask_write_register - mask a single register | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +SYNOPSIS | ||
| 11 | +-------- | ||
| 12 | +*int modbus_mask_write_register(modbus_t *'ctx', int 'addr', uint16_t 'and', uint16_t 'or');* | ||
| 13 | + | ||
| 14 | + | ||
| 15 | +DESCRIPTION | ||
| 16 | +----------- | ||
| 17 | +The _modbus_mask_write_register()_ function shall modify the value of the | ||
| 18 | +holding register at the address 'addr' of the remote device using the algorithm: | ||
| 19 | +new value = (current value AND 'and') OR ('or' AND (NOT 'and')) | ||
| 20 | + | ||
| 21 | +The function uses the Modbus function code 0x16 (mask single register). | ||
| 22 | + | ||
| 23 | + | ||
| 24 | +RETURN VALUE | ||
| 25 | +------------ | ||
| 26 | +The _modbus_mask_write_register()_ function shall return 1 if successful. Otherwise | ||
| 27 | +it shall return -1 and set errno. | ||
| 28 | + | ||
| 29 | + | ||
| 30 | +SEE ALSO | ||
| 31 | +-------- | ||
| 32 | +linkmb:modbus_read_registers[3] | ||
| 33 | +linkmb:modbus_write_registers[3] | ||
| 34 | + | ||
| 35 | + | ||
| 36 | +AUTHORS | ||
| 37 | +------- | ||
| 38 | +The libmodbus documentation was written by Stéphane Raimbault | ||
| 39 | +<stephane.raimbault@gmail.com> |