B&B Electronics RS-232 Digital Relay I/O 232DRIO User Manual

Page 12

Advertising
background image

10 232DRIO-0308

Manual

B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350

PH (815) 433-5100 -- FAX (815) 433-5104

Table 3.1 – 232DRIO Commands

Function Command

Response

Set Output Lines

!0S{…}

No response

Read I/O Lines

!0R

{…}

Set Output Lines

#0S{…}{~…}

No response

Read I/O Lines

#0R

{…}{~…}

Symbol: {…}

represents one byte

<…>

represents

a

numeric

value

~

complement

of

the

specified

data

byte

Before going into the specifics of each command, it is important

to understand that a byte has a numeric value from 0 to 255. The
byte's value can be represented in decimal (0 -255) format,
hexadecimal (00 - FF) format, binary (00000000 - 11111111) format
or as an ASCII character. The fixed bytes of each command will be
represented as ASCII characters, for example: “!0R”. Refer to
Table 3.1. However, it is important to remember that an ASCII
character has a numeric value. Example: the ASCII “0” (zero) does
not have a value of zero but has a value of 48. The decimal and
hexadecimal equivalents of some ASCII characters are shown in
Table 3.2. Some commands require an additional data byte to
complete the command. These data bytes may be represented in
any of the formats listed above. Refer to Appendix A for more ASCII
and decimal equivalents.

Table 3.2 – Equivalent Values

ASCII Decimal Hexadecimal

! 33

21h

# 35

23h

0 48

30h

R 82

52h

S 83

53h

Syntax

Command strings consists of three to five bytes depending on

commands used for normal or harsh environments. The first byte is
always the start of message byte. The start of message byte is
either the ASCII “!” character (normal) or the ASCII “#” character
(harsh). The second byte is the address byte. This byte allows
each unit to have a unique address (useful in RS-485 networks).
Since the 232DRIO uses RS-232 communications, this byte is
always the ASCII “0” character and can not be changed. The next
byte is the command character. This byte is ASCII character and

Advertising