Commit 31f779185d3d2a7b212b508ea321f4e449f3de85

Authored by Marc Haber
Committed by Stéphane Raimbault
1 parent d25150ac

cosmetic changes in man page standardizing itemization

Showing 1 changed file with 74 additions and 81 deletions
doc/libmodbus.txt
@@ -72,17 +72,17 @@ master (ortherwise other slaves may ignore master requests when one of the slave @@ -72,17 +72,17 @@ master (ortherwise other slaves may ignore master requests when one of the slave
72 is not responding). 72 is not responding).
73 73
74 Create a Modbus RTU context:: 74 Create a Modbus RTU context::
75 - linkmb:modbus_new_rtu[3] 75 + - linkmb:modbus_new_rtu[3]
76 76
77 77
78 Set the serial mode:: 78 Set the serial mode::
79 - linkmb:modbus_rtu_get_serial_mode[3]  
80 - linkmb:modbus_rtu_set_serial_mode[3]  
81 - linkmb:modbus_rtu_get_rts[3]  
82 - linkmb:modbus_rtu_set_rts[3]  
83 - linkmb:modbus_rtu_set_custom_rts[3]  
84 - linkmb:modbus_rtu_get_rts_delay[3]  
85 - linkmb:modbus_rtu_set_rts_delay[3] 79 + - linkmb:modbus_rtu_get_serial_mode[3]
  80 + - linkmb:modbus_rtu_set_serial_mode[3]
  81 + - linkmb:modbus_rtu_get_rts[3]
  82 + - linkmb:modbus_rtu_set_rts[3]
  83 + - linkmb:modbus_rtu_set_custom_rts[3]
  84 + - linkmb:modbus_rtu_get_rts_delay[3]
  85 + - linkmb:modbus_rtu_set_rts_delay[3]
86 86
87 87
88 TCP (IPv4) Context 88 TCP (IPv4) Context
@@ -92,7 +92,7 @@ TCP/IPv4 networks. It does not require a checksum calculation as lower layer @@ -92,7 +92,7 @@ TCP/IPv4 networks. It does not require a checksum calculation as lower layer
92 takes care of the same. 92 takes care of the same.
93 93
94 Create a Modbus TCP context:: 94 Create a Modbus TCP context::
95 - linkmb:modbus_new_tcp[3] 95 + - linkmb:modbus_new_tcp[3]
96 96
97 97
98 TCP PI (IPv4 and IPv6) Context 98 TCP PI (IPv4 and IPv6) Context
@@ -105,7 +105,7 @@ Contrary to the TCP IPv4 only backend, the TCP PI backend offers hostname @@ -105,7 +105,7 @@ Contrary to the TCP IPv4 only backend, the TCP PI backend offers hostname
105 resolution but it consumes about 1Kb of additional memory. 105 resolution but it consumes about 1Kb of additional memory.
106 106
107 Create a Modbus TCP context:: 107 Create a Modbus TCP context::
108 - linkmb:modbus_new_tcp_pi[3] 108 + - linkmb:modbus_new_tcp_pi[3]
109 109
110 110
111 Common 111 Common
@@ -115,65 +115,63 @@ Before using any libmodbus functions, the caller must allocate and initialize a @@ -115,65 +115,63 @@ Before using any libmodbus functions, the caller must allocate and initialize a
115 are provided to modify and free a 'context': 115 are provided to modify and free a 'context':
116 116
117 Free libmodbus context:: 117 Free libmodbus context::
118 - linkmb:modbus_free[3] 118 + - linkmb:modbus_free[3]
119 119
120 Set slave ID:: 120 Set slave ID::
121 - linkmb:modbus_set_slave[3] 121 + - linkmb:modbus_set_slave[3]
122 122
123 Enable debug mode:: 123 Enable debug mode::
124 - linkmb:modbus_set_debug[3] 124 + - linkmb:modbus_set_debug[3]
125 125
126 Timeout settings:: 126 Timeout settings::
127 - linkmb:modbus_get_byte_timeout[3]  
128 - linkmb:modbus_set_byte_timeout[3]  
129 - linkmb:modbus_get_response_timeout[3]  
130 - linkmb:modbus_set_response_timeout[3]  
131 - linkmb:modbus_get_indication_timeout[3]  
132 - linkmb:modbus_set_indication_timeout[3] 127 + - linkmb:modbus_get_byte_timeout[3]
  128 + - linkmb:modbus_set_byte_timeout[3]
  129 + - linkmb:modbus_get_response_timeout[3]
  130 + - linkmb:modbus_set_response_timeout[3]
133 131
134 Error recovery mode:: 132 Error recovery mode::
135 - linkmb:modbus_set_error_recovery[3] 133 + - linkmb:modbus_set_error_recovery[3]
136 134
137 Setter/getter of internal socket:: 135 Setter/getter of internal socket::
138 - linkmb:modbus_set_socket[3]  
139 - linkmb:modbus_get_socket[3] 136 + - linkmb:modbus_set_socket[3]
  137 + - linkmb:modbus_get_socket[3]
140 138
141 Information about header:: 139 Information about header::
142 - linkmb:modbus_get_header_length[3] 140 + - linkmb:modbus_get_header_length[3]
143 141
144 Macros for data manipulation:: 142 Macros for data manipulation::
145 143
146 -- MODBUS_GET_HIGH_BYTE(data), extracts the high byte from a byte  
147 -- MODBUS_GET_LOW_BYTE(data), extracts the low byte from a byte  
148 -- MODBUS_GET_INT64_FROM_INT16(tab_int16, index), builds an int64 from the four  
149 - first int16 starting at tab_int16[index]  
150 -- MODBUS_GET_INT32_FROM_INT16(tab_int16, index), builds an int32 from the two  
151 - first int16 starting at tab_int16[index]  
152 -- MODBUS_GET_INT16_FROM_INT8(tab_int8, index), builds an int16 from the two  
153 - first int8 starting at tab_int8[index]  
154 -- MODBUS_SET_INT16_TO_INT8(tab_int8, index, value), set an int16 value into  
155 - the two first bytes starting at tab_int8[index]  
156 -- MODBUS_SET_INT32_TO_INT16(tab_int16, index, value), set an int32 value into  
157 - the two first int16 starting at tab_int16[index]  
158 -- MODBUS_SET_INT64_TO_INT16(tab_int16, index, value), set an int64 value into  
159 - the four first int16 starting at tab_int16[index] 144 + - MODBUS_GET_HIGH_BYTE(data), extracts the high byte from a byte
  145 + - MODBUS_GET_LOW_BYTE(data), extracts the low byte from a byte
  146 + - MODBUS_GET_INT64_FROM_INT16(tab_int16, index), builds an int64 from the four
  147 + first int16 starting at tab_int16[index]
  148 + - MODBUS_GET_INT32_FROM_INT16(tab_int16, index), builds an int32 from the two
  149 + first int16 starting at tab_int16[index]
  150 + - MODBUS_GET_INT16_FROM_INT8(tab_int8, index), builds an int16 from the two
  151 + first int8 starting at tab_int8[index]
  152 + - MODBUS_SET_INT16_TO_INT8(tab_int8, index, value), set an int16 value into
  153 + the two first bytes starting at tab_int8[index]
  154 + - MODBUS_SET_INT32_TO_INT16(tab_int16, index, value), set an int32 value into
  155 + the two first int16 starting at tab_int16[index]
  156 + - MODBUS_SET_INT64_TO_INT16(tab_int16, index, value), set an int64 value into
  157 + the four first int16 starting at tab_int16[index]
160 158
161 Handling of bits and bytes:: 159 Handling of bits and bytes::
162 - linkmb:modbus_set_bits_from_byte[3]  
163 - linkmb:modbus_set_bits_from_bytes[3]  
164 - linkmb:modbus_get_byte_from_bits[3] 160 + - linkmb:modbus_set_bits_from_byte[3]
  161 + - linkmb:modbus_set_bits_from_bytes[3]
  162 + - linkmb:modbus_get_byte_from_bits[3]
165 163
166 Set or get float numbers:: 164 Set or get float numbers::
167 - linkmb:modbus_get_float_abcd[3]  
168 - linkmb:modbus_set_float_abcd[3]  
169 - linkmb:modbus_get_float_badc[3]  
170 - linkmb:modbus_set_float_badc[3]  
171 - linkmb:modbus_get_float_cdab[3]  
172 - linkmb:modbus_set_float_cdab[3]  
173 - linkmb:modbus_get_float_dcba[3]  
174 - linkmb:modbus_set_float_dcba[3]  
175 - linkmb:modbus_get_float[3] (deprecated)  
176 - linkmb:modbus_set_float[3] (deprecated) 165 + - linkmb:modbus_get_float_abcd[3]
  166 + - linkmb:modbus_set_float_abcd[3]
  167 + - linkmb:modbus_get_float_badc[3]
  168 + - linkmb:modbus_set_float_badc[3]
  169 + - linkmb:modbus_get_float_cdab[3]
  170 + - linkmb:modbus_set_float_cdab[3]
  171 + - linkmb:modbus_get_float_dcba[3]
  172 + - linkmb:modbus_set_float_dcba[3]
  173 + - linkmb:modbus_get_float[3] (deprecated)
  174 + - linkmb:modbus_set_float[3] (deprecated)
177 175
178 176
179 177
@@ -183,13 +181,13 @@ The following functions are provided to establish and close a connection with @@ -183,13 +181,13 @@ The following functions are provided to establish and close a connection with
183 Modbus devices: 181 Modbus devices:
184 182
185 Establish a connection:: 183 Establish a connection::
186 - linkmb:modbus_connect[3] 184 + - linkmb:modbus_connect[3]
187 185
188 Close a connection:: 186 Close a connection::
189 - linkmb:modbus_close[3] 187 + - linkmb:modbus_close[3]
190 188
191 Flush a connection:: 189 Flush a connection::
192 - linkmb:modbus_flush[3] 190 + - linkmb:modbus_flush[3]
193 191
194 192
195 Client 193 Client
@@ -199,50 +197,45 @@ them from/to remote devices. The following functions are used by the clients to @@ -199,50 +197,45 @@ them from/to remote devices. The following functions are used by the clients to
199 send Modbus requests: 197 send Modbus requests:
200 198
201 Read data:: 199 Read data::
202 - linkmb:modbus_read_bits[3]  
203 - linkmb:modbus_read_input_bits[3]  
204 - linkmb:modbus_read_registers[3]  
205 - linkmb:modbus_read_input_registers[3]  
206 - linkmb:modbus_report_slave_id[3] 200 + - linkmb:modbus_read_bits[3]
  201 + - linkmb:modbus_read_input_bits[3]
  202 + - linkmb:modbus_read_registers[3]
  203 + - linkmb:modbus_read_input_registers[3]
  204 + - linkmb:modbus_report_slave_id[3]
207 205
208 Write data:: 206 Write data::
209 - linkmb:modbus_write_bit[3]  
210 - linkmb:modbus_write_register[3]  
211 - linkmb:modbus_write_bits[3]  
212 - linkmb:modbus_write_registers[3] 207 + - linkmb:modbus_write_bit[3]
  208 + - linkmb:modbus_write_register[3]
  209 + - linkmb:modbus_write_bits[3]
  210 + - linkmb:modbus_write_registers[3]
213 211
214 Write and read data:: 212 Write and read data::
215 - linkmb:modbus_write_and_read_registers[3] 213 + - linkmb:modbus_write_and_read_registers[3]
216 214
217 Raw requests:: 215 Raw requests::
218 - linkmb:modbus_send_raw_request[3]  
219 - linkmb:modbus_receive_confirmation[3] 216 + - linkmb:modbus_send_raw_request[3]
  217 + - linkmb:modbus_receive_confirmation[3]
220 218
221 Reply an exception:: 219 Reply an exception::
222 - linkmb:modbus_reply_exception[3] 220 + - linkmb:modbus_reply_exception[3]
223 221
224 222
225 Server 223 Server
226 ~~~~~~ 224 ~~~~~~
227 The server is waiting for request from clients and must answer when it is 225 The server is waiting for request from clients and must answer when it is
228 -concerned by the request. 226 +concerned by the request. The libmodbus offers the following functions to
  227 +handle requests:
229 228
230 -In TCP mode, you must not use the usual linkmb:modbus_connect[3] to establish the connection but a pair of accept/listen calls::  
231 - linkmb:modbus_tcp_listen[3]  
232 - linkmb:modbus_tcp_accept[3]  
233 - linkmb:modbus_tcp_pi_listen[3]  
234 - linkmb:modbus_tcp_pi_accept[3] 229 +Data mapping::
  230 + - linkmb:modbus_mapping_new[3]
  231 + - linkmb:modbus_mapping_free[3]
235 232
236 -then the data can be received with::  
237 - linkmb:modbus_receive[3] 233 +Receive::
  234 + - linkmb:modbus_receive[3]
238 235
239 -and a response can be send with::  
240 - linkmb:modbus_reply[3]  
241 - linkmb:modbus_reply_exception[3]  
242 -  
243 -To handle the mapping of your Modbus data, you must use:  
244 - linkmb:modbus_mapping_new[3]  
245 - linkmb:modbus_mapping_free[3] 236 +Reply::
  237 + - linkmb:modbus_reply[3]
  238 + - linkmb:modbus_reply_exception[3]
246 239
247 240
248 ERROR HANDLING 241 ERROR HANDLING