X hits on this document

88 views

0 shares

0 downloads

0 comments

37 / 37

MODBUS Communications Driver - Functions

WriteRegister: Write Single Register

SYNOPSIS

status

Error Return

Integer

Address

Destination Address

Integer

Register

Target Register

Long Integer

Value

New Value

Integer

DESCRIPTION

short status = MB WriteRegister(short Address, long Register, short Value); _

This command changes the value of a single Holding register (address 4xxxx) on the MODBUS device.

EXAMPLE

short status = MB WriteRegister(5, 40116, 120);

_

if (status != 0)

MessageBox(NULL MB_OK); else MessageBox(NULL

, MB ErrorString(status),

"WriteRegister Error",

_

,

"Device 5 register 40116 set to 120",

"Write Register", MB OK);

_

Revision 2.210

June 6, 1998

Page 29

Document info
Document views88
Page views90
Page last viewedSun Dec 04 19:19:14 UTC 2016
Pages37
Paragraphs781
Words6172

Comments