CAT
System Computer Control
(D)
&
(E)
VFO-A
and
VFO-B
Data
(9
bytes
x
2)
After the 19-byte Data Record for c,~rrent op-
eration is sent, two 9-byte
VFO/Memory Data
Records are sent; one for each
VFO.
The format
of each of these records is the same as described
above, and in fact, when operating on a
VFO, the
values in these records are identical to the two
9-byte records included in the 19-byte Data
Re-
cord for current operation.
(F)
Memory Data Records
After the two 9-byte records for the
VFOs, 32
19-byte Data Records are sent: one for each mem-
ory, beginning with memory 01. Each memory
data record is constructed as described above for
the 19-byte Data Records.
Status Update Data Selection
The 1st and 4th parameters of the Status Up-
date command allow selection of different por-
tions of the Status Data to be returned, as follows
("U"
is the 1st parameter, "CH" is the 4th):
Note that, in most cases, you will only need
to read the 19-byte Operating Data Record (with
the first parameter
=
2), since
all other
CAT
com-
mands
affect only this data
(except
VFO
b
M
and
Memory
Scan Skip).
Read Flags Data
The
Read Flags
command retrieves the (first)
3
Flag Bytes of the Status Data. The transceiver
responds to the
Read Flags
command by return-
ing the Flag Bytes described on the preceding
page, plus two bytes with the constant values of
08h and
41h (in that order), as shown here:
I
1
st
Flag
Byte
1
2nd
Flog
Byte
I
3rd
Flog
Byte
I
Dummy
(O8h)
1
Dummy
(41
h)
1
Read Meter Data
Sending the
Read Meter
command causes the
transceiver to return a digitized meter deflection
indication, between
0 and OFFh (in practice, the
highest value returned will be around
OFOh).
Four copies of this value are returned, along with
one constant byte
(OF7h),
as
follows:
I
Meter Bvte
1
Meter Bvte
I
Meter Bvte
I
Meter Bvte
I
OF7h
I
During reception, the signal strength deflec-
tion is returned. During transmission, the pa-
rameter represented by the Meter Byte depends
on the current meter selection (ALC,
PO
or
SWR).
Coding Examples
Although Yaesu Musen Company cannot of-
fer to provide complete CAT control programs
(owing to the variety of incompatible computers
used by our customers), following are a few ex-
amples of critical CAT i/o functions, in Basic.
Note that all variations of Basic may not support
some of the commands, in which case alternate
algorithms may need to be developed to dupli-
cate the functions of those shown.
Sending
a
Command
After "opening" the computer's serial port for
4800-baud, 8 data bits and 2 stop bits with no
parity, as
i/o device #2, any
CAT
command may
be sent. However, if you determine that your
computer may need extra time to process data
returned from the transceiver, you should send
the
Pacing
command first. Here is an example of
the
Pacing
command setting a 2-ms delay:
PRINT #2, CHR$ (0) ;CHR$
(0)
;CHR$
(0)
;CHR$ (2) ;CHR$ (&HE)
;
Notice that the instruction opcode is sent last,
with the first
(MSB) parameter sent just before it,
and the LSB parameter (or dummies) sent first.
The parameters are sent in the reverse order
from that in which they appear in the CAT Com-
mands table. Also note that in this and the fol-
lowing examples, we are sending zeros as
dummy bytes; although this is not necessary.
If
you decide to send commands through a 5-byte
array, the values of the dummy parameters need
not be cleared.
Using the same example as on page 31, the
following command could be used to set the
frequency of the display to 14.25000 MHz:
PRINT 12, CHR$ (&HOO)
;
CHR$ (MSO)
;
CHR$ (&H42)
;
CHRS (WO1)
;
CHR$ (&HA)
;
Notice here that the BCD values can be sent
just by preceding the decimal digits with
"&H
in
this example. However, in an actual program
you may prefer to convert the decimal frequency
page
34