X hits on this document

85 views

0 shares

0 downloads

0 comments

36 / 37

MODBUS Communications Driver - Functions

status

Error Return

Integer

Address

Destination Address

Integer

Start

Starting Register No.

Long Integer

Count

Count

Integer < 120

Values

Data

Integer Array

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

DESCRIPTION

Assigns values from Values to Count consecutive Holding registers (address 4xxxx) starting with the register specified by Start. The Driver permits you to transmit up to 120 registers in one operation, but your MODBUS device may have a lower limit.

SYNOPSIS

WriteMultipleRegisters: Write Multiple Registers

EXAMPLE

short regs[10];

// Value array

regs[0] = 10; regs[1] = 20; regs[2] = 30;

// Set up register values

short status = MB WriteMultipleRegisters(7, 40118, 3, regs);

_

if (status != 0) MessageBox(NULL, MB_ErrorString(status), "WriteMultipleRegisters Error", MB_OK);

Page 28

June 6, 1998

Revision 2.210

Document info
Document views85
Page views87
Page last viewedSun Dec 04 04:42:23 UTC 2016
Pages37
Paragraphs781
Words6172

Comments