X hits on this document

134 views

0 shares

0 downloads

0 comments

30 / 37

MODBUS Communications Driver - Functions

ReadInputRegisters: Read Input Registers

SYNOPSIS

short status = MB_ReadInputRegisters(short Address, long Start, short Count, short Values[]);

status Address Start Count Values

Error Return Destination Address Starting Register No. Number of Registers to Read Return Array

Integer Integer Long Integer Integer < 120 Integer Array

DESCRIPTION

This command is analogous to the Read Output Registers command, except it returns the values of Input Registers, one register per return array element. The Driver permits you to read up to 120 registers in one operation, though your MODBUS device may require shorter requests.

EXAMPLE

short regs[10];

// Return value array

short status = MB ReadInputRegisters(5, 30227, 3, regs);

_

if (status != 0) MessageBox(NULL, MB ErrorString(status), MB_OK); _

"ReadInputRegisters Error",

Page 22

June 6, 1998

Revision 2.210

Document info
Document views134
Page views136
Page last viewedSun Jan 22 02:17:19 UTC 2017
Pages37
Paragraphs781
Words6172

Comments