 diff -u roverlog-2.6.6-stock/rig.tcl roverlog-2.6.6/rig.tcl
--- roverlog-2.6.6-stock/rig.tcl	2010-04-27 10:08:29.000000000 -0400
+++ roverlog-2.6.6/rig.tcl	2010-04-27 11:08:23.000000000 -0400
@@ -158,6 +158,17 @@
       }
       return
     }
+    "Yaesu FT-897" {
+      set stuff(response) "$stuff(response)$r"
+      if { [ string length $stuff(response) ] == 5 } {
+        Parse_Response $stuff(response)
+        set stuff(response) ""
+      } elseif { [ string length $stuff(response) ] == 1 } {
+        Debug "Serial Read" "Dumping FT-897 ACK byte"
+	set stuff(response) ""  
+      }
+      return
+    }
     "Yaesu FT-1000" {
       set stuff(response) "$stuff(response)$r"
       if { [ string length $stuff(response) ] == 16 } {
@@ -392,6 +403,55 @@
       }
       return
     }
+    "Yaesu FT-897" {
+      Debug "Parse_Response" "Parsing Yaesu FT-897 message"
+      Dump_Buffer $response
+
+      if { [ binary scan $response "c1c1c1c1c1" f0 f1 f2 f3 mode ] == 5 } {
+        # convert signed to unsigned
+        set f0 [ expr ( $f0 + 0x100 ) % 0x100 ]
+        set f1a [ expr ( $f1 + 0x100 ) % 0x100 / 16 ]
+        set f1b [ expr ( $f1 + 0x100 ) % 0x100 - 16 * $f1a]
+        set f2 [ expr ( $f2 + 0x100 ) % 0x100 ]
+        set f3 [ expr ( $f3 + 0x100 ) % 0x100 ]
+
+        # convert to a text representation
+        set f0 [ format "%02.2x" $f0 ]
+        set f1a [ format "%01.1x" $f1a ]
+        set f1b [ format "%01.1x" $f1b ]
+        set f2 [ format "%02.2x" $f2 ]
+        set f3 [ format "%02.2x" $f3 ]
+
+        set rf "$f0${f1a}.$f1b$f2$f3"
+        Debug "Parse_Response" "Rig frequency $rf"
+        scan $rf "%f" rf
+        set stuff(rigfreq) [ format "%6.4f" $rf ]
+
+        switch -exact -- $mode {
+          2 -
+          3 {
+            set stuff(rigmode) "CW"
+          }
+          0 -
+          1 {
+            set stuff(rigmode) "PH"
+          }
+          6 -
+          8 {
+            set stuff(rigmode) "FM"
+          }
+          10 -
+          12 {
+            set stuff(rigmode) "RY"
+          }
+          default {
+            set stuff(rigmode) "PH"
+          }
+        }
+        Debug "Parse_Response" "Rig mode $stuff(rigmode)"
+      }
+      return
+    }
     "Yaesu FT-1000" {
 
       # debug
@@ -749,6 +809,62 @@
       Serial_Write $b
 
     }
+    "Yaesu FT-897" {
+
+      # Set to CW
+      set b [ binary format H2H6H2 02 000000 07 ]
+  
+      # debug
+      Debug "Set_USB_CW_Split_On" "Sending FT-897 Set CW command"
+      Dump_Buffer $b
+
+      # send the buffer
+      Serial_Write $b
+
+      Sleep 50
+
+      # ------
+
+      # Swap VFO A/B
+      set b [ binary format H8H2 00000000 81 ]
+  
+      # debug
+      Debug "Set_USB_CW_Split_On" "Sending FT-897 Set to VFOB command"
+      Dump_Buffer $b
+
+      # send the buffer
+      Serial_Write $b
+
+      Sleep 50
+
+      # ------
+
+      # Set to USB
+      set b [ binary format H2H6H2 01 000000 07 ]
+  
+      # debug
+      Debug "Set_USB_CW_Split_On" "Sending FT-897 Set USB command"
+      Dump_Buffer $b
+
+      # send the buffer
+      Serial_Write $b
+
+      Sleep 50
+
+      # ------
+
+      # Set Split On
+      set b [ binary format H8H2 00000000 02 ]
+  
+      # debug
+      Debug "Set_USB_CW_Split_On" "Sending FT-897 Split On command"
+      Dump_Buffer $b
+
+      # send the buffer
+      Serial_Write $b
+
+      Sleep 50
+    }
   }
 
   return
@@ -770,6 +886,16 @@
       # send the buffer
       Serial_Write $b
     }
+    "Yaesu FT-897" {
+	set b [ binary format H2H2H2H2H2 00 00 00 00 82 ]
+
+	# debug
+	Debug "Send_Split_Off" "Sending FT-897 Split Off command"
+	Dump_Buffer $b
+
+	# send the buffer
+	Serial_Write $b
+    }
   }
 
   return
@@ -943,6 +1069,32 @@
 
       return
     }
+    "Yaesu FT-897" {
+      switch -exact -- $rigmode {
+        "CW" {
+          set mc "02"
+        }
+        "RY" {
+          set mc "0a"
+        }
+        "FM" {
+          set mc "08"
+        }
+        default {
+          set mc "01"
+        }
+      }
+      set b [ binary format H2H2H2H2H2 $mc $mc $mc $mc 07 ]
+  
+      # debug
+      Debug "Send_Mode" "Sending Yaesu FT-897 mode command"
+      Dump_Buffer $b
+
+      # send the buffer
+      Serial_Write $b
+
+      return
+    }
     "Yaesu FT-1000" {
 
       switch -exact -- $rigmode {
@@ -1160,6 +1312,49 @@
 
       return
     }
+    "Yaesu FT-897" {
+
+      # set up commands
+      set b [ binary format H10 0000000000 ]
+
+      # get the 100 and 10 MHz digits
+      set f [ expr $rigfreq * 1000000.0 ]
+      set f0 [ expr int($f/10000000.0) ]
+      set f0c [ format "%02.2d" $f0 ]
+
+      # get the 1 MHz and 100 kHz digits
+      set f [ expr $f - $f0 * 10000000.0 ]
+      set f1 [ expr int($f/100000.0) ]
+      set f1c [ format "%02.2d" $f1 ]
+
+      # get the 10 and 1 kHz digits
+      set f [ expr $f - $f1 * 100000.0 ]
+      set f2 [ expr int($f/1000.0) ]
+      set f2c [ format "%02.2d" $f2 ]
+
+      # get the 100 and 10 Hz digits
+      set f [ expr $f - $f2 * 1000.0 ]
+      set f3 [ expr int($f/10.0) ]
+      set f3c [ format "%02.2d" $f3 ]
+
+      set l [ binary format H2H2H2H2H2 $f0c $f1c $f2c $f3c 01 ]
+      set t [ binary format H10 0000000080 ]
+
+      # Debug
+      Debug "Send_Freq" "Sending Yaesu FT-897 command"
+      # Dump_Buffer $b
+      Dump_Buffer $l
+      # Dump_Buffer $t
+
+      # Turn on CAT
+      # Serial_Write $b
+      # Send Freq
+      Serial_Write $l
+      # Turn off CAT
+      # Serial_Write $t
+
+      return
+    }
     "Yaesu FT-1000" {
 
       # get the 100 and 10 MHz digits
@@ -1303,6 +1498,27 @@
       # This does not seem to be necessary
       # Serial_Write $t
     }
+    "Yaesu FT-897" {
+      
+      # set up the commands
+      set b [ binary format H10 0000000000 ]
+      set l [ binary format H10 0000000003 ]
+      set t [ binary format H10 0000000080 ]
+      set stuff(querystate) "freq"
+
+      # debug
+      Debug "Query_Freq" "Sending Yaesu FT-897 query"
+      # Dump_Buffer $b
+      Dump_Buffer $l
+
+      # Turn on CAT
+      # Serial_Write $b
+      # Query Freq
+      Serial_Write $l
+      # Turn off CAT
+      # This does not seem to be necessary
+      # Serial_Write $t
+    }
     "Yaesu FT-1000" {
 
       # set up the freq query command
@@ -1354,6 +1570,9 @@
     "Yaesu FT-847" {
       Query_Freq
     }
+    "Yaesu FT-897" {
+      Query_Freq
+    }
     "Yaesu FT-1000" {
       Query_Freq
     }
@@ -1424,7 +1643,7 @@
   set stuff(response) ""
 }
 
-set stuff(rigtypes) { "Simulated" "Icom" "TenTec Omni VI" "Kenwood" "Elecraft K2" "Elecraft K3" "Yaesu FT-817" "Yaesu FT-847"  "Yaesu FT-1000" "Yaesu FT-2000" }
+set stuff(rigtypes) { "Simulated" "Icom" "TenTec Omni VI" "Kenwood" "Elecraft K2" "Elecraft K3" "Yaesu FT-817" "Yaesu FT-847"  "Yaesu FT-897" "Yaesu FT-1000" "Yaesu FT-2000" }
 
 menubutton .mbserport -text "Rig Serial Port" -menu .mbserport.m -relief raised
 set w [ menu .mbserport.m -tearoff 0 ]
