Extended Commands—Chapter 7
331TE 2000
5250 Terminal Emulation Programmer’s Guide
Relay (Set, Reset, Read) Commands (#R)
Note: These extended commands are supported on 248X Terminals only.
There are three relay commands: Set, Reset and Read. All three use the
same extended command “#R” followed by two numeric characters. The
first character is the relay number and the second is a command byte. The
relay number can be “1”, “2”, “3” or “4”, since there are four relays in a
248X Terminal equipped with ter minal b locks. Also, the relay number can
be “5” when you want to choose all four relays at once. The command
byte will be “0” for Reset,“1”forSet,and“2”forRead.
Each Set and Reset command includes a Read, which provides verification
that the chosen operation was successful. The Read command returns a
value represented by an ASCII character in the A–P range. If the ASCII
value of the letter “A” is subtracted from the value returned, the result will
be a number from 0 to 15, representing the state of the four relays by bit
positions: bit 0 is re lay 1; bit 1 is relay 2; etc. If a bit is “0,” that r e lay is
reset(oroff);if“1,”itisset(oron).
If you Set, Reset or Read a single relay, the value returned represents only
the state of that relay, and not the state of the other three relays. If all four
relays are Set, Reset,orRead as a group, the value returned represents all
relays. The following table itemizes all possible combinations:
Relay Commands Returned Values
Value Returned Optical Inputs: 1 2 3 4
A Off Off Off Off
B On Off Off Off
C Off On Off Off
D On On Off Off
E Off Off On Off
F On Off On Off
G OffOnOnOff
H On On On Off
I Off Off Off On
J On Off Off On
K Off On Off On
L On On Off On
M Off Off On On
N On Off On On
O OffOnOnOn
P On On On On