Communication format 33, Sending commands and data 33 – Red Lion LEGEND User Manual
Page 35
COMMUNICATION FORMAT
The half-duplex communication operation sends data by switching voltage
levels on the common pair of wires. Data is received by monitoring the levels and
interpreting the codes that were transmitted. After the Legend receives a Transmit
Command or Print Request, it will wait the Serial Transmit Delay time before it
will begin transmitting data. The serial transmit delay can be programmed for
0.002 or 0.100 second. In order for data to be interpreted correctly, there must be
identical formats and baud rates between the communicating devices. The formats
available for the Legend unit are 1 start bit, 7 data bits, No parity (parity bit = 0) or 1
parity bit (odd or even) and 1 stop bit. The baud rates are programmable and the
choices are; 1200, 2400, 4800, or 9600 baud.
Before serial communication can take place, the unit must be programmed to
the same baud rate and parity as the connected equipment. In addition, the loop
address number and print options should be known. When used with a terminal
or host computer and only one unit is employed, an address of zero (00) may by
used to eliminate the requirement for the address specifier when sending a
command. If more than one unit is on the line, assignment of unique non-zero
addresses is required.
SENDING COMMANDS AND DATA
When sending commands to the Legend unit, a command string must be
constructed. The command string may consist of command codes, value
identifiers, and numerical data. Below is a list of commands and value identifiers
that are used when communicating with the LGB unit.
COMMAND
DESCRIPTION
N (4EH)
Address command; Followed by a one or two digit address
number 1-99.
P (50H)
Transmit print options command; Transmits the options selected
in the Program Options Module section.
R (52H)
Reset value command; Followed by one Value Identifier (E, F, G,
I, J, O, 1-4).
T (54H)
Transmit value command; Followed by one Value Identifier (A-O).
V (56H)
Change value command; Followed by one Value Identifier (A-G,
or K, L, & O), then the proper numerical data.
VALUE IDENTIFIERS
MNEMONIC
A (41H) PRESET 1
P1
B (42H) PRESET 2
P2
C (43H) SCALE FACTOR COUNT
SFC
D (44H) SCALE FACTOR RATE
SFR
E (45H) PROCESS COUNT
PRC
F (46H) BATCH COUNT
BAT
G (47H) TOTAL COUNT
T
H (48H) RATE
RT
I (49H) PEAK
PEK
J (4AH) VALLEY
VAL
K (4BH) PRESET 3
P3
L (4CH) PRESET 4
P4
O (4FH) COUNTER LOAD
CLD
1 (31H) OUTPUT 1
N/A
2 (32H) OUTPUT 2
N/A
3 (33H) OUTPUT 3
N/A
4 (34H) OUTPUT 4
N/A
Note: Command identifiers other than those listed should
NOT be transmitted.
Otherwise, undefined or unpredictable operation could result.
The command string is constructed by using a command, a value identifier,
and a data value if required. The Data value need not contain the decimal point
since it is fixed within the Legend unit, when programmed at the front panel. The
Legend will accept the decimal point, however, it does not interpret them in any
way. Leading zeros can be eliminated, but all trailing zeros must be present.
EXAMPLE: If a Scale Factor of 1.0000 is to be sent, the data value can be
transmitted as 1.0000 or 10000. If a “1” is transmitted, the Scale Factor will be
changed to 0.0001.
-33-
10 BIT DATA FORMAT