5.8  Example: FT920 antenna switching

The FT920 has three antenna connectors: Antenna A, Antenna B  and  Rx Antenna.

These are controlled by two buttons Antenna A/B   and  Antenna Rx.

I can find no way of controlling antenna selection from the CAT interface.

We can however read the the state of the antenna selection and display it on buttons
configured as read-only 'LED' indicators ( active = L )


I chose buttons 67 and 68 (left top row) and code = ANT.

The buttons are in a group of two   (action = G )

(The active = L (LED indicator) facility works with single toggling buttons and with button groups.)

I set vx = X in buttons and  abx = X in catcodes.  This is appropriate for actions which are not per current VFO.

(See   vx and abx )

Antenna selection is readable in the block of eight status bytes using command  00000001FA.

The answermask is:   #08:04:01:30:xx    Receive 08 bytes, select 01 bytes at position 04 in the block.

                                        Mask the byte with hex 30 to extract bits 4 and 5.

Note that answerbytes = 2   (One byte returned as 2 characters)

From the manual:  bit 4  = 0 for antenna A  and bit 4  = 1 for antenna B.     (result = hex 00 or hex 01)
                   bit 5 = 1 for Rx Antenna   ... this overrides the indication of bit 4  (result = hex 20 or hex 30 )

So we have:

  Antenna A        result = 00

  Antenna B        result = 01

  Rx Antenna        result = 20 or 30

Unfortunately (without making a 'rigfix')  piWebCAT cannot handle the 20 OR 30 result.

So I just have two buttons, A and B.
If Rx Antenna is selected then both the A and the B buttons are in the OFF state.

The values are in the nans field of the buttons table records:  00 for A and 10 for B.

Note that grouped buttons use the nset and nans fields, (Whereas toggling and single action buttons use anson / ansoff etc)