MODBUS_REPLY(3) Libmodbus Manual MODBUS_REPLY(3)NAME
modbus_reply - send a reponse to the received request
SYNOPSIS
*int modbus_reply(modbus_t *ctx, const uint8_t *req, int req_length, modbus_mapping_t *mb_mapping);
DESCRIPTION
The modbus_reply() function shall send a response to received request. The request req given in argument is analyzed, a response is then
built and sent by using the information of the modbus context ctx.
If the request indicates to read or write a value the operation will done in the modbus mapping mb_mapping according to the type of the
manipulated data.
If an error occurs, an exception response will be sent.
This function is designed for Modbus server.
RETURN VALUE
The modbus_reply() function shall return the length of the response sent if successful. Otherwise it shall return -1 and set errno.
ERRORS
EMBMDATA
Sending has failed
See also the errors returned by the syscall used to send the response (eg. send or write).
SEE ALSO modbus_reply_exception(3)libmodbus(7)AUTHORS
The libmodbus documentation was written by Stephane Raimbault <stephane.raimbault@gmail.com[1]>
NOTES
1. stephane.raimbault@gmail.com
mailto:stephane.raimbault@gmail.com
libmodbus 3.0.3 05/26/2012 MODBUS_REPLY(3)
Check Out this Related Man Page
MODBUS_MAPPING_NEW(3) Libmodbus Manual MODBUS_MAPPING_NEW(3)NAME
modbus_mapping_new - allocate four arrays of bits and registers
SYNOPSIS
modbus_mapping_t modbus_mapping_new(int nb_bits, int nb_input_bits, int nb_registers, int nb_input_registers);*
DESCRIPTION
The modbus_mapping_new() function shall allocate four arrays to store bits, input bits, registers and inputs registers. The pointers are
stored in modbus_mapping_t structure. All values of the arrays are initialized to zero.
If it isn't necessary to allocate an array for a specific type of data, you can pass the zero value in argument, the associated pointer
will be NULL.
This function is convenient to handle requests in a Modbus server/slave.
RETURN VALUE
The modbus_mapping_new() function shall return the new allocated structure if successful. Otherwise it shall return NULL and set errno.
ERRORS
ENOMEM
Not enough memory
EXAMPLE
/* The fist value of each array is accessible from the 0 address. */
mb_mapping = modbus_mapping_new(BITS_ADDRESS + BITS_NB,
INPUT_BITS_ADDRESS + INPUT_BITS_NB,
REGISTERS_ADDRESS + REGISTERS_NB,
INPUT_REGISTERS_ADDRESS + INPUT_REGISTERS_NB);
if (mb_mapping == NULL) {
fprintf(stderr, "Failed to allocate the mapping: %s
",
modbus_strerror(errno));
modbus_free(ctx);
return -1;
}
SEE ALSO modbus_mapping_free(3)AUTHORS
The libmodbus documentation was written by Stephane Raimbault <stephane.raimbault@gmail.com[1]>
NOTES
1. stephane.raimbault@gmail.com
mailto:stephane.raimbault@gmail.com
libmodbus 3.0.3 05/26/2012 MODBUS_MAPPING_NEW(3)
I am trying to write a korn shell script which posts commands to a server and read the response back from the server.
Any idea how I can read the servers response?
I have tried doing the following:
(
LOGIN:xxxxx
command to server
read ANSWER
echo $ANSWER >file1... (4 Replies)
Hi,
I just wanted send corbon copy in mailx command, could you please assist me?
I tried the below but it didn't work
cat sample.txt|mailx -s "hi" -c xyz@gmail.com abc@gmail.com
Shahnaz. (2 Replies)
How to know whether I am able to send email from unix server or not?
I ma trying to send mail to my gmail id using command
sendmail -s "Subject" abc@gmail.com
Hi
How are you?
.
It showed that You are not allowed to send mail.
My question is there any file which contains the list of... (0 Replies)
Gurus,
i am planning for HPUX CSA 0 095 Certification .has anyone holding any documentation/soft copy of any useful book.can you pls send it to my mail id saty172@gmail.com
rgds (0 Replies)
Hello ,
I want to send mail via bash script but i want to add from parameter
for example i want to send to test@gmail.com and the sender will be test2@gmail.com
Thanks for all (1 Reply)
I have a file 1.txt which has 3 mail ids as below:
Maillist=abc@gmail.com def@gmail.com rcg@gmail.com
Now I want to write a script which will read this file and send the mail to all the users present in this file. (6 Replies)
Dear community, I'm going crazy to convert TCP response to HEX using perl. I have a simple connection request where I send data, something like:
use strict;
use IO::Socket;
my $sock;
$sock = new IO::Socket::INET(
PeerAddr => '192.168.10.7',
PeerPort =>... (1 Reply)