Download Print this page
ELECRAFT K4 Programmer's Reference Manual

ELECRAFT K4 Programmer's Reference Manual

Hide thumbs Also See for K4:

Advertisement

Quick Links

ELECRAFT K4 PROGRAMMER'S REFERENCE
Copyright 2021 Elecraft, Inc.
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
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
Multiple remote-control clients are supported via the Ethernet and USB ports (see
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).
Rev. B12
Streaming
Command Reference
Multiple Client
Data,
sections.

Advertisement

loading

Summary of Contents for ELECRAFT K4

  • Page 1 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.
  • Page 2 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.
  • Page 3 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;...
  • Page 4: Streaming Data

    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.).
  • Page 5 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.
  • Page 6 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 on HF-6 meters only (see note below). This is also the receive antenna for either receiver (main or sub) when sharing the transmit antenna.
  • Page 7 (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.
  • Page 8 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).
  • Page 9 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.
  • Page 10 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.
  • Page 11 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...
  • Page 12 In CW mode, this character terminates any CW message Quickly terminates TX in FSK/PSK modes (EOT on built-in keyboard) 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.
  • Page 13 (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>...
  • Page 14 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"...
  • Page 15 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).
  • Page 16 L = LINEAR AMP detected (generic, i.e. Elecraft KPA500 or KPA1500) 1 = KPA1500 amp detected 4 = Identifies the radio as a K4 (S & 4 = K4D; S, H, and 4 = K4HD) OV$ (Overflow ADC/COR; RESP only) RESP format: OV$nc;...
  • Page 17 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"...
  • Page 18 199.5, 203.5, 206.5, 210.7, 218.1, 225.7, 229.1, 233.6, 241.8, 250.3, 254.1 NOTE: Tone numbers (shown as #nn above) are not standardized by the EIA/TIA; they vary by manufacturer. The K4's PL command uses them only as a monotonic table index. PM (Panadapter Mode) [TBR - Internal command] SET/RESP format: PMn;...
  • Page 19 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;.
  • Page 20 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.
  • Page 21 (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).
  • Page 22 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. n can have 1, 2 or 3 digits. See full list of switch emulation codes below.
  • Page 23 SW74; XMIT SW30; 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;...
  • Page 24 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"...
  • Page 25 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;.
  • Page 26 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.
  • Page 27 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) GET format: MEDFiiii; where iiii is the menu ID #. Returns menu entry name string and parameter format specifications.
  • Page 28 KRX4 2ND RX Option 0005 LCD Brightness 0036 LED Brightness 0037 Message Repeat Interval 0087 Mouse L/R Button QSY 0074 Panadapter Full Span 0099 Per-Band Power 0046 Preamp 3 (12/10/6 m) 0093 Radio Serial Number 0033 Radio Type 0034 Reference Freq 0040 RIT CLR 2nd Tap Restore 0042...
  • Page 29: Display Commands

    XVTR OUT Test 0075 MO (Menu Open) This command can be used to open the menu on the K4 LCD and set it to the specified menu entry. SET format: MOiiii; where iiii is the menu ID # to display on screen.
  • Page 30 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 >...
  • Page 31 #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.
  • Page 32 #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.
  • Page 33: Change History

    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)
  • Page 34 Added transverter band info to BN command. Added XV command (alternative means of selecting transverter bands). Rev. B4, Mar. 2, 2021: Updated OM command. Now returns a '4' to ID a K4/D/HD. Added 'M' for K4-Mini (K4/0). Removed 'R' (KREF4 is not an option).
  • Page 35 Rev. B12, July 14, 2021: Updated SW command values. Added list of menu entries (see ME command). Back to Table of Contents...