1
- /*
1
+ /*
2
2
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
3
3
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
4
4
* All rights reserved.
@@ -71,7 +71,7 @@ PR_BEGIN_EXTERN_C
71
71
/*! \ingroup modbus
72
72
* \brief Use the default Modbus TCP port (502)
73
73
*/
74
- #define MB_TCP_PORT_USE_DEFAULT 0
74
+ #define MB_TCP_PORT_USE_DEFAULT 0
75
75
76
76
/* ----------------------- Type definitions ---------------------------------*/
77
77
@@ -97,7 +97,7 @@ PR_BEGIN_EXTERN_C
97
97
* registers should be updated and reading means that the modbus protocol
98
98
* stack needs to know the current register values.
99
99
*
100
- * \see eMBRegHoldingCB( ), eMBRegCoilsCB( ), eMBRegDiscreteCB( ) and
100
+ * \see eMBRegHoldingCB( ), eMBRegCoilsCB( ), eMBRegDiscreteCB( ) and
101
101
* eMBRegInputCB( ).
102
102
*/
103
103
typedef enum
@@ -142,7 +142,7 @@ typedef enum
142
142
*
143
143
* \return If no error occurs the function returns eMBErrorCode::MB_ENOERR.
144
144
* The protocol is then in the disabled state and ready for activation
145
- * by calling eMBEnable( ). Otherwise one of the following error codes
145
+ * by calling eMBEnable( ). Otherwise one of the following error codes
146
146
* is returned:
147
147
* - eMBErrorCode::MB_EINVAL If the slave address was not valid. Valid
148
148
* slave addresses are in the range 1 - 247.
@@ -171,10 +171,10 @@ eMBErrorCode eMBTCPInit( USHORT usTCPPort );
171
171
* \brief Release resources used by the protocol stack.
172
172
*
173
173
* This function disables the Modbus protocol stack and release all
174
- * hardware resources. It must only be called when the protocol stack
175
- * is disabled.
174
+ * hardware resources. It must only be called when the protocol stack
175
+ * is disabled.
176
176
*
177
- * \note Note all ports implement this function. A port which wants to
177
+ * \note Note all ports implement this function. A port which wants to
178
178
* get an callback must define the macro MB_PORT_HAS_CLOSE to 1.
179
179
*
180
180
* \return If the resources where released it return eMBErrorCode::MB_ENOERR.
@@ -189,8 +189,8 @@ eMBErrorCode eMBClose( void );
189
189
* This function enables processing of Modbus frames. Enabling the protocol
190
190
* stack is only possible if it is in the disabled state.
191
191
*
192
- * \return If the protocol stack is now in the state enabled it returns
193
- * eMBErrorCode::MB_ENOERR. If it was not in the disabled state it
192
+ * \return If the protocol stack is now in the state enabled it returns
193
+ * eMBErrorCode::MB_ENOERR. If it was not in the disabled state it
194
194
* return eMBErrorCode::MB_EILLSTATE.
195
195
*/
196
196
eMBErrorCode eMBEnable ( void );
@@ -200,7 +200,7 @@ eMBErrorCode eMBEnable( void );
200
200
*
201
201
* This function disables processing of Modbus frames.
202
202
*
203
- * \return If the protocol stack has been disabled it returns
203
+ * \return If the protocol stack has been disabled it returns
204
204
* eMBErrorCode::MB_ENOERR. If it was not in the enabled state it returns
205
205
* eMBErrorCode::MB_EILLSTATE.
206
206
*/
@@ -212,10 +212,10 @@ eMBErrorCode eMBDisable( void );
212
212
* This function must be called periodically. The timer interval required
213
213
* is given by the application dependent Modbus slave timeout. Internally the
214
214
* function calls xMBPortEventGet() and waits for an event from the receiver or
215
- * transmitter state machines.
215
+ * transmitter state machines.
216
216
*
217
217
* \return If the protocol stack is not in the enabled state the function
218
- * returns eMBErrorCode::MB_EILLSTATE. Otherwise it returns
218
+ * returns eMBErrorCode::MB_EILLSTATE. Otherwise it returns
219
219
* eMBErrorCode::MB_ENOERR.
220
220
*/
221
221
eMBErrorCode eMBPoll ( void );
@@ -249,7 +249,7 @@ eMBErrorCode eMBSetSlaveID( UCHAR ucSlaveID, BOOL xIsRunning,
249
249
* The callback handler supplied is responsible for interpreting the Modbus PDU and
250
250
* the creation of an appropriate response. In case of an error it should return
251
251
* one of the possible Modbus exceptions which results in a Modbus exception frame
252
- * sent by the protocol stack.
252
+ * sent by the protocol stack.
253
253
*
254
254
* \param ucFunctionCode The Modbus function code for which this handler should
255
255
* be registers. Valid function codes are in the range 1 to 127.
@@ -262,7 +262,7 @@ eMBErrorCode eMBSetSlaveID( UCHAR ucSlaveID, BOOL xIsRunning,
262
262
* case the values in mbconfig.h should be adjusted. If the argument was not
263
263
* valid it returns eMBErrorCode::MB_EINVAL.
264
264
*/
265
- eMBErrorCode eMBRegisterCB ( UCHAR ucFunctionCode ,
265
+ eMBErrorCode eMBRegisterCB ( UCHAR ucFunctionCode ,
266
266
pxMBFunctionHandler pxHandler );
267
267
268
268
/* ----------------------- Callback -----------------------------------------*/
@@ -300,7 +300,7 @@ eMBErrorCode eMBRegisterCB( UCHAR ucFunctionCode,
300
300
* - eMBErrorCode::MB_ENOERR If no error occurred. In this case a normal
301
301
* Modbus response is sent.
302
302
* - eMBErrorCode::MB_ENOREG If the application can not supply values
303
- * for registers within this range. In this case a
303
+ * for registers within this range. In this case a
304
304
* <b>ILLEGAL DATA ADDRESS</b> exception frame is sent as a response.
305
305
* - eMBErrorCode::MB_ETIMEDOUT If the requested register block is
306
306
* currently not available and the application dependent response
@@ -324,18 +324,18 @@ eMBErrorCode eMBRegInputCB( UCHAR * pucRegBuffer, USHORT usAddress,
324
324
* this buffer.
325
325
* \param usAddress The starting address of the register.
326
326
* \param usNRegs Number of registers to read or write.
327
- * \param eMode If eMBRegisterMode::MB_REG_WRITE the application register
327
+ * \param eMode If eMBRegisterMode::MB_REG_WRITE the application register
328
328
* values should be updated from the values in the buffer. For example
329
- * this would be the case when the Modbus master has issued an
329
+ * this would be the case when the Modbus master has issued an
330
330
* <b>WRITE SINGLE REGISTER</b> command.
331
- * If the value eMBRegisterMode::MB_REG_READ the application should copy
331
+ * If the value eMBRegisterMode::MB_REG_READ the application should copy
332
332
* the current values into the buffer \c pucRegBuffer.
333
333
*
334
334
* \return The function must return one of the following error codes:
335
335
* - eMBErrorCode::MB_ENOERR If no error occurred. In this case a normal
336
336
* Modbus response is sent.
337
337
* - eMBErrorCode::MB_ENOREG If the application can not supply values
338
- * for registers within this range. In this case a
338
+ * for registers within this range. In this case a
339
339
* <b>ILLEGAL DATA ADDRESS</b> exception frame is sent as a response.
340
340
* - eMBErrorCode::MB_ETIMEDOUT If the requested register block is
341
341
* currently not available and the application dependent response
@@ -370,7 +370,7 @@ eMBErrorCode eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress,
370
370
* - eMBErrorCode::MB_ENOERR If no error occurred. In this case a normal
371
371
* Modbus response is sent.
372
372
* - eMBErrorCode::MB_ENOREG If the application does not map an coils
373
- * within the requested address range. In this case a
373
+ * within the requested address range. In this case a
374
374
* <b>ILLEGAL DATA ADDRESS</b> is sent as a response.
375
375
* - eMBErrorCode::MB_ETIMEDOUT If the requested register block is
376
376
* currently not available and the application dependent response
@@ -399,7 +399,7 @@ eMBErrorCode eMBRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress,
399
399
* - eMBErrorCode::MB_ENOERR If no error occurred. In this case a normal
400
400
* Modbus response is sent.
401
401
* - eMBErrorCode::MB_ENOREG If no such discrete inputs exists.
402
- * In this case a <b>ILLEGAL DATA ADDRESS</b> exception frame is sent
402
+ * In this case a <b>ILLEGAL DATA ADDRESS</b> exception frame is sent
403
403
* as a response.
404
404
* - eMBErrorCode::MB_ETIMEDOUT If the requested register block is
405
405
* currently not available and the application dependent response
0 commit comments