beautypg.com

B&B Electronics MODSCAN32 - Manual User Manual

Page 17

background image

17

READ OUTPUT STATUS (FUNCTION CODE 01)

This function allows the user to obtain the ON/OFF status of logic coils used to control discrete outputs
from the addressed slave only. Broadcast mode is not supported with this function code. In addition to the
slave address and function fields, the message requires that the information field contain the initial coil
address to be read, (Starting Address), and the number of locations that will be interrogated to obtain status
data.

The addressing allows up to 2000 coils to be obtained at each request; however, the specific slave device
may have restrictions that lower the maximum quantity. The coils are numbered from zero; (coil number 1
is address 0000, coil number 2 is address 0001, etc.)

The following is an example of a message to Read Output Status Coils 20-56 from slave device number 17.

ADDR

FUNC

DATA
START
PT HO

DATA
START
PT LO

DATA #
OF PTS
HO

DATA #
OF PTS
LO

ERROR
CHECK
FIELD

11

01

00

13

00

25

B6


An example response to Read Output Status is shown below. The data is packed one bit for each coil. The
response includes the slave address, function code, quantity of data characters, and error checking. Data
will be packed with one bit with one bit for each coil, (1 = ON, 0 = OFF). The low order bit of the first
character contains the addressed coil, and the remainder follow. For coil quantities that are not even
multiples of eight, the last characters will be filled in with zeroes at the high end. The quantity of data
characters is always specified as the quantity of RTU characters, i.e., the number is the same whether RTU
or ASCII is used.

ADDR

FUNC

BYTE
COUNT

DATA
COIL
STATUS
20-27

DATA
COIL
STATUS
28-35

DATA
COIL
STATUS
36-43

DATA
COIL
STATUS
44-51

DATA
COIL
STATUS
52-56

ERROR
CHECK
FIELD

11

01

05

CD

6B

B2

0E

1B

D6


The status of coils 20-27 is shown as CD(HEX) = 1100 1101(Binary). Reading left to right, this shows that
coils 27,26,23,22, and 20 are all on. The other coil data bytes are decoded similarly.