AB3AP's K2 Rig Control Software
(Firmware 2.04 required)


The rig on 40m, VFO A, preamp on, reverse CW. Looks familiar, eh? :-)

Written in Java

I've written a Java program that uses the K2's KIO2 serial port to control the rig from the laptop in my shack. One advantage of Java is the large collection of libraries that makes writing graphically oriented code quick and easy. Another, to use Sun's catch phrase, is that Java is a "write once, run anywhere" language. It's nice to be able to use the same code on many platforms without the need for recompiling.

The rig image is from the front of the K2 pdf manual so using the program is as familiar as using your real K2. Note that the image above isn't a mock up; it's a snapshot of the working interface. A click of the mouse on a button is just like a tap on a real K2 button. A click & hold of the mouse button gives you the secondary button function just like when you hold the button on the K2 for a little longer. Similarly, you can click and hold the mouse cursor on knobs to spin them (with the exceptions of the AF and RF gain knobs because those functions can't be computer controlled). So if you use a K2 you know how to use this program.

Comparison Between K2 and Program

Here are short lists of where each has advantages over the other. I strongly recommend using the real K2, not my software, when making any changes to the K2 through MENU or monitoring any measurements related to power.

Where the Real K2 Wins

The K2 has advantages the program does not.

Where the K2 Rig Control Software Wins

But the software has some advantages, too.

Starting the Software

Once you have it installed, as described on the bottom of the previous page, using the program is easy. But don't forget - you must right-click anywhere in the picture and then choose the name of the serial port that your K2 is hooked up to. Now you should be and running and controlling your K2 with the mouse!

Click briefly on a button to simulate a button tap, and click and hold to simulate a push and hold on the K2. To spin knobs, click and hold the mouse button down anywhere within a knob and then move the mouse. While moving, the mouse doesn't have to remain within the knob area. It's actually helpful for fine adjustments to pull the mouse farther from the knob.

Phantom Buttons

This is a feature I badly needed, which I'm sure is why it occurred to me in the first place, as it lets me finally learn all the dual button combos. Here are pictures of the NF (notch filter on/off) and NR (noise reduction on/off) phantom buttons when your mouse moves along the right edge of the rig. They pop up and give you the choice of clicking on the "real" (original) buttons or on the phantom button to get the multi-button combo function.

Notch filter on/off. Noise reduction on/off.

Similarly, phantom buttons appear when the mouse moves over them in the same area of the front panel for FIL (check filter status), AGC (AGC on/off), and RIT (Fine RIT on/off), as shown in the following pictures.

Filter status. AGC on/off. Fine RIT on/off.

Finally there is the phantom button representing the dual DISPLAY/TUNE combination. It displays the forward and reflected power.

When a phantom button appears - and same goes for the "F" that appears by the BAND buttons - simply click on it like any other button for that function.

As mentioned earlier, I find it handy to have the K2 program running while I'm reading the pdf version of manuals. For the KDSP2 this has especially been the case when trying to become familiar with its many submenus. Reaching between rig and manual gets a little frustrating after a while and using the rig control software saves you that.

How It Works

The program sends commands to the K2 based on the buttons you click or the knobs you spin. In addition a timer is continually running that wakes up every 100 milliseconds. If another command is not being acted upon, the program will ask the K2 (with a DS command) to send the state of its screen which the program will then mimic. Before a display update request is sent to the K2 the program first checks that the rig is in receive mode. Simple, right? That's really all there is to it: map a click or key press to a rig function, send it to the K2, update the display, and then take a short nap. The devil is in the details.

Continual polling is used so that the screen display is correct even if the op uses the real buttons rather than the on-screen ones. If we're willing to do away with that consideration, state could be kept internally and polling eliminated. Food for thought.

What Doesn't Work

I don't like how the keyer knob works. It would be nicer if regardless of where you click on the knob that spinning would be relative to the current setting. Instead it sets speed immediately based on where you click. Why? I got tired doing all the coding and instead wrote up this page...

Other considerations are compensating for times when the K2 DS command doesn't give annunciator info, e.g., underlining during MENU, EDIT, DISPLAY, and the 3 second blink cycle during FINE RIT. At the moment I don't try to compensate for any firmware short comings but just report data as received.