MATerm.tcl --- a simple TCL/TK rig control program and morse terminal for K2


Þessi síða hefur verið heimsótt ---- sinnum síðan Maí 17 2003


MATerm.tcl is a simple TCL/TK program for sending words to the internal keyer of the Elecraft K2 tranceiver. It opens a serial port connection to the K2 and sends words or characters to the internal keyer using the KY command. Two windows are opened on the screen with buttons all around. The upper window is for entering text, the lower window shows the text sent to the K2 internal keyer. The words are sent to the K2 as soon as a space or newline is entered in the upper window.
Resending a word is simple just backspace to the end of the word and press space again, the word will be sent again.
Text from a text file can also be sent to K2. This needs more work, but currently the program waits for some time after sending each word, depending of the length of the word, 600ms*wordlength at 20WPM speed. The speed selector in the File button is for setting the delay, you can adjust the KEYER speed in K2 afterwards using the speed pot. This prevents buffer overflow, but is clumsy.
Buttons with user defined fixed texts are also available. The text and button names can be configured at will, but keep the word lengths to less than 23 characters and the button names short.
User defined button and commands/messages are programmed using a popup screen, the result is stored in a text file called ~/.MATermrc, which is read durning start and after editing. There is a 23 character wordlength limit, but strings can be longer as each word is sent to K2 separatly.

The GUI the MATerm.tcl --- Tune, vfo and mode indicators and 18 user def commands and 10 user def messages

Mynd
This shows the MATerm.tcl in CW mode.
Mynd_file
This shows the MATerm.tcl in CW mode, with the File and Keyer and Power windows open.

Tuning with MouseWheel --- point the cursor at TUNE and use the MouseWheel

MATerm.tcl features

Buttons on the Left side (L1 to L10) are for sending commands to K2, L3 to L10 are user defined, you can send any command or command sequence (see KIO2 programmer's Reference) to K2.
Buttons on the Rigth side (R1 to R10) are for sending messages to K2 keyer, all 10 send user defined texts
All 10 bottom buttons (B1 to B10) are user defined, and can be used to send any command or command secquence to K2.
The F1 to F8 buttons send user defined texts.

Defining new commands --- UP1, UP5, UP10, QRO, QRP, etc --- see the Edit popup window

Mynd
Look at the KIO2 programmers manual and program the appropriate command sequence for doing these, use the Edit popup screen and name the button. Buttons F1 to F8 texts are user defined and have some macros.

F1 to F8, and live keyboard and macros

File --->Live keys puts the keyboard in live mode, sendig each character as it is typed.
Right side buttons can now send variables, $log(RST_SENT) sends the RST field.

Example: Quick split operating

Is the DX-staion working split, UP 5? --- no problem, tune in on the station, Press UP5, then press Split, and you are ready!! Easy to emulate the K2's pushbutton sequences :-).

Example: Sched frequencies --- 14.330, 14.285, 18.132

Popup the Edit window and program the buttons.

Need more buttons or different layout?

Edit the MATerm.tcl program code, but you have to learn some TCL/TK...
Please use some other name for your program and remember that the code is distributed under GPL , which means that you can copy it, use it and modify it as long as you let other people do the same to your version.

Installation

I have only tested this program under Debian Linux using TCL 8.3 and TK 8.3, but it should work on all Un*x platforms, and hopefully on Windblow$ as well, if you have TCL/TK installed.
Go to the Tcl/Tk home for downloading the TCL/TK interpreter for various operating systems, go to the Software section
You run the code as an ordinary user. You have to have write permissions to the serial port you use, in Debian Linux the serial ports are group writable by dialout, so put yourself in the dialout group and connect the serial cable to the appropriate port. Then install the MATerm.tcl somewhere in PATH, I use ~/bin, make MATerm.tcl runnable by:
chmod 755 MATerm.tcl
and change the SERIAL_PORT entry to the the serial Port (/dev/ttyS0 or /dev/ttyS1 in Linux) you use.

Initial testing and using

Invoce the program and put the K2 in CW testmode, (hold down the MODE button, while in CW mode), or just press the CW-T button.
Set the power output to minimum, and type in a word, if all goes well you will hear the K2 outputting the morse code when you enter text plus a newline or space. Then to try it on the air, press the CW-O button and adjust the power. To abort sending the current word/message press Break.
To send a file, select File->open and then File->send. This feature can be used for practicing (with K2 in CW test mode) or even sending bulletins.

Short Help


File and Clear buttons can not be user programmed. The top 8 buttons are preconfigured K2 commands. The function of the buttons is as follows:
Missing features, many of course, but bliking mode display to indicate VOX or CW-Test mode would be handy, maybe an indicator would do?

Download MATerm.tcl program

This program is available under the GPL. Last updated Lau Maí 31 10:17:07 GMT 2003

More TCL/TK programs for K2


Back