Skip to content

Commit

Permalink
formating to fit wm/man defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
vat9 committed Jul 28, 2011
1 parent 8b83f6c commit 3f417a0
Showing 1 changed file with 55 additions and 48 deletions.
103 changes: 55 additions & 48 deletions man/2/modbus
Original file line number Diff line number Diff line change
Expand Up @@ -11,70 +11,70 @@ modbus->init();

TMmsg: adt {
frame: int;
addr: int; # 1 or 2 bytes
check: int; # 0 or 2 bytes
addr: int; # 1 or 2 bytes
check: int; # 0 or 2 bytes
pick {
Readerror =>
error: string;
Error =>
fcode: byte;
ecode: byte;
Readcoils =>
offset: int; # 2 bytes, 0x0000 to 0xFFFF
quantity: int; # 2 bytes, 0x0001 to 0x07D0
offset: int; # 2 bytes, 0x0000 to 0xFFFF
quantity: int; # 2 bytes, 0x0001 to 0x07D0
Readdiscreteinputs =>
offset: int;
quantity: int;
Readholdingregisters =>
offset: int;
quantity: int; # 2 bytes, 0x0001 to 0x007D
quantity: int; # 2 bytes, 0x0001 to 0x007D
Readinputregisters =>
offset: int;
quantity: int; # 2 bytes, 0x0001 to 0x007D
quantity: int; # 2 bytes, 0x0001 to 0x007D
Writecoil =>
offset: int;
value: int; # 2 bytes 0x0000 or 0xFF00
value: int; # 2 bytes 0x0000 or 0xFF00
Writeregister =>
offset: int;
value: int; # 2 bytes 0x0000 to 0xFFFF
value: int; # 2 bytes 0x0000 to 0xFFFF
Readexception =>
s: string; # not used
s: string; # not used
Diagnostics =>
subf: int; # 2 bytes, sub-function type
data: int; # 2 bytes
subf: int; # 2 bytes, sub-function type
data: int; # 2 bytes
Commeventcounter =>
s: string; # not used
s: string; # not used
Commeventlog =>
s: string; # not used
s: string; # not used
Writecoils =>
offset: int;
quantity: int;
count: int;
data: array of byte;
Writeregisters =>
offset: int;
quantity: int; # 2 bytes, 0x0001 to 0x007B
count: int; # 1 byte
quantity: int; # 2 bytes, 0x0001 to 0x007B
count: int; # 1 byte
data: array of byte;
Slaveid =>
s: string; # not used
s: string; # not used
Readfilerecord =>
count: int; # 1 byte, 0x07 to 0xF5
count: int; # 1 byte, 0x07 to 0xF5
data: array of byte;
Writefilerecord =>
count: int; # 1 byte, 0x09 to 0xFB
count: int; # 1 byte, 0x09 to 0xFB
data: array of byte;
Maskwriteregister =>
offset: int; # 2 bytes
andmask: int; # 2 bytes
ormask: int; # 2 bytes
offset: int; # 2 bytes
andmask: int; # 2 bytes
ormask: int; # 2 bytes
Rwregisters =>
roffset: int; # 2 bytes
rquantity: int; # 2 bytes
woffset: int; # 2 bytes
wquantity: int; # 2 bytes
count: int; # 1 byte
data: array of byte; # 2 * count
roffset: int; # 2 bytes
rquantity: int; # 2 bytes
woffset: int; # 2 bytes
wquantity: int; # 2 bytes
count: int; # 1 byte
data: array of byte; # 2 * count
Readfifo =>
offset: int;
Encapsulatedtransport =>
Expand Down Expand Up @@ -102,16 +102,16 @@ RMmsg: adt {
ecode: byte;
Readcoils =>
count: int;
data: array of byte; # coil status
data: array of byte; # coil status
Readdiscreteinputs =>
count: int;
data: array of byte; # inputs
data: array of byte; # inputs
Readholdingregisters =>
count: int;
data: array of byte; # registers, N (of N/2 words)
data: array of byte; # registers, N (of N/2 words)
Readinputregisters =>
count: int;
data: array of byte; # input registers, N (of N/2 words)
data: array of byte; # input registers, N (of N/2 words)
Writecoil =>
offset: int;
value: int;
Expand All @@ -121,42 +121,42 @@ RMmsg: adt {
Readexception =>
data: byte;
Diagnostics =>
subf: int; # 2 bytes, sub-function type
subf: int; # 2 bytes, sub-function type
data: int;
Commeventcounter =>
status: int; # 2 bytes
count: int; # 2 bytes
status: int; # 2 bytes
count: int; # 2 bytes
Commeventlog =>
count: int; # 1 byte
status: int; # 2 bytes
ecount: int; # 2 bytes
mcount: int; # 2 bytes
data: array of byte; # events: (N-6) * byte
count: int; # 1 byte
status: int; # 2 bytes
ecount: int; # 2 bytes
mcount: int; # 2 bytes
data: array of byte; # events: (N-6) * byte
Writecoils =>
offset: int;
quantity: int; # 2 bytes, 0x0001 to 0x07B0
quantity: int; # 2 bytes, 0x0001 to 0x07B0
Writeregisters =>
offset: int;
quantity: int;
Slaveid =>
count: int;
data: array of byte; # device specific
data: array of byte; # device specific
Readfilerecord =>
count: int; # 1 byte, 0x07 to 0xF5
count: int; # 1 byte, 0x07 to 0xF5
data: array of byte;
Writefilerecord =>
count: int;
data: array of byte;
Maskwriteregister =>
offset: int; # 2 bytes
andmask: int; # 2 bytes
ormask: int; # 2 bytes
offset: int; # 2 bytes
andmask: int; # 2 bytes
ormask: int; # 2 bytes
Rwregisters =>
count: int;
data: array of byte;
Readfifo =>
count: int; # 2 bytes
fcount: int; # 2 bytes, ≤31
count: int; # 2 bytes
fcount: int; # 2 bytes, ≤31
data: array of byte;
Encapsulatedtransport =>
meitype: byte;
Expand Down Expand Up @@ -189,7 +189,9 @@ to handle the response message. End user programs will need to target the
specific coils and registers for the device in question. For example:
.PP
.EX
m := ref TMmsg.Readholdingregisters(Modbus->FrameRTU, p.maddr, -1, 16r1305, 16r0009);
m := ref TMmsg.Readholdingregisters(Modbus->FrameRTU,
p.maddr, -1,
16r1305, 16r0009);
write(fd, m.pack());
.EE
.PP
Expand All @@ -208,5 +210,10 @@ valid
.B appl/lib/modbus.b
.br
.B appl/cmd/testmodbus.b

.SH "SEE ALSO"
``MODBUS Application Protocol Specification v1.1b'',
.B http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf

.SH BUGS
Not enough time in 3.5 characters to mention them all.

0 comments on commit 3f417a0

Please sign in to comment.