6.6  Icom CIV control  - examples for the IC7000

Note that from buttonsciv table: Toggled buttons always send von / voff. Grouped always send bgsdata.

DNR on/off switching   - single button

SIngle entry in buttonsciv table  action = T (toggling)   von  = 1   voff = 0

   - on click client transmits  code = NRSW   jobdata  1 or 0

Icom CAT manual states: com = 0x16   subcom = 0x40   data 1 = ON       0 = OFF

We therefore use  cmdtype = C_S_ONOFF  datadigits = 1    ( the bcd data byte will be 0x01 or 0x00)

buttonsciv record    vx = X    = not VFO dependant

There is one catcodesciv record because there is a single setting which does not change with VFO change.

catcodesciv record

IPO / premp swiching   - two buttons in a group of 2

There are two button records in buttonsciv because we have chosen to have a group of two:

                                                                                                             pre-amp-off (IPO)   and pre-amp-on
action = G (grouped)   code = PAMP    bgsdata = 0  (IPO)  and 1 (preamp)   -

bgsdata is used for grouped button values:  

The CAT manual gives: com = 0x16   subcom = 0x02  preamp:  0 = off   1 = on.

For a pair of grouped buttons, we set bgsdata = 1 for the ON button   and = 0 for the OFF button.

(we could have instead used a single toggling ON/OFF button where we would have set von = 1  and voff = 0 )

We use cmdtype = C_S_DATA   datadigits =1  (C_S_DATA means:  com    subcom   data )

Note we could have used C_S_ONOFF here
-  but I suggest C_S_DATA, particularly for larger groups of buttons with a  range of bgsdata values.

buttonsciv records

catcodesciv records

Note that we have two catcodesciv records, one for the each VFO because the IC-7000 stores a different on/off status
for each VFO. The command is the same for the A and B records. The use of two records retains compatibility

within the configuration system with radios that have a different command for VFO A and VFO B.

In buttonsciv  (client) we set  vx = V.  This makes the client transmit A or B according to current VFO selection.
It also makes the client store the latest setting for each VFO to avoid having to reload on VFO change

Monitor on/off switching   - single buttons

Single button in table buttonsciv   action = T (Toggled))   code = MOSW   von =1   voff =0   vx = X

Client transmits  code = MOSW    jobdata = 1 or 0

Icom CAT manual states:  com =  0x1A   subcom = 50045 ... this will be BCD

We use cmdtype  =  C_S6_DATA  com = 1A  subcom4or6 = 50046


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 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 = 0   max = 255  (So, for example, at mid position the data to the radio is 128.)

Icom CAT manual states:  com = 0x1A  subcom = 50001  min = 0   max = 255

We use cmdtype = C_S6_DATA  com = 0x1A  subcom4or6 = 50001     datadigits = 3  (because max = 255)


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 write Frequency A       Not a slider nor a button but driven from the tuner.

                                Configured in the catcodesciv table

Frequency setting:

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 catcodesciv 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.

Icom CAT manual states:    com = 0x05    no subcom      datadigits = 10 
(I could not find a statement on how many decimal digits
   - I used the Siglent scope to observe the returned data train on frequency read)


We use: cmdtype = C_DATA    com = 0x05

Frequency read 

Icom CAT manual states:  command = 0x03
piWebCAT's configuration systems doesn't cope with separate com values for read and write.
However, all Icom radios appear to use set freq: com = 0x05  and read freq: com = 0x03.
Therefore I was happy to hard code switching com = 0x05 to com 0x03 for a read.
A separate frequency reading entry is not therefore required. You just set up com = 0x05.

Operating mode is similarly coded (ie LSB, CW..)  

Icom manual states:   Select mode: command = 0x06.   Read mode: command = 0x04.  
In the catcodesciv table, we use com = 0x06,  cmdtype =  C_DATA.
The server code changes 0x06 to 0x04 for a mode read.

To summarise: for frequency and mode,  we use the setting com value.
If the client requests read, the com value is automatically changed to the value for reading.

Note that there is a VFO A and a VFO B command in the catcodesciv table.
These are both the same except that one has abx = A and one has abx = B.

This is done for compatibility with radios that have different commands for the two VFOs.

(whereas Icom just have a command to tune the current VFO)

Band change buttons etc

The following is repeated in How it works.

I have a solution which works well and which is catered for by piWebCAT's standard CI-V configuration options.

The only workable command  that I could assign to a band button was a band-stacking register command.
The band stacking register holds three preferred frequencies for each band:

- the most recently assigned, the second most recent and the third most recent.

For band button click, we configure in the database for piWebCAT to issue a write

command to select the frequency of the 'most recent' register for the required band.

The command is  command = 0x1A,   subcommand = 0x01    data = 4 bcd digits (2 bytes)

eg: data = 0301 is used for 40m   ...the 03   is 40m    the  01 specifies the 'latest'

So we configure cmdtype = C_S_DATA    and  datadigits = 4.

The band button sends the command to change frequency to the new band.

piWebCAT picks up the frequency change within 250ms and band change begins.

All band buttons send code = BAND and a bgsdata value  of the form BBVV
where BB is band code are 1 to 12   and VV = 01   = the latest band stacking register entry.

abx = X because the command is not VFO specific on the IC7000.

(The command acts on the currently active VFO)

 Memory selection buttons - examples

I configured 3 spare buttons in my IC7000 to manage the radio's memories.
The IC-7000 has five banks (A to E ) each with 105 memory channels and also calling channels 0106 and 0107

The current IC-7610 has 100 memory channels. I could find no mention of 'banks' in the manual.

The buttons manage the use of memory channels that have been set up on the radio.

The parameters of each channel are set up on the radio, NOT by piWebCAT.

Call C1 selects memory channel 106. Then it sends a copy-memory-to-VFO command

Call C2 selects memory channel 107. Then it sends a copy-memory-to-VFO command.

MPad displays a numeric keypad for memory channel selection.

The keypad OK button selects a channel. Then it sends a copy-memory-to-VFO command.

Each button must be configured in buttonsciv  (client settings) and in catcodedsciv (server / CAT settings)

Call C1  all C2   ( - no command-specific coding)

These buttons selects calling channel C1 and C2   (memories 106 and 107  on the IC-7000)

Later Icom radios:   IC-7610 CI-V  uses same command (08 + channel number but with range 0001 to 0099)

No channel 106  - but these are single channel buttons with which you can use any memory channel.

The CI-V data shows command = 08 (hex)   followed by data 0106 or 107

Icom specify 0106  ie: 4 decimal digits so we must set datadigits = 4 (which will send two BCD digits: 0x01 and 0x06)

The two (or more)  buttons share a common catcodesciv record.

The buttonsciv records control what happens on the client.

The catcodedsciv record controls what happens on the server  ... ie: sending to the radio.

buttonsciv.action = 'S'.   These are single click buttons   (ie not grouped with others, not toggling on/off)

They are not VFO specific    so I set buttonsciv.vx = 'X'     catcodesciv.abx = 'X'

The data field for buttonciv.action = 'S' is   von  -- which is set to  106 or 107.

We must use code = 'MECH' .  (Other code choices select the memory, but no following copy-memory-to-VFO occurs.)

cmdtype is set to C_DATA   ie: command byte followed by some BCD data.  


The database records for these memory select buttons are shown below.

The MPAD record is also shown for the keypad memory selection.

If MTOV is configured in catcodesciv as shown below, then MTOV will automatically apply the memory to the VFO.

If your radio automatically copies to VFO on memory selection, then do not configure MTOV.

(The command then is simply lost)



Memory selector

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 buttonsciv (to display the popup) and catcodesciv 
(to respond correctly)  Note that 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 MTOV is automatically sent  (no buttonsciv configuration needed for this)

If MTOV is configured in catcodesciv as shown below, then MTOV will automatically apply
the memory to the VFO.

If your radio automatically copies to VFO on memory selection, then do not configure MTOV.

(The command then is simply lost)

buttonsciv action = 'S'  code = 'MPAD'    data fields von, voff and btgsdata are all unused.

(The data is the keypad selection)

The CI-V command is exactly the same as 'Call C1 / C2'  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.