Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

modbus_read_input_registers(3) [debian man page]

MODBUS_READ_INPUT_RE(3) 					 Libmodbus Manual					   MODBUS_READ_INPUT_RE(3)

NAME
modbus_read_input_registers - read many input registers SYNOPSIS
int modbus_read_input_registers(modbus_t *ctx, int addr, int nb, uint16_t *dest); DESCRIPTION
The modbus_read_input_registers() function shall read the content of the nb input registers to address addr of the remote device. The result of the reading is stored in dest array as word values (16 bits). You must take care to allocate enough memory to store the results in dest (at least nb * sizeof(uint16_t)). The function uses the Modbus function code 0x04 (read input registers). The holding registers and input registers have different historical meaning, but nowadays it's more common to use holding registers only. RETURN VALUE
The modbus_read_input_registers() function shall return the number of read input registers if successful. Otherwise it shall return -1 and set errno. ERRORS
EMBMDATA Too many bits requested SEE ALSO
modbus_read_input_bits(3) modbus_write_register(3) modbus_write_registers(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_READ_INPUT_RE(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)
Man Page

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to read and write device registers

hello friends, While in the process of writing device drivers, i am facing problem in reading and writing device registers.I got base address of those mapped device registers. Can i add offset of those registers to that Base address to get access of those... (1 Reply)
Discussion started by: sriram.ec
1 Replies

2. HP-UX

Hpux Csa -hp 0 095

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)
Discussion started by: pksnairg
0 Replies

3. Shell Programming and Scripting

communication between shell and and a demon 'c' program

Hello, i have a demon 'c' program that have a dynamic table of logic registers ( 2000 variables ). exemple of registers: I1.34.5 M23.4.1 I want from shell acess to this table of registers. How can i do this? with something like for read I1.34.5: #cat... (3 Replies)
Discussion started by: rzyz
3 Replies

4. UNIX for Advanced & Expert Users

vi register info

I found this to be a confusing subject so I wanted to share what I have learned. I finally figured it out from this website. vi editor FAQ (Frequently Asked Question List), Part 1/2 You MUST include the single double quotation in this. Obviously <letter> with any letter you feel like. ... (1 Reply)
Discussion started by: cokedude
1 Replies

5. Shell Programming and Scripting

Send a mail to multiple users

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)
Discussion started by: Vivekit82
6 Replies