GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MODBUS_RECEIVE_CONFI(3) libmodbus Manual MODBUS_RECEIVE_CONFI(3)

modbus_receive_confirmation - receive a confirmation request

int modbus_receive_confirmation(modbus_t *ctx, uint8_t *rsp);

The modbus_receive_confirmation() function shall receive a request via the socket of the context ctx. This function must be used for debugging purposes because the received response isn’t checked against the initial request. This function can be used to receive request not handled by the library.

The maximum size of the response depends on the used backend, in RTU the rsp array must be MODBUS_RTU_MAX_ADU_LENGTH bytes and in TCP it must be MODBUS_TCP_MAX_ADU_LENGTH bytes. If you want to write code compatible with both, you can use the constant MODBUS_MAX_ADU_LENGTH (maximum value of all libmodbus backends). Take care to allocate enough memory to store responses to avoid crashes of your server.

The function shall store the confirmation request in rsp and return the response length if sucessful. The returned request length can be zero if the indication request is ignored (eg. a query for another slave in RTU mode). Otherwise it shall return -1 and set errno.

uint8_t rsp[MODBUS_MAX_ADU_LENGTH];
rc = modbus_receive_confirmation(ctx, rsp);

modbus_send_raw_request(3)

The libmodbus documentation was written by Stéphane Raimbault <stephane.raimbault@gmail.com>
04/09/2022 libmodbus v3.1.6

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.