<!--
	Rig definition file for use with fldigi
-->

<RIGDEF>

<!-- Rig definition file for the following transceiver -->

<RIG>Kenwood TS-50</RIG>

<PROGRAMMER>
	Dave Freese		W1HKJ
	Tester:			
</PROGRAMMER>

<STATUS>
	Alpha
	revision		1.0
	date: 			2008 Feb 11
</STATUS>

<!--
	Title for the RigCAT dialog box that is used for rig control in fldigi
-->

<TITLE>Rig Control - TS-50</TITLE>

<!-- Instructions for setting up the port
	BAUD	 normal baud rate that transceiver operates at for CAT
	DEVICE   full path to the serial device, can be ttySx or ttyUSBx for example
	ECHO	 set to true for CI-V type of interface in which a h/w loop back sends all
			 outgoing data from Tx to Rx, or if the transceiver echos the data stream
	RETRIES  # times that the computer tries to send a command sequence before failure
	TIMEOUT  time in milliseconds between retries
	WAIT	 time to wait between successive transmissions
	DTRINIT  inititialized state of the DTR pin, +/- 12 are valid entries.  This is the 
			 voltage level that will be available at the DTR pin.  For some CI-V type of 
			 interfaces this voltage may be used to power the serial converter
	DTRPTT   logic true or false designating whether the DTR pin is used for PTT.
			 PTT ON will toggle the DTRINIT state, ie: if +12 it goes to -12, if -12 it
			 changes to +12.
	RTSINIT  inititialized state of the RTS pin, same as for DTR
	RTSPTT   specifies whether the RTS pin is used for PTT, same logic as with DTR.
	RTSCTS   specifies whether hardware flow control is used with the radio
			 Many of the Kenwood rigs require RTS/CTS flow control.
			 Set to true to enable this type of control
			 NOTE: you cannot use both RTSCTS and RTSPTT.  If you set both to true the RTSCTS
			 flow control will have priority.
-->  

<PORT>
	<DEVICE>/dev/ttyS0</DEVICE>
	<BAUD>4800</BAUD>
	<STOPBITS>2</STOPBITS>
	<ECHO>false</ECHO>
	<RETRIES>4</RETRIES>
	<TIMEOUT>200</TIMEOUT>
	<WAIT>0</WAIT>
	<DTRINIT>-12</DTRINIT>
	<DTRPTT>false</DTRPTT>
	<RTSINIT>-12</RTSINIT>
	<RTSPTT>false</RTSPTT>
	<RTSCTS>true</RTSCTS>
 </PORT>
  
<MODES>
	<ELEMENT>
		<SYMBOL>LSB</SYMBOL>
		<BYTE>31</BYTE>
	</ELEMENT>
	<ELEMENT>
		<SYMBOL>USB</SYMBOL>
		<BYTE>32</BYTE>
	</ELEMENT>
	<ELEMENT>
		<SYMBOL>CW</SYMBOL>
		<BYTE>33</BYTE>
	</ELEMENT>
	<ELEMENT>
		<SYMBOL>FM</SYMBOL>
		<BYTE>34</BYTE>
	</ELEMENT>
	<ELEMENT>
		<SYMBOL>AM</SYMBOL>
		<BYTE>35</BYTE>
	</ELEMENT>
</MODES>

<!-- lsb mode strings should match those given in the modes symbol specifier -->  

<LSBMODES>
	<STRING>LSB</STRING>
</LSBMODES>

<!-- frequency & mode data are contained in the IF; response
	 IFaaaaaaaaaaaXXXXXbbbbbcdXeefghjklmmX;
	 12345678901234567890123456789012345678
	 where:
		 aaaaaaaaaaa => decimal value of vfo frequency
		 bbbbb => rit/xit frequency
		 c => rit off/on
		 d => xit off/on
		 e => memory channel
		 f => tx/rx
		 g => mode
		 h => function
		 j => scan off/on
		 k => split off /on
		 l => tone off /on
		 m => tone number
		 X => unused characters
-->  

<REPLY>
	<SYMBOL>MODE</SYMBOL>
	<SIZE>38</SIZE>
	<STRING>IF</STRING>
	<FILL>27</FILL>
	<DATA>
		<DTYPE>BYTE</DTYPE>
		<SIZE>1</SIZE>
	</DATA>
	<FILL>7</FILL>
	<STRING>;</STRING>
</REPLY>

<REPLY>
	<SYMBOL>FREQ</SYMBOL>
	<SIZE>38</SIZE>
	<STRING>IF</STRING>
	<DATA>
		<DTYPE>DECIMAL</DTYPE>
		<SIZE>11</SIZE>
		<MAX>99999999999</MAX>
		<MIN>00001500000</MIN>
		<RESOL>1</RESOL>
	</DATA>
	<FILL>24</FILL>
	<STRING>;</STRING>
</REPLY>

<COMMAND>
	<SYMBOL>SETFREQ</SYMBOL>
	<SIZE>14</SIZE>
	<STRING>FA</STRING>
	<DATA>
		<DTYPE>DECIMAL</DTYPE>
		<SIZE>11</SIZE>
		<MAX>99999999999</MAX>
		<MIN>00001500000</MIN>
		<RESOL>1</RESOL>
	</DATA>
	<STRING>;</STRING>
</COMMAND>

<COMMAND>
	<SYMBOL>GETFREQ</SYMBOL>
	<SIZE>3</SIZE>
	<STRING>IF;</STRING>
	<INFO>FREQ</INFO>
</COMMAND>

<COMMAND>
	<SYMBOL>SETMODE</SYMBOL>
	<SIZE>4</SIZE>
	<STRING>MD</STRING>
	<DATA>
		<DTYPE>BYTE</DTYPE>
		<SIZE>1</SIZE>
	</DATA>
	<STRING>;</STRING>
</COMMAND>

<COMMAND>
	<SYMBOL>GETMODE</SYMBOL>
	<SIZE>3</SIZE>
	<STRING>IF;</STRING>
	<INFO>MODE</INFO>
</COMMAND>

<COMMAND>
	<SYMBOL>PTTON</SYMBOL>
	<SIZE>3</SIZE>
	<STRING>TX;</STRING>
</COMMAND>

<COMMAND>
	<SYMBOL>PTTOFF</SYMBOL>
	<SIZE>3</SIZE>
	<STRING>RX;</STRING>
</COMMAND>

</RIGDEF>
