4.7 ASCII configuration - examples
Note that from the buttons table: Toggled buttons always send von / voff. Grouped always send nset or chset.
DNR on/off switching - single button
Single entry in buttons table action = T (toggling) von = 1 voff = 0
- on click, client transmits code = NRSW jobdata 1 or 0
Yaesu CAT manual: read: NR0; for VFO main NR1; for VFO sub
send and receive are NR0u; NR1u; where u is 1 - 9
In the buttons record vx = V causes the client to send the current VFO (A or B) to the server.
At the server, the separate A and B records are identified by abx = A or B See: vx and abx
A single buttons record
There are two catcodes records because there are separate commands for VFO A and VFO B
IPO / premp swiching - three buttons in a group of 3
There are three button records in buttons because we have chosen to have a group of three:
pre-amp-off (IPO), Amp1 and Amp2.
action = G (grouped) code = PAMP nset and nans = 0 (IPO), 1 (Amp1) and 2 (Amp2)
There are separate nset and nans values because a small number of commands have different set and read values.
Likewise, at least one command uses character rather than numerics, hence the alternative chset and chans fields.
The numchar field determines whether num or char (N or C)
The FTdx101D CAT manual shows read commands: PA0; (main) and PA1; (sub)
The corresponding set and answer formats are: PA0u; and PA1u; where u is 0, 1 or 2.
Note that we have two catcodes records, one for the each VFO because the FTdx101D stores a different status
for each VFO. The abx =A and abx = B records contain the command masks for the A and B VFOs.
RF power level - slider
Slider data for client and server functions all in the slidersciv table.
For sliders, there are no data fields in the table. (The data is derived from slider position)
The table specifies min and max. These are always CAT value min and max (not displayed min and max)
When you move the slider, the value sent to the radio is based on min at slider left and max at slider right.
So here, min = 5 max = 100 (So, for example, at mid position the data to the radio is 52.)
FTdx101D CAT manual has: read PC; set PChtu; answer PChtu;
where htu = data (hundreds, tens and units)
This is not a VFO dependent setting, so there is only one record in the table with vx = X and abx = X.
vx = X means that the command is sent from the client with parameter rxab = X See: vx and abx
(whereas if vx = V, the command from the client is sent as rxab = A or B according to current VFO selection)
Note: RF power is the only setting that is always loaded from the radios on VFO change (rather than use stored)
For this to happen, you must use code = PWRF.
Read and write Frequency Not a slider nor a button but driven from the piWebCAT tuners.
Configured in the catcodes table
Mouse and thumbwheel actions modifiy variable freqSet in the client.
A timer driven task monitors freqSet and on change queues a message to the server.
This client activity is hard coded - there is no database configuration for it.
The control codes for the radios are configured in the catcodes table.
They use code = FREQ and abx = A for VFOA and code = FREQ and abx = B for VFOB.
FREQ is hard coded in the client and so must not be changed.
From the FTdx101D CAT manual:
- read main VFO freq. is FA; set and answer commands are, for example FA028123456;
- read sub VFO freq. is FB; set and answer commands are, for example FB028123456;
ie the data is a nine digit frequency. The mask for this is: FAgfedcmhtu; etc
where u = units, t = tens, h = hundreds, m = thousands, c = ten-thousands etc
abx = A or B to identify the record in order to match the command to the VFO selection from the client.
The client sends a command as if a slider command ... but it is internally generated as above.
Band change buttons etc
The following is repeated in How it works.
The FTdx101D CAT manual documents the band select command: BStu; where tu = band code 00 to 10.
This is a write-only command. There is no command to read the current band from the radio. We therefore
have the following arrangement: (actual timing intervals specified in timings table per radio)
Automated repetitive tasks to;
- Read main (A) frequency from radio every 200ms.
- Read sub (B) frequency from radio every 600ms.
- Check the latest read of main (A) frequency for band status every 1000ms.
( piWebCAT has hard coded band limits.)
If in a new band, then draw tuning scale for new band and highlight appropriate band button.
If frequency goes out of band, change frequency marker from red to olive. Leave it at band edge.
Do not redraw band scale until we enter a new band.
Note that the band limits are in database table bands.
However, the spans of the fourteen band tuning scales are hard coded.
The band button sends a band change command.
The radio will change to a frequency in the new band.
This will be the last used frequency in that band (or according to radios normal band change behaviour)
piWebCAT will pick up the resulting frequency change by its ongoing repetitive frequency read process)
All band buttons send from client to server with code = BAND abx = X and nset = band code (0 - 10)
abx = X because the command is not VFO specific. Its action on the radio is on the current VFO
Note: If other RS232 radios have two band commands, one for each VFO, then we would have to configure
piWebCAT to apply the band change to the current VFO.
This would be done as follows:
Set vx = V in every band-button buttons table record.
This will make the client send A or B according to current VFO selection.
Create two catcodes records, one with CAT commands for VFO A and abx = A
and one with CAT commands for VFO B and with abx = B.
Memory selection buttons - examples
FTdx101D has a MW (memory write) command. This is write-only to set up a memory channel.
The command is 28 characters in length and sets a list of parameters to a channel.
piWebCAT does not support this. Memories must be set up on the radio.
Pre-configured memories can then be selected by piWebCAT.
The MC command selects a memory channel and applies it to the current VFO. I use this.
There are MA and MB commands to apply the selected memory to VFO A or B.
I do not understand what purpose these have. There is no command to select a memory channel
without applying it to the VFO, so I see no use in piWebCAT for MA and MB.
piWebCAT has two fixed values for buttons and catcodes code fields:
- MECH should be used for a single memory channel button (eg: for calling channel etc)
- MPAD causes the button to automatically launch a numeric keypad memory selector.
The OK button on the keypad then sends an MPAD command to the server with the selected
memory as numeric data.
Both MECH and MPAD are followed after one second by a code = MTOV command to the server.
For the FTdx101D, we do not configure this MTOV command in catcodes and so it is simply lost.
If you have a radio whose 'MC' command doesn't apply the selected memory to a VFO, then
you need to configured a code = MTOV in catcodes to send a memory-to-VFO command to the radio.
This is done for Icom radios - see Icom examples.
FTdx101D CAT manual: memory channel selector command is:
read: MC; set MChtu; answer MChtu; where htu is the channel number, eg: 017
This command selects the memory and applies it to the VFO.
I configured 2 spare buttons in my FTdx101D to manage the radio's memories.
MPad displays a numeric keypad for memory channel selection.
The keypad OK button selects a channel.
M 17 selects memory channel 17.
Each button must be configured in the buttons table (client settings)
and in the catcodes table (server / CAT settings)
You can have multiple single channel (MECH) buttons in the buttons table sharing a single catcodes record.
M 17 - single channel buttons ( - no command-specific coding)
The buttons records control what happens on the client.
The catcodes record controls what happens on the server ... ie: sending to the radio.
buttons.action = 'S'. These are single click buttons (ie not grouped with others, not toggling on/off)
They are not VFO specific so I set buttons.vx = 'X' catcodes.abx = 'X'
The data field with button.action = 'S' is von -- which is set to 17.
(We must use code = 'MECH' if a following copy memory to VFO CAT command is needed.)
The database records for the M17 memory select button are shown below.
The button is programmed to display a popup numeric key pad as a channel selector.
The code field must be set to MPAD, both in buttons (to display the popup) and catcodes (to respond correctly)
Note that this is a special, hardcoded two-stage command system.
The button displays the popup.
The selected channel is sent client > server > radio when the OK button on the keypad is clicked.
One second later, a code = MTOV is automatically sent (no buttons configuration needed for this)
MTOV is intended for a command to copy selected memory to VFO.
The FTdx101D doesn't need it - so we simply do not configure it in catcodes.
buttons: action = 'S' code = 'MPAD' data fields von, voff etc are all unused.
(The data is the keypad selection)
The CAT command is exactly the same as 'M 17' above,
ie: it sets a numeric channel (but from the keypad rather than fixed).
The database records for these memory select buttons are shown below.
Monitor on/off switching and level
This is included as an example of a single CAT command: ML... being used for switching and level.
The CAT manual shows:
- M L P1 P2 P2 P2 ; where P1 is a single digit number and P2 is a three digit number.
- If P1 = 0 then P2 is on/off with P2 = 0 for off and P2 = 1 for on.
- If P1 = 1 then P2 is level 0 - 100.
So for on/off we use:
readbytes = 4, setbytes = 7, answerbytes = 7, readmask = ML0; setmask = ML0htu, answermask = ML0htu;
and for level we use:
readbytes = 4, setbytes = 7, answerbytes = 7, readmask = ML1; setmask = ML1htu, answermask = ML1htu;
buttons table - montior on/off
catcodes table - monitor on/off
sliders table - monitor level