3. General command structure

All commands to and from the rig have a fixed frame, variable length format as follows (one box is one byte).

The general framing structure applies to all CI-V messages, from computer to rig and vice versa. It contains commands of various length (one, two or three bytes), with or without data (null up to 50+ bytes). The only exception to this frame format is the collision detect signal (see bottom of page).

Generalized CI-V frame structure
$FE $FE to-adr fm-adr $FD

Each frame starts with two $FE values and ends with one $FD value. The definition of the CI-V protocol does not allow these byte values to show up within the frame.

Pre- and post-amble delimiting the frame
$FE $FE to-adr fm-adr $FD

Each message must contain a to-adress (destination) and a from-adress (source). More on adressing issues in the next chapter.

Adress fields in CI-V message
$FE $FE to-adr fm-adr $FD

The following message contains a single byte command without data. Other commands can be longer, up to three bytes. The Icom manual calls these additional bytes subcommands.

CI-V frame containing command without data
$FE $FE to-adr fm-adr cmd $FD

The next message shows a command with data. The length of the data (how many bytes follow) depends on the command and varies from one to more than 200 bytes.

CI-V frame containing command with data
$FE $FE to-adr fm-adr cmd data data data data data $FD

Many (not all) commands can be issued with or without data. The effect is this:

Responses from the rig

Good or No-Good response

Most commands yield a response, either the data which was requested (e.g. a memory contents) or are responded simply by the rig with a Ok or NG (Not Good) response. Only two commands ($00, $01) yield no response at all (see command table).

The Ok response (indicating success) and NG response (indicating an error) have the following format:

OK (success) response from rig
$FE $FE to-adr fm-adr $FB $FD
NG (failure) response from rig
$FE $FE to-adr fm-adr $FA $FD

A NG response is usually the result of a command not understood by the rig. Specific reasons for a NG response are:

The actual byte values of $FB for Ok and $FA for Not-Good can be easily memorized: 'FB' is a common abbreviation in CW code meaning fine business, or all ok. $FA could be interpreted as FAilure.

Response with data

Be aware that responses can vary in length depending on the value returned. For example when a decimal value of zero to 255 can be returned it is represented in either one or two bytes as BCD data. Values below 100 would use only one byte, values from 100 to 255 two bytes.

Example: Response to read S-meter value, the current value is 253.

$FE $FE $E0 $4A $15 $02 $02 $53 $FD

Example: Response to read S-meter value, the current value is 85.

$FE $FE $E0 $4A $15 $02 $85 $FD

Collisions on the bus

Due to the single-wire nature of the CI-V bus, collisions can occur. This happens when two or more rigs (or rig and controller) try to to send a message at the same time. This condition is rare, but can happen. Once a collision is detected by either party on the bus the collision detect signal is sent by the device detecting the collision:

Special Jammer message indicating a collision
$FC $FC $FC $FC $FC

Again due to the nature of the single-wire bus a sending device immediately receives the echo of the message sent. This can be used as a mechanism to detect collision, when the received data is not the same as the data sent. In this case the sending device must abort transmitting the message and send the 'jammer' code as above. After detecting silence on the bus the aborted message shall be repeated.

For a device currently not actively sending a message but receiving the jammer code, no action needs to be taken, it can just wait for the re-transmission of the failed message.