ELECRAFT K4 PROGRAMMER'S REFERENCE                         

Copyright 2021   Elecraft, Inc.                                                                           Rev. B3               

Table of Contents

Introduction

Protocol and Syntax

Multiple Client Support

Streaming Data

Using Commands in Switch Macros

Command Reference

        Radio Commands

        Menu Access Commands

        Display Commands

Change History

Introduction

This manual describes all K4 remote-control commands. These can be used by computer application developers to emulate the K4's front panel controls, or by operators who wish to customize K4 or K-Pod switch functions.

Since the transceiver supports fast digital I/O over Ethernet, it can provide Streaming Data, including dB/bin data for software panadapter emulation, IQ for demodulation and programs like Skimmer, and receive/transmit digitized audio.

The K4 executes a superset of the commands from the K3/K3S transceiver and P3 panadapter. Some commands support both a new K4 format as well as the legacy K3/K3S or P3 format. Some commands also have a new toggle or increment/decrement SET variation to simplify front-panel switch emulation. All variations are described in the Command Reference sections.

Multiple remote-control clients are supported via the Ethernet and USB ports (see Multiple Client Support). Each client can independently poll the K4 to obtain information needed to support its own user interface. Auto-Info (AI) mode is also provided to broadcast radio control changes to all clients. See Polling vs. Auto-Info (AI).

Protocol and Syntax

K4 Remote control commands are human-readable, providing an advantage for developers as well as operators who wish to create their own macros (strings of commands). Software applications can interact with the radio by polling with GET commands, or they may be designed to respond to automatically generated responses resulting from control changes.

Command Groups

Commands are divided into three groups:

Radio Commands                    band, mode, audio, RF, and operational settings

Menu Access Commands            menu entry names, parameters, and default values

Display Commands                   panadapter, waterfall, and monitor configuration settings

Within each group are SET and GET commands. Response commands (RESP) from the K4 occur in reply to GETs, and can also be generated automatically following control changes at the radio. Responses use the same format as SET commands.

Polling vs. Auto-Info (AI)

Many computer software applications poll for data of interest by using GET commands. Typically only a small subset of K4 commands is used for a given application.

An alternative is to place the K4 into AI (auto-info) mode. In this case, every control change at the radio (due to either local or remote control by any client) will generate a corresponding GET response automatically. The application can use all or a subset of these responses to update its interface. See the AI command.

Syntax

Commands have a 2-, 3-, or 4-letter prefix followed by one or more parameters. Parameters can be comprised of numeric fields, letters, or a combination of these. All commands are terminated by a semicolon (;). Commands may use upper or lower case alphabetic characters. The only command that differentiates between the two is the CW/DATA text-send command (KY <text>), when used in PSK mode.

A dollar sign symbol ($) after a command prefix modifies a command to target VFO B/sub receiver. Applicable commands are so identified in the Command Reference.

SET commands have a prefix and usually 1 or more parameters. (All SET commands have corresponding GET commands and vice-versa unless otherwise noted.) SET examples:

        AN3;                selects KAT4 ATU antenna 3

        FA7100;        sets VFO A to 7100 kHz (FA/FB support multiple numeric formats)

        MD$3;                selects CW mode for VFO B/sub RX

GET commands use only the prefix; the response to a GET (RESP) uses the SET format. Examples:

        AN;                returns ANx; where x is the currently selected antenna

        MD$;                returns MD$x; where x is the current operating mode for VFO B/sub RX

TOGGLE/INCR/DECR commands are special variants of SET commands. Examples:

        RA/;                turns VFO A/main RX attenuator on if it was off and vice-versa

        BN$+;                selects the next-highest band for VFO B/sub RX

K4 switch emulation commands (SW) simulate the use of switches on the K4's front panel. 2-digit IDs specify the function without the need to differentiate between tap and hold. Examples:

        SW56;        simulates tapping the K4's NR switch

K3 switch emulation commands (SWT/SWH) support a subset of K3/K3S switches that have matching K4 functions. These are provided for compatibility with existing applications. Example:

        SWT16;         simulates tapping the K4's XMIT switch (identical to SWT16 on the K3/K3S).

Meta commands (K2, K3, K4) affect behavior of certain individual commands and the overall protocol. Refer to the command reference for details.

Display commands are preceded by a # symbol to disambiguate them from current or future radio control commands.

Error Checking

If a GET or SET command is received that cannot be parsed, the radio will echo the command followed by "?" and a semicolon terminator. If a command is correctly formed but a parameter is out of range, a GET response is echoed that shows the current valid setting.

Multiple Client Support

A K4 may be controlled by multiple clients simultaneously, including other K4s or software applications running on computers or mobile devices. Connections can be established through the two virtual COM ports (USB-B connector), the RS232 port (DE9 connector), or Ethernet.

The radio's built-in server maintains the latest radio state information (band, mode, etc.). Each client can poll for the subset of information it needs to maintain its UI. Clients using older software may use K2 or K3 "meta modes" as well as legacy command formats. Clients can also individually turn on auto-information mode (see AI command) when desired. In this case, any change in radio state caused by a client or at the radio itself is then broadcast to all clients via AI responses.

Streaming Data

The K4 provides three kinds of streaming data: digital audio (two outgoing channels for receive, one incoming channel for transmit), dB/bin (for reproducing panadapter data), and raw IQ (to support external demodulation, text decode, etc.). Each data stream is enabled by connecting to a specific port over Ethernet. Once the connection is established, data flows continuously. Various options will be provided to optimize stream bandwidth to suit host computer applications.

Streaming protocols are being refined and will be fully documented in a subsequent revision of this document.

Using Commands in Switch Macros

One or more K4 remote-control commands can be concatenated together to form macros that perform user-defined functions. For example, the sequence:

      FA14085;MD6;DT2;PC070H;

puts the radio on a common 20 meter RTTY "watering hole" frequency, selects data mode and FSK-D data submode, then sets power output to 70 watts.

Macros can be edited directly from the front panel and assigned to programmable switches on the radio itself or on the Elecraft K-Pod controller. [Implementation in progress.]

Command Reference

Commands are listed in alphanumeric order. If a command can target either VFO A/main RX and VFO B/sub RX separately, it is so identified by a $ symbol. This symbol must be added to the command only when targeting VFO B/sub RX.

All SET commands have a corresponding GET command and vice-versa unless otherwise noted.

[Pending] in a command's heading indicates that implementation is planned or in progress.

Radio Commands

AB (VFO Copy/Swap/Init; SET only)

SET format:        ABn;  where n=0 (FA>FB), 1 (FB>FA), 2 (FA/FB swap), 3 (all A>B), 4 (all B>A), 5 (all A/B). Cases 0-2 copy or swap only VFO frequency. Cases 3-5 copy or swap all VFO parameters. Some limitations apply. For example, RX antennas are only copied or swapped if the VFOs are on different bands.

AF (Audio Feedback tones)

SET format:        AFn;  where n=0 cancels any AF tone sequence, 1 is a simple switch beep (high pitch), and 2 = hi/lo error tone.

 

AG$ (AF Gain)                

SET/RESP format:   AG$nnn;  where n is 000-060.

AI (Auto-Info)

SET/RESP format, AI mode:  AIn;  where n is the auto-info mode:

        0 = Auto info off

1 = VFO, RIT, and certain other control changes generate periodic "IF;" responses
        2 = All control changes generate periodic responses
        3 = N/A (reserved for future use)
        4 = Immediate notification of changes not made by client (see
NOTE1)
        5 = Immediate notification of all changes (see
NOTE1)
SET/RESP format, AI Delay:  AIDxxx; where xxx is the delay in ms (60 to 999) to be used in AI1 and AI2 modes. Default is 500 ms.

NOTE1:  Excessive traffic can potentially overflow serial port buffers in immediate AI modes (AI4 and AI5).

NOTE2:  AI mode is per-client.

AL (AF Limiter)                

SET/RESP format:  ALnn;  where nn is 01-30 (level set). Sets level of AF limiter used when AGC is off (see GT command). Typical value is 20.

AN (TX Antenna)                

SET/RESP format:  ANn;  where n is 1 to 3 for KAT4 ANT1/2/3 (ANT2 and ANT3 are not available if the ATU isn't installed.) Sets the transmitter antenna. This is also the receive antenna for either receiver (main or sub) when sharing the transmit antenna. Also see AR and AT commands.

TOGGLE format:  AN/;  alternates between the two most recently used TX antennas.

                                                

AP$ (APF)                                

SET/RESP format:  AP$mb; where m = 0 (off) or 1 (on); b =  0 (narrow, 30 Hz) or 1 (wide, 50 Hz). Only applies in CW mode.

 

AR$ (RX Antenna)                

SET/RESP format:  AR$n; where n is:

0 = Disconnected (all RX RF sources disconnected from target RX)

1 = EXT. XVTR IN / RX ANT IN2 (external transverter IN jack)

2 = RX USES TX ANT (the antenna currently selected for the transmitter)

3 = INT. XVTR IN (internal transverter IN)

4 = RX ANT IN1 (receive antenna)

5 = ATU RX ANT1 (see NOTE)

6 = ATU RX ANT2 (see NOTE)

7 = ATU RX ANT3 (see NOTE)                                        

TOGGLE format:  AR$/;  alternates between the two most recently used RX antennas.

NOTE: If there is no KAT4 ATU installed, then selections 5, 6, and 7 are invalid. Substitute AR2 for these cases (RX uses TX antenna, which is always ANT1).

AT (ATU Mode)

        

SET/RESP format:  ATn;  where n is 0 (NOT INST--see NOTE), 1 (BYPASS), or 2 (AUTO). Pertains to the current band and antenna.

TOGGLE format:  AT/;  alternates between ATU in and bypassed.

NOTE:  An AT0 command should not be sent under normal circumstances; the K4 will automatically ascertain whether a KAT4 ATU module is installed.

BG (Bargraph Read; GET only) [Pending]

RESP format:  BGnnx;  where nn is always 00 ... where x is tx state. TBD; provided for K3 compatibility.

BI (Band Independence for VFO B)

SET/RESP format:   BIn;  where n=1 allows VFO B to be set to a different band from VFO A.

BN$ (Band Number)        

SET/RESP format:   BN$nn;  where nn is the band number:

                                     00 = 160 m ...10 = 6 m; 16-25 = transverter bands

                             (11-15 reserved for future HF bands)

INCR/DECR format:  BN$+; or BN$-;  increments or decrements current band.

TOGGLE format:  BN$/;  alternates between the two most-recently used bands.

NOTE: The XV command can also be used for transverter band selection.

BR (Serial Port Baud Rate)

        SET/RESP formats:  

BRpbbbbbb;  sets port p's baud rate, where p is 0-2 (see port info below)

BRbbbbbb;  set all ports to the specified rate

GET formats:  BRp;  gets port p's baud rate.  BR;  gets port 0's baud rate.

Port 0 is the RS232 port. Ports 1 and 2 are the two virtual com ports associated with the USB-B jack. Baud rate (bbbbbb) can range from 004800 to 115200 baud.

BW$ (Bandwidth)                        

SET/RESP format:  BW$nnnn;  where nnnn is filter bandwidth x10 Hz.

CP (Speech Compression)

SET/RESP format:  CPnnn;  where nnn is 000-030. Applies only to SSB modes.

CW (CW Pitch)                        

SET/RESP format:  CWnn;  where nn is sidetone pitch x10 Hz (25-95).

DB$ (Audio dBV meter read)

RESP format:  DB$snnnn;  where s is +/- and nnnn is 0-9999, representing audio signal level for the main or sub RX ($) in 10ths of a dB. Useful for MDS measurements (see Elecraft XG3 user manual for method).

SET format:   DB$0;  (sets new 0 dB reference level for target receiver).

NOTE: Even though measured dB values are independent of the AF GAIN setting, AGC must be turned off to make the dBV reading accurate for signals above AGC threshold. Use GT to turn off AGC. Use AL to limit audio signal strength when AGC is off.

DE (Command Processing Delay; SET only)

SET format:  DEnnn where n can be 001 to 999 (ms * 10), i.e. up to 9.99 seconds (TBD).

DN/DNB (VFO Move Down; SET only)

SET format:  DN;  (move VFO A down one unit, based on the current VFO step size)  or  DNB;  (same for VFO B). Also see UP/UPB and RU/RD (RIT offset up/down).

TBD: Support for K3 variants.

DR$ (Data Rate)  [Pending]

SET/RESP format:  DR$r;  where <r> is the baud rate identifier:  

AFSK-A, FSK-D: 0=45 baud, 1=75 baud; PSK-D: 0=31 baud, 1=63 baud.

DT$ (Data Sub-Mode)

SET/RESP format:  DT$n;  where n is the data sub-mode set or last used, whether or not DATA mode is in effect: 0 (DATA A), 1 (AFSK A), 2 (FSK D), or 3 (PSK D).  

NOTES: (1) If DT is used when the transceiver is not in DATA mode, the returned value may not be valid. (2) See MD command for data normal/reverse information. (3) In Diversity Mode, sending DTn  (main RX data mode) matches the sub receiver’s mode to the main receiver’s.

DV (Diversity Mode) [Pending]

        SET/RESP format:  DVn;  where n is 1 to turn diversity mode ON, and 0 otherwise.

ER (Configuration Error; GET only)                

GET/RESP format:  ERnn;  where nn is a configuration error number. ER responses are generated when certain commands are rejected due to context. GET returns last error. For example, there are various invalid combinations of SB (sub RX), AR (RX antenna), and FT (split).

NOTE:  The full list of error codes appears in the K4 Built-In Operating Manual, which can be accessed using any browser. This document is available on the Elecraft website.

ES (ESSB Mode and Bandwidth) [Pending]

SET/RESP format:  ESnbb  where n = 0 (ESSB OFF) or 1 (ESSB ON) and bb is the ESSB TX bandwidth in 100 Hz units, 30-45 (3.0-4.5 kHz).

FA (VFO A Frequency)                                

SET format:  FAn...;  where n can have 1 to 11 digits. Frequency range is 100 kHz to 54 MHz. Digit count affects interpretation: 1 or 2 digits: n = MHz (e.g., "FA7;" = 7 MHz); 3 to 5 digits: n = kHz; 6+ digits: n = Hz.

RESP format:  FAnnnnnnnnnnn;  (frequency in Hz).

                                                                                                                FB (VFO B Frequency)                                

See FA command for format.

FC$ (Center Panadapter for target VFO)

        SET format:  FC; or FC$; will center the panadapter on the target VFO.

FI$ (IF Center Frequency)

SET/RESP format:  FIn… where n… is 1 to 11 digits. Supports same formats as FA/FB. Sets center frequency for panadapter and/or IQ data streaming.

FP$ (Filter Preset)                

SET/RESP format:  FP$n;  where n is 1-3. Selects filter preset n for current mode.

NOTE: Make sure operating mode is selected first, since presets are saved per-mode. 

FR (Receive Function)

SET/RESP format:  FRn;   where n is a decimal digit. Cancels SPLIT if applicable.

NOTE:  This command is provided for K3 compatibility. It is equivalent to FT0.

                

FT (Split)

SET/RESP format:  FTn;  where n = 0 (SPLIT on) or 1 (SPLIT off).

TOGGLE format:  FT/;  alternates between SPLIT on and off.        

                                                                

FX (Audio Effects)                

SET/RESP format:  FXn;  where n is 0=0ff, 1=delay (sim stereo), 2=pitch-map.

NOTES: (1) If the sub receiver is on (SB command), normal stereo audio effects do not apply. (2) The K3 doesn't support pitchmap mode. Instead, it has a "BIN" mode that is not available on the K4. BIN on the K3 does simple binaural phase inversion, like the toggle switch on some headsets.

 

GT$ (AGC Mode)                                

SET/RESP format: GT$n;  where n is 0=0ff, 1=slow AGC, 2=fast AGC.

K3 SET/RESP format:  GTnnn; where n is 002 for fast AGC and 004 for slow AGC.

K2 Extended SET/RSP format (K22):  GTnnnx; where x is 0 (AGC off) or 1 (AGC on).

TOGGLE format:  GT$/;  alternates between AGC on and off.

NOTE:  When AGC is OFF, the AF limiter must be set to a level that protects the operator's ears from strong signals. See AL command. AGC cannot be turned off if NR or autoNotch are in effect.

HD (HDR Module Mode) [Pending]

        TBD.

ID (Radio Identification; GET only)

RESP format:  IDs;  where s is "0" (default) or the user's ID text from the status display (typically a call sign).

K3 RESP format:  ID017;  returned for K3 compatibility.

IF (Basic Radio Information)

        TBD. Provided for K3 compatibility (K22/K31 meta-mode variant).

IP (IP Address)

RESP format:   IPV4:aaa.bbb.ccc.ddd;   where aaa-ddd are the fields of the transceiver's assigned IP address.

                                                                                

IS$ (IF Center Pitch)                        

SET/RESP format:  IS$nnnn;  where nnnn = pitch (x10 Hz). IS9xxx sets per-mode default.

K3 SET/RESP format: IS nnnn;  where nnnn = pitch (Hz). IS 9xxx sets per-mode default.

NOTE:  This command is named "IS" (IF Shift) for legacy compatibility reasons. It is actually an AF center-pitch setting command on the K4 and other Elecraft transceivers.

K2 and K3 (Meta Commands)

TBD. Provided for backward compatibility with K3.

K4 (Meta Command)

SET/RESP format:  K4n;  where n = 0 (basic K4 mode) or 1 (advanced K4 mode). A K4; GET command can be used to determine whether a K4 is connected to the host application. Additional information pending.

KP (Keyer Paddle and Weight Setup)

SET/RESP format:  KPionnn;  where i = iambic keying mode (A/B), o = paddle orientation (N/R), and nnn = keying weight (090-125). Weight value should be constrained to multiples of 5, i.e. 90, 95, 100, 105, 110, 115, 120, 125, and displayed in the setter as a fixed-point ratio, e.g. 0.90 to 1.25.

KS (Keyer Speed)      

SET/RESP format:  KSnnn;  where nnn is the keyer speed, from 8 to 100 WPM.        

KY (CW/DATA Message Text)

SET format:  KY*[text]; where * is normally a BLANK and [text] is 0 to 24 characters. If * is a W (for “wait”), processing of any following host commands will be delayed until the current message has been sent. This is useful when a KY command is followed by other commands that may have side-effects, e.g., KS (keyer speed).

RESP format:  KYn; where n is 0 (CW text buffer not full) or 1 (buffer full).

The following keyboard characters are mapped to CW "prosigns":    

(         KN

+         AR

=         BT

%         AS

*         SK

!         VE

In addition to these prosigns, these special characters can be inserted in KY command text:

<         Puts the K3 into TX TEST mode, until a '>' character is received

>         Returns the K3 to TX NORM mode

@         In CW mode, this character terminates any CW message

^D         EOT, ASCII 04; Quickly terminates transmission; use with CW-to-DATA

LC (GET/SET ATU LC Data)

TBD. This is shown as implemented for K4 to Client in the MVP list; it probably isn't needed.

LI (Line Input) [Pending]

           SET/RESP format:  LIuuullls;  where:

                    <uuu> = line in level, USB-B             0-??? (actual range TBD)

                   <lll> = line in level, line in jack            0-???

                    <s> = line in source                         0 = Sound card (USB-B), 1 = LINE IN jack

        SET ONLY extensions:

LInnns; (set level and source)

LInnn; (set level for current source)

          LIs; (set source)

           NOTE: In voice modes, audio from the specified line in source is only enabled if the mic-input command (MI) is configured for LINE IN, FRONT+LINE, or REAR+LINE. Disabled in CW, PSK-D, and FSK-D modes.

LK$ (VFO Lock) [Pending]

SET/RESP format:  LK$n;  where n = 0 (unlock) or 1 (lock).

LN (VFO Link) [Pending]

SET/RESP format:  LNn;  where n = 0 (VFOs not linked) or 1 (VFOs linked; turns on link icon to the left of the VFO B numeric display). When the VFOs are linked, VFO A controls both VFOs. If VFO B is offset from VFO A, the offset amount will be preserved as VFO A is tuned.

LO (Line Out) [Pending]

           SET/RESP format: LOlllrrrm;  where:

                    <lll> = left line level           0-040 (actual range TBD)

                    <rrr> = right line level          0-040

                    <m>   = mode                      0 = Right channel is independent

                                                              1 = Right channel uses Left channel value

           NOTES:  (1) Line out audio is always available at both the LINE OUT jack (analog AF out) and the sound card interface. (2) The CODEC on the AFIO allows Windows PCs to independently adjust L/R audio *in* (PC perspective). This is a K4-only feature (the CODEC on the KIO3 didn't allow independent adjustment). If the operator is using Windows to control this, they can specify R=L feature in the LINE IN UI (<m> = 1 above).

MA$ (Mode Alternates; GET only)

This command is only needed by applications that are attempting to functionally emulate the K4's mode-select button group. It returns a set of bit flags that shows what alternate modes were last selected for each primary mode for the current VFO. "Alternate Modes" refers to one of: CW normal/reverse, USB/LSB, DATA-A normal/reverse, etc. These are tracked so that the MODE button group can be labeled with the correct per-VFO/per-band mode selections.

RESP format:  MAxx;  where xx is an ASCII-hex value whose bits are defined as follows:

    b0           0 = CW normal, 1 = CW reverse

    b1           0 = LSB, 1 = USB (default is LSB for 160/80/40 m, USB for other bands)

    b2           0 = DATA-A normal, 1 = DATA-A reverse

    b3           0 = AFSK-A normal, 1 = AFSK-A reverse

    b4           0 = FSK-D normal, 1 = FSK-D reverse

    b5           0 = PSK-D normal, 1 = PSK-D reverse

    b6           0 (reserved for future use)

    b7           0 (reserved for future use)

MB (Message Bank) [Pending]

        

TBD.

MC (Memory Channel) [Pending]

TBD.

MD$ (Operating Mode)                

SET/RESP format:  MD$n; where 0=N/A, 1=LSB, 2=USB, 3=CW, 4=FM, 5=AM, 6=DATA, 7=CW REV, 8=N/A, 9=DATA REV. Also see DT (DATA sub-mode). Applications that recreate the K4's mode-select button group should also use the MA command.

TOGGLE format:  MD$/;  alternates between two most recently used modes.

INCR/DECR format:  MD$+; and MD$-;  cycle through the operating modes (SSB, CW, AM, FM, DATA).

ME (Menu Parameter)

MEDF (Menu Definition)

MO (Menu Open)

        See Menu Access Commands.

MG (Mic Gain)

SET/RESP format:  MGxxx; where <xxx> is 000-080. For mic input selection, see MI. For mic preamp configuration, use MS (Mic Setup).

MI (Mic Input Select)

SET/RESP format:  MIn;  where:  <n> = 0 (front mic), 1 (rear mic), 2 (LINE in see LI cmd), 3 (front mic + LINE IN), or 4 (rear mic + LINE IN). For preamp, bias, and mic button configuration, use MS (Mic Setup).

NOTE:  Mic selection only applies to voice modes. In audio data modes, LINE IN is always used (audio jack or USB sound card input).

ML (Transmit Monitor Level)                

SET/RESP format:  MLmnnn;  where m is 0 (CW), 1 (AF data), or 2 (voice), and nnn is 000-100. In CW/direct-data modes this is the sidetone/alert tone level; in voice modes, speech monitor level; in AF data modes, data monitor level.

GET format:  MLm;  where m is 0 (CW), 1 (AF data), or 2 (voice).

K3 SET/RESP format:  MLnnn;  where nnn is 0-60 and applies to the current mode (see above).

MS (Mic Setup) [Pending]

SET/RESP format:   MSabcde;  where:

<a> = front mic preamp           0 = 0 dB, 1 = 10 dB, 2 = 20 dB

<b> = front mic bias                   0 = OFF, 1 = ON

<c> = front mic controls            0 = none, 1 = PTT, 2 = PTT+UP/DN

<d> = rear mic preamp             0 = 0 dB, 1 = 14 dB

<e> = rear mic bias                    0 = OFF, 1 = ON


SET ONLY extensions:
 MSAx; MSBx; MSCx; MSDx; MSEx; where: x is desired value.

NA$ (Auto Notch)                

SET/RESP format:  NA$n;  where n=0 is OFF, n=1 is ON. Only applies to SSB modes.

TOGGLE format:  NA$/;  turns auto-notch on if it was off and vice-versa.

NB$ (Noise Blanker)                

SET/RESP format:  NB$nnm;  where nn is NB level (0-15) and <m> is 0/1 for off/on.

TOGGLE format:  NB$/;  turns the noise blanker on (at its most recent setting) if it was off and vice-versa.

NM$ (Manual Notch)

SET/RESP format:  NM$nnnnm;  where nnnn is notch pitch (150-5000 Hz) and m is 0/1 for off/on. NOTE: Applies only to CW and SSB modes.

TOGGLE format:  NM$/;  turns manual notch on if it was off and vice-versa.

NR$ (Noise Reduction)        

SET/RESP format:  NR$nnm;  where nn = NR level (0-10) and <m> is 0/1 for off/on.

TOGGLE format:  NR$/;  turns noise reduction on (at its most recent setting) if it was off and vice-versa.

OM (Option Module Info; GET only)

RESP format:  OM APXSHRL1----;  where any of the option characters, when present, indicate detected option modules (see list below). The positions of the letters are fixed. If a module is not present, its letter is replaced by a dash (-). The letters (and associated positions) in the OM string refer to the following option modules:                   

A = ATU (KAT4)

P = PA (KPA4)

X = XVTR (additional fields will be used to ID different XVTR models)

S = SUB RX (KRX4 + 2nd KDDC4, standard in K4D model)

H = HDR MODULE (KHDR4 + KDDC4-2, standard in K4HD model)

R = KREF module detected

L = LINEAR AMP detected (generic, i.e. Elecraft KPA500 or KPA1500)

1 = KPA1500 amp detected

OV$ (Overflow ADC/COR; RESP only)

RESP format:  OV$nc;  where n = ADC Overflow (0/1) and c = COR Relay status (0/1 for off/on).

NOTE: This command provides information that could be used by a host application to turn on an "ADC overflow" or "COR" indication. Internally, it is used as input to the K4's automatic front-end gain reduction algorithm. (To enable this automatic attenuation, menu entry "RX Auto Atten" must be set to On; see Menu Commands.)

PA$ (Preamp)                        

SET/RESP format:  PA$nm;  where n is 0 (off), 1 (10 dB regular preamp) 2 (160-15 m: 18 dB regular preamp; 12-6 m: LNA);  m is 0 (off), 1 (on).

TOGGLE format:  PA$/;  turns the preamp on (at most recent setting) if it was off and vice-versa.

PC (Power Control)

SET/RESP format:  PCnnnr;  where nnn is 0-255 and r is the power range:

L = low power (QRP, 0.1-25.5 W)

H = high power (QRO, 1-255 W)

X = milliwatt range (for XVTRs, 0.01-2.55 mW).

NOTE: If <r> is omitted, ‘L’ range is assumed for both SET and get response (TBD).

Also see PP command (per-band power control, barefoot or with ext. amp).

PK (Port Keying Setup: PTT, KEY, FSK)

SET/RSP format: PKnpf;

GET format: PKnp;

where:

           n = serial port number (1=USB1, 2=USB2, 3=DE9)

           p = port pin type (D=DTR, R=RTS)

           f = function (X=OFF, C=CW, P=PTT, F=FSK [DTR only])

Example: PK3DF configures DE9-DTR as a source for FSK input.

NOTE1: PTT and KEY can be obtained from multiple DTR and/or RTS lines (wire-ORed), while only one DTR source can be designated for FSK. The PK command will report a range error if a source specified for FSK is also being used as a PTT or KEY input.

NOTE2: FSK can always be applied at ACC-FSK IN. Similarly, PTT can always be applied at ACC-PTT IN as well as the front and rear-panel PTT jacks.

PM (Panadapter Mode) [TBR - Internal command]

SET/RESP format:  PMn;  where n = 1 for single padapter, 2 = dual panadapter.

PO (Power Output) [Pending]

RESP format:  POnnnn;  where nnnn is current TX power output in tenths of a watt.

SET format: POn; where n is 1 for automatic delivery. 0 is to turn off automatic delivery.

Also see
TM command, which provides real-time updates of all TX metering without polling.

PP (Per-band power) [Pending].

        TBD.

PS (Power On/Off Control)

SET/RESP format:  PSn;  where 0 = off, 1 = on.

PS0; Power off
PS8; Restart (TBD)
PS9; Standby (TBD)

TBD. The SBC supports wake-on-LAN from standby mode.

RA$ (RX Attenuator)                        

SET/RESP format:  RA$nnm;  where nn is 0/3/6/9/12/15/18/21 (dB) and m = 0 (off), 1 (on).

TOGGLE format:  RA$/;  turns the attenuator on (at the most recent setting) if was off and vice-versa.

RC$ (RIT Clear; SET only)                        

SET format:  RC;. Clears RIT and XIT offset.

RD (RIT Down; SET only) [Pending]

TBD.

RE (RX EQ)

SET/RESP format, normal:  REnabcdefgh;   where a through h are 3-character decimal fields, each specifying a range of –16 to +16 dB. +00 is "Flat." Values a - h correspond to EQ bands as follows:   a = 100 Hz, b = 200 Hz, c = 400 Hz, d = 800 Hz, e = 1200 Hz, f = 1600 Hz, g = 2400 Hz, h = 3200 Hz.

SET format, flat:  REF; sets all RX EQ bands to +00.

RG$ (RF Gain)                        

SET/RESP format:  RG$-nn;  where nn is 00 to 60 (-0 to -60 dB).

NOTE: This is an internal DSP scalar applied ahead of all other signal processing. It does not change gain ahead of the ADC. For that purpose use the PA (preamp) or RA (receive attenuation) commands.

RO$ (RIT/XIT Offset)                

SET/RESP format:  ROsnnnn;  where s is +/-, and nnnn is 0-9999. If XIT is turned on, it uses the same offset as the transmit VFO.

 

RT$ (RIT On/Off)                        

SET/RESP format:  RTn;  where n is 0 (off) or 1 (on).        

TOGGLE format:  RT$/;  turns RIT on if it was off and vice-versa.        

RU (RIT Up; SET only) [Pending]

SET/RESP format:  TBD.

RV (Firmware Revisions; GET only) [Pending]

TBD.

RX (Go to Receive Mode; SET only)

SET format:  RX;

SB (Sub RX)                        

SET/RESP format:  SBn;  where n is 0 (sub RX off) or 1 (on).

TOGGLE format:  SB/;  turns the sub RX on if it was off and vice-versa.

As on the K3, the K4's Sub RX feature allows the user to listen on both VFO A and B frequencies at the same time. On the K3 you need a KRX3 for this purpose. But on the K4, single-antenna sub RX (dual watch) is a standard feature. Adding a KRX4 provides independent dual-receive (separate antennas and BPFs for main/sub).

SC (Screen Count; count of attached monitors)

SET/RESP format:  SCn;  where n is 1 (LCD only) or 2 (LCD plus external monitor).

SD (VOX or QSK Delay)

SET/RESP format:  SDxyzzz;  where

x is 1 to turn on full CW QSK (delay = 0), or 0 to use specified QSK delay

y is mode for delay-setting purposes (C=CW & direct data, V=voice, D=AF data)

z is delay in 10-ms increments (000-255 = 0.00 to 2.55 seconds)

TOGGLE format:  SD/;  turns VOX or QSK delay on if it was off and vice-versa.

NOTE: K3 and KX version of SD is GET-only, applied only to CW mode, and used 50-ms increments (vs. 10 ms for the K4). See VX for vox enable. See VG and VI for VOX gain and antivox setup.

SG$ (System Gain; GET only)

RESP format:  SGsnn;  where s is sign (+/-) and and nn is the relative gain/loss ahead of the ADC (main or sub).

NOTE: This command is used for calibrating S meters and panadapter REF LVL. It takes into account all preamps, attenuators, splitters, and filters.

SI (System Info; SET only) [Pending]

      TBD. System voltage reports for various modules.
     
SET format:

SIDU1;  Enable delivery of DUC reports

              SIDD1;  Enable delivery of DDC reports

              SIFP1;  Enable delivery of FrontPanel reports

              SIRF1;  Enable delivery of RF reports

SM$ (S-Meter; GET only)

        

RESP format: SM$nn; where nn is s-meter value in bars (matches K4 bar graph).
SET format: SMn; where n is 1 (Automatically delivered when s-meter value changes.)

  NOTE: GET format is meta mode dependent and required for K4 style response.
 NOTE: SET format is not meta-mode dependent. Requires AI4 for delivery.

If K4 meta mode is not enabled (K41;), the response is a K3 backward compatible format.
RESP format: SM$nnnn;

SMH$ (High-Resolution S-meter; GET only)

RESP format:  SMH$+nnn; where +nnn is the signal level in dBm.

SET format: SMHn; where n is 1 (Automatically delivered when s-meter value changes.)

  NOTE: GET format is meta mode dependent and required for K4 style response.
 NOTE: SET format is not meta-mode dependent. Requires AI4 for delivery.

SN (Serial Number; GET only)

RESP format:  SNnnnnn;

SP (Spot & Autospot; SET only)

SET/RESP format:  SPn;  where n is:

0 (spot tone off), 1 (spot on without mute), 2 (spot on with mute),

         3 (autospot).

SS (Screenshot Capture) *TBD

SET format: SSd; where d is 0 (LCD) or 1 (HDMI)

  NOTE: USB memory stick is required to save screenshot captures.

SQ$ (Squelch)

SET/RESP format:  SQ$nnn;  where nnn is 000-040. Typical setting is 22.

SW (K4 Front Panel Switch emulation; SET only)

SET format:  SWnnn;  where n is switch or button ID, and can have 1, 2 or 3 digits (see list below). Also see SWT/SWH (K3/K3S switch emulation).

SPLIT                    SW1                  

A/B                          SW2          

B->A                     SW4                 

A->B                     SW5

REM ANT                  SW7                 

ANT                      SW8                 

PF1                      SW11

PF2                      SW13                 

CLR                      SW14                 

APF                      SW18

FIL                      SW19         

SCAN                  SW31         

LOCK B                   SW34                 

LOCK A                   SW35

ALT                      SW46                 

MODE                     SW47                 

LEVEL                   SW49

NB                      SW50                 

MANUAL                   SW52                 

NOTCH                    SW53

ADJ                      SW55                 

NR                       SW56                 

ATTN                     SW60

PRE                      SW61                 

RATE                  SW64                 

KHZ                          SW65

RCL                          SW66

REV Release          SW70         

REV Press                  SW71

PF3                      SW84                 

RIT                      SW85                 

SUB ANT                  SW86

RX ANT                   SW87         

AF REC                  SW88         

STORE                  SW89

AUTO                     SW91                 

SPOT                     SW92

DIV                      SW93                 

SUB                      SW94                 

TUNE LP                  SW97

TUNE                     SW98                 

QSK                      SW102                 

VOX                      SW103

PF4                      SW104                 

XIT                      SW105                 

TEST                     SW119

XMIT                     SW120

SWT/SWH (K3 Switch Tap/Hold Emulation; SET only)

Some K4 switch functions will be mapped to K3/K3S equivalent SWT/SWH switch codes for backward compatibility. (List TBD.)

TB$ (Buffered Text) [Pending]

GET format:  TB$;

RESP format:  TB$trrs;  where <t> is the number of queued transmit characters still to be sent (from KY packets; up to 9, and 9 if higher than 9); <rr> is the count of available receive characters for VFO A or VFO B; and <s> is the text string itself, which can include semicolons, etc.

TD$ (Text Decode/Encode Mode)

SET/RESP format:  TD$mt;  where <m> is the text-decode mode and <t> is the text-decode threshold (where applicable). Text decode modes for CW/DATA:  0=off, 1=on. Text encode mode for SSB: 0=2-TONE off, 1=on. Threshold settings for CW: 0=AUTO, 1-9=fixed levels. Threshold setting is not used in AFSK-A, FSK-D, and PSK-D modes..

TE (TX EQ)

SET/RESP format:  TEabcdefgh;   where  a through h are 3-character decimal fields, each specifying a range of –16 to +16 dB. +00 is "Flat." Values a - h correspond to EQ bands as follows:   a = 100 Hz, b = 200 Hz, c = 400 Hz, d = 800 Hz, e = 1200 Hz, f = 1600 Hz, g = 2400 Hz, h = 3200 Hz.

TG (TX Gain constant) [Pending]

        TBD.

TM (TX Meter Data)

Automatically delivered to clients when TX metering data changes.
AUTORESP format: TMaaabbbcccddd; where aaa is ALC (bars), bbb is CMP (dB), ccc is FWD power (watts in QRO mode, tenths of a watt in QRP mode), and ddd is SWR (1/10th units).
SET format: TMx; where x is 1 for on and 0 for off.

TQ (TX query; GET only)

RESP format:  TQn;  where n = 1 if the K4 is in transmit mode.

TS (TX Test Mode)

SET/RESP format:   TSn;  where n is 0 (test mode off) or 1 (test mode on). If TX test mode is in effect, the "TX" icon flashes and the transceier will not put out power, though it still keys any downstream gear. Can be used to pre-set mic gain and compression off-air since the ALC meter functions on audio alone.

TOGGLE format:  TS/;  turns TX test mode on if it was off and vice-versa.

TU (TUNE)                                

SET/RESP format:  TUn;  where 0=exit, 1=tune, 2=tune LP, 3=ATU tune, 4=ATU extended search tune. This emulates the TUNE, TUNE LP, and ATU switch functions. TU3 is the equivalent of tapping ATU once; TU4 emulates a 2nd tap within 5 seconds. TU0 is returned automatically the K4 drops transmit for any reason.

TX (Go to Transmit; SET only)

SET format:  TX;.  Places radio in transmit mode. Exit by sending RX.

UP/UPB (VFO Move Up; SET only)

SET format:  UP;  (move VFO A up one unit based on current VFO B step size)  or  UPB;  (same for VFO B). Also see DN/DNB and RU/RD (RIT offset up/down).

TBD: Support for K3 variants.

VG (VOX Gain)

SET/RESP format:  VGmnnn;  where: m = mode (V/voice, D/AF Data); nnn = 000-060.

Sets VOX gain for specified mode. Also see VX, VI, and SD.

VI (VOX Inhibit or anti-vox)

SET/RESP format:   VInnn;  where nnn = 000-060. Sets VOX inhibit (anti-vox) level for voice modes. Also see VX, VG, and SD.

VT$ (VFO Tune Step)

SET/RESP format:   VT$n;  where n is 0 - 5 (0 - 1Hz, 1 - 10Hz, 2 - 100Hz, etc.)

VX (VOX On/Off)

SET/RESP format:   VXmn;   where m = mode (C = CW/direct data, V = voice, D = AF data), and n = 0 (OFF) or 1 (ON). Turns VOX on/off for the specified mode. In CW, PSK-D, and FSK-D modes, VOX ON means “hit-the-key” CW is enabled (live paddle). Also see VG, VI, and SD.

TOGGLE format:  VX/;  turns VOX mode on if it was off and vice-versa.

WM (Wattmeter Calibration)

SET/RESP format:        WMpnnn;  where: p is the power class (L = low range, H = high range, X = mW/transverter range) and nnn is the calibration value (default in all three cases is 500).

XF$ (XFIL Number) [Pending]

TBD. Original format may be needed for backward compatibility, even though the basic K4 doesn't have crystal filters. A K4 with an HDR module will support this command for both receivers, as each will have two crystal filters.

XV$ (Transverter Band)

SET/RESP format:  XV$nn where nn is 00-11, corresponding to band buttons XVTR1-12. Transverter bands are configured using the XVTR menu entries.

NOTE:  The BN command can also be used to select transverter bands.

XT (XIT)

SET/RESP format:  XT$n;  where n = 0 to turn XIT on. Uses same offset value as RIT of the TX VFO, whether RIT for that VFO is turned on or not.

TOGGLE format:  XT$/;  turns XIT on if it was off and vice-versa.

Menu Access Commands

Menu access commands can be used by applications to recreate the K4's menu structure, including menu entry names and parameters (data types, ranges, current values, and default values).

MEDF (Menu Definition)

        SET/RESP format:  TBD.

ME (Menu Parameter)

SET/RESP format:  MEiiii.nnnn;  where iiii is the menu ID # and nnnn is the parameter value.

TBD: List of implemented menu entries in ID order.

MO (Menu Open)

        
SET format: MOiiii;   where iiii is the menu ID # to display on screen.
                        *Note, MO0255; will close the menu if displayed.

Display Commands

#AR (Auto-Ref Settings)

SET/RESP format (normal):  #ARaadd+oom;  where:

aa  = averaging constant (6 to 24)

dd  = debounce constant (6 to 24)

+oo = user desired offset (+/- 24)

m   = mode (1 for on, 0 for off)

SET format (special):  #ARn;  where n is:

         0 = Reset auto-ref settings (avg, trg, ofs) to defaults

1 = Manually apply current auto-ref level (one-shot)


Examples:          #AR1506+001;  (aa = 15, dd = 6, ooo=0, m=1)

#AR0906+081;  (aa = 9, dd = 6, ooo=8, m=1)

#AVG (Averaging)

SET/RESP format:         #AVGnn;  where n is 01 to 20.

#CAL$ (Panadapter Reference Level Calibration)

SET format:  #CAL$-nn; where nn is the signal level being injected, typically -73 dBm.

NOTE:  Before using #CAL for the main RX, configure as follows:

        PREAMP OFF

        ATTENUATOR OFF

        SUB RX OFF

        SPAN > 20 kHz  (suggest ~40 kHz)

When calibrating the sub receiver, make sure main RX is on a different antenna.

Calibration example (after verifying above configuration):  

#CAL-73;   (or injection level used; pause at least 1.5 seconds for convergence)
        To stop calibration: #CAL0;
Calibration must be done per-band. #CALoffset will be sent to clients.

The offset is automatically applied and only reported for informational purposes.

#DSM (Display Mode, LCD)

#HDSM (Display Mode, External Monitor)

        Allows toggling spectrum and waterfall.

SET/RESP format:        #DSMn;  where n is

0 (spectrum only)

1 (spectrum + waterfall)

2 (spectrum + power)    TBD -- for P3 compatibility
        
3 (spectrum + waterfall + power)   TBD -- for P3 compatibility

#DPM (Dual Panadapter Mode, LCD) 

#HDPM (Dual Panadapter Mode, External Monitor)

SET/RESP format:        #DPMn;  where n is:

0 = Single Panadapter, VFO A/main RX

1 = Single Panadapter, VFO B/sub RX

2 = Dual Panadapter

#FRZ (Freeze Panadapter and Waterfall)

SET/RESP format:        #FRZn; where n is 0 (run) or 1 (freeze).

Applies to both LCD and external monitor.

#FXA$ (DDC Fixed Tune Mode)

SET/RESP format:         #FXA$n;  where n is:
        0=FULL SPAN (P3)

1=HALF SPAN (P3)

2=SLIDE EDGE (P3)

3=STATIC (P3)

4=SLIDE NEAR EDGE (P4*)

Applies to both LCD and external monitor.

#FXT$ (DDC Fixed Tune toggle)

SET/RESP format:        #FXT$n;  where n is 0 (track) or 1 (fixed).

Applies to both LCD and external monitor.

#NBL$ (DDC Noise Blanker Level)

SET/RESP format:        #NBL$n;  where n is 0 to 14.

Applies to both LCD and external monitor.

#NB$ (DDC Noise Blanker toggle)

SET/RESP format:         #NB$n;  where n is 0 (off) or 1 (on).

Applies to both LCD and external monitor.

#PKM (Panadapter Peak Mode)

SET/RESP format:        #PKMn;  where n is 0 (off) or 1 (on).

#REF$ (Panadapter Reference Level, LCD)

#HREF$ (Panadapter Reference Level, External Monitor)

        SET/RESP format:         #REF$n;  where n is -200 to 60.

#SCL (Panadapter Scale)

SET/RESP format:         #SCLn;  where n is 10 to 150.

#SFL (Spectrum Fill)

        SET/RESP format:         #SFLn;  where n is 0 (none) or 1 (fill)

#SPM (Span Adjust Mode)

RESP format:  #SPM0;  (Always in continuous mode)

#SPN$ (Desired Span)

*P3 incompatibility, TBD

SET/RESP format:        #SPN$n;  where n is 6000 to 368000.

Applies to both LCD and external monitor.

Examples:          #SPN46125; (sets span to 46.125 kHz)

#SPN46;    (sets span to 46.000 kHz)  *Alternate set format


#WBS (Waterfall Color Range, LCD)  

#HWBS (Waterfall Color Range, External Monitor)  [#SVWB alias]

SET/RESP format:         #WBSn;  where n is 5 to 30.

#WFC$ (LCD Waterfall Color Mode)

#HWFC (Waterfall Color Mode, External Monitor)

        SET/RESP format:        #WFC$n;  where n is:

0 (gray)

1 (color),

2 (teal tone),

3 (blue tone),

4 (sepia tone)

#WFH (Waterfall Height, LCD)

#HWFH (Waterfall Height, External Monitor)

SET/RESP format:         #WFHnnn;  where nnn is 000 to 100 percent.

#VFA (VFO A Cursor Display Mode)

SET/RESP format:         #VFAn;  where n is:

        0 = OFF: VFO cursor is not displayed
        1 = ON: VFO cursor is displayed always

2 = AUTO: VFO cursor is automatically hidden in waterfall

        3 = HIDE: Do not show VFO cursor in waterfall


#VFB (VFO B Cursor Display mode)

SET/RESP format:        #VFBn; where n is 0-3 (see #VFA, above).

Pending Display Commands

Panadapter Frequency Control (for P3 compatibility):


        #CTF$ (*See FI$ command and FC$ command as alternative)

Panadapter Markers:


        #MFA (Marker Frequency)
        #MFB (Marker Frequency)
        #MKA (Marker Display Mode)
        #MKB (Marker Display Mode)
        #QSY (QSY to marker, support one-level undo)

P3 Commands Not Supported

The following P3 commands are not presently supported:

#BMP, #BR, #ER, #EW, #FNL, #FNX, #FON, #LBL, #LD, #PS, #PT, #RCF, #RST

#RVF, #RVM, #RVS, #SVDT, #SVEN, #SVFN, #SVRS

#TP, #XCV

Static default responses for the above will be added as required to retain backward compatibility.

Change History

Rev. A1, Sept 5, 2020:  Initial release with Radio Commands only.

Rev. A2, Sept 17, 2020:  Added Menu Access Commands and Display Commands.

Rev. A3, Nov. 12, 2020:  Command definitions updated for consistency. Added preliminary Streaming Data section.

Rev. A4, Nov. 13, 2020:  Fixed broken links. Removed deprecated AR8/AR$8 option (RX ANT, main=sub). Completed switch ID table (SW command).

Rev. B1, Dec. 21, 2020:  Minor text corrections.

Rev. B2, Jan. 13, 2021: Added
VT command definition. Added MS and LI set-only extensions. Documented calibration steps needed for #CAL.

Rev. B2, Jan 31, 2021: Updated
SM command definition. Updated SMH command definition. Added SS command definition. Updated AP command definition. Updated #DPM command definition. Added MO command definition.

Rev. B3, Feb. 25, 2021:  Added note that manual notch applies only to CW and SSB modes. Added transverter band info to BN command. Added XV command (alternative means of selecting transverter bands).


Back to Table of Contents