Index: trunk/desktop/mainWindow.rbfrm
===================================================================
--- trunk/desktop/mainWindow.rbfrm	(revision 29)
+++ trunk/desktop/mainWindow.rbfrm	(revision 30)
@@ -37,5 +37,5 @@
       InitialParent   =   ""
       Italic          =   ""
-      Left            =   312
+      Left            =   413
       LockBottom      =   True
       LockedInPosition=   False
@@ -67,5 +67,5 @@
       InitialParent   =   ""
       Italic          =   ""
-      Left            =   412
+      Left            =   512
       LockBottom      =   True
       LockedInPosition=   False
@@ -75,34 +75,4 @@
       Scope           =   0
       TabIndex        =   5
-      TabPanelIndex   =   0
-      TabStop         =   True
-      TextFont        =   "System"
-      TextSize        =   0
-      TextUnit        =   0
-      Top             =   388
-      Underline       =   ""
-      Visible         =   True
-      Width           =   88
-   End
-   Begin PushButton PushButton_Reset
-      AutoDeactivate  =   True
-      Bold            =   ""
-      Cancel          =   ""
-      Caption         =   "Reset"
-      Default         =   ""
-      Enabled         =   False
-      Height          =   20
-      HelpTag         =   ""
-      Index           =   -2147483648
-      InitialParent   =   ""
-      Italic          =   ""
-      Left            =   512
-      LockBottom      =   True
-      LockedInPosition=   False
-      LockLeft        =   ""
-      LockRight       =   ""
-      LockTop         =   ""
-      Scope           =   0
-      TabIndex        =   6
       TabPanelIndex   =   0
       TabStop         =   True
@@ -3293,11 +3263,4 @@
 	#tag EndEvent
 #tag EndEvents
-#tag Events PushButton_Reset
-	#tag Event
-		Sub Action()
-		  ICSSerialPort1.resetCar
-		End Sub
-	#tag EndEvent
-#tag EndEvents
 #tag Events TabPanel1
 	#tag Event
Index: trunk/desktop/ICSSerialPort.rbbas
===================================================================
--- trunk/desktop/ICSSerialPort.rbbas	(revision 28)
+++ trunk/desktop/ICSSerialPort.rbbas	(revision 30)
@@ -2,137 +2,63 @@
 Protected Class ICSSerialPort
 Inherits serial
-	#tag Method, Flags = &h0
-		Sub resetCar()
-		  //This sends the command to reset the car back to a default configuration
-		  //Defaults are different for each car type
-		  setDefaultValues
-		  
-		  //Send the default values to the car
-		  writeCar
-		End Sub
-	#tag EndMethod
-
-	#tag Method, Flags = &h0
-		Sub setDefaultValues()
-		  //Set the defaults for the bytes sent to a car
-		  
-		  select case carType
-		    
-		  case "MR-03"
-		    byte01 = chrb(&hD5)
-		    byte02 = chrb(&h5A)
-		    byte03 = chrb(&h64)
-		    byte04 = chrb(&hFF)
-		    byte05 = chrb(&h02)
-		    byte06 = chrb(&h02)
-		    byte07 = chrb(&h01)
-		    byte08 = chrb(&hFF)
-		    byte09 = chrb(&hBC)
-		    byte10 = chrb(&h44)
-		    byte11 = chrb(&h88)
-		    byte12 = chrb(&h78)
-		    byte13 = chrb(&hFF)
-		    byte14 = chrb(&h2C)
-		    byte15 = chrb(&h05)
-		    byte16 = chrb(&h5A)
-		    byte17 = chrb(&h3C)
-		    byte18 = chrb(&h87)
-		    
-		  case "dNaNo"
-		    byte01 = chrb(&hD5)
-		    byte02 = chrb(&h5A)
-		    byte03 = chrb(&hFF)
-		    byte04 = chrb(&hFF)
-		    byte05 = chrb(&h0A)
-		    byte06 = chrb(&h03)
-		    byte07 = chrb(&h01)
-		    byte08 = chrb(&h40)
-		    byte09 = chrb(&hBC)
-		    byte10 = chrb(&h44)
-		    byte11 = chrb(&h88)
-		    byte12 = chrb(&h78)
-		    byte13 = chrb(&h03)
-		    byte14 = chrb(&hFF)
-		    byte15 = chrb(&hFF)
-		    byte16 = chrb(&h80)
-		    byte17 = chrb(&h80)
-		    byte18 = chrb(&hA7)
-		    
-		  case "ASF"
-		    byte01 = chrb(&hD5)
-		    byte02 = chrb(&h5A)
-		    byte03 = chrb(&hFF)
-		    byte04 = chrb(&hFF)
-		    byte05 = chrb(&h0A)
-		    byte06 = chrb(&h03)
-		    byte07 = chrb(&h01)
-		    byte08 = chrb(&h78)
-		    byte09 = chrb(&hBC)
-		    byte10 = chrb(&h44)
-		    byte11 = chrb(&h88)
-		    byte12 = chrb(&h78)
-		    byte13 = chrb(&h03)
-		    byte14 = chrb(&hFF)
-		    byte15 = chrb(&hFF)
-		    byte16 = chrb(&hFF)
-		    byte17 = chrb(&hFF)
-		    byte18 = chrb(&hDD)
+	#tag Event
+		Sub DataAvailable()
+		  //Add to the buffer first
+		  
+		  buffer = buffer + me.ReadAll
+		  
+		  //Figure out if we need to do anything
+		  
+		  select case mode
+		    
+		  case "read"
+		    dim flagstart as integer
+		    dim datastart as integer
+		    
+		    //We need to decode the packet to figure out the values
+		    
+		    //First we need to make sure we have enough data
+		    //If not we need to wait for more
+		    
+		    flagstart = InStrb(buffer, ChrB(&h5A))
+		    
+		    if flagstart = 0 then
+		      //We did not find a match so we can discard the data and wait for more
+		      buffer =  ""
+		      return
+		    ElseIf lenb(buffer) < 17 + flagStart - 1 then
+		      // we do not have a complete packet return and wait
+		      return
+		    end if
+		    
+		    datastart = flagstart + 1
+		    
+		    byte03 = midb(buffer, datastart, 1)
+		    byte04 = midb(buffer, datastart+1, 1)
+		    byte05 = midb(buffer, datastart+2, 1)
+		    byte06 = midb(buffer, datastart+3, 1)
+		    byte07 = midb(buffer, datastart+4, 1)
+		    byte08 = midb(buffer, datastart+5, 1)
+		    byte09 = midb(buffer, datastart+6, 1)
+		    byte10 = midb(buffer, datastart+7, 1)
+		    byte11 = midb(buffer, datastart+8, 1)
+		    byte12 = midb(buffer, datastart+9, 1)
+		    byte13 = midb(buffer, datastart+10, 1)
+		    byte14 = midb(buffer, datastart+11, 1)
+		    byte15 = midb(buffer, datastart+12, 1)
+		    byte16 = midb(buffer, datastart+13, 1)
+		    byte17 = midb(buffer, datastart+14, 1)
+		    
+		    valuesChanged()
 		    
 		  else
-		    //default thing to do
-		    MsgBox "Error invalid car type"
-		    return
+		    
+		    //We do not care about the data, discard it
+		    buffer = ""
+		    
 		  end select
-		  
-		  //trigger the event definition so main program knows the values changed
-		  valuesChanged()
-		End Sub
-	#tag EndMethod
-
-	#tag Method, Flags = &h0
-		Sub setCarType(value as string)
-		  //When setting car type we must reconfigure the serial port
-		  //Some car types have a different baud rate
-		  
-		  select case value
-		    
-		  case "MR-03"
-		    carType = value
-		    byte15 = chrb(&h05)
-		    byte16 = chrb(&h5A)
-		    byte17 = chrb(&h3C)
-		  case "dNaNo"
-		    carType = value
-		    byte15 = chrb(&hFF)
-		    byte16 = chrb(&h80)
-		    byte17 = chrb(&h80)
-		  case "ASF"
-		    carType = value
-		    byte15 = chrb(&hFF)
-		    byte16 = chrb(&hFF)
-		    byte17 = chrb(&hFF)
-		    
-		  else
-		    MsgBox "Error setting Car Type"
-		  end select
-		  
-		  valuesChanged()
-		End Sub
-	#tag EndMethod
-
-	#tag Method, Flags = &h0
-		Sub writeCar()
-		  //Send set bytes to the car
-		  mode = "write"
-		  
-		  dim sendstring as string
-		  
-		  calculateChecksum()
-		  
-		  sendstring = byte01 + byte02 + byte03 + byte04 + byte05 + byte06 + byte07 + byte08 + byte09 + byte10 + byte11 + byte12 + byte13 + byte14 + byte15 + byte16 + byte17 + byte18
-		  
-		  me.Write(sendstring)
-		End Sub
-	#tag EndMethod
+		End Sub
+	#tag EndEvent
+
 
 	#tag Method, Flags = &h0
@@ -160,17 +86,4 @@
 		  
 		  byte18 = chrb(i)
-		End Sub
-	#tag EndMethod
-
-	#tag Method, Flags = &h0
-		Sub readCar()
-		  //Read values from the currently attached car
-		  dim sendstring as string
-		  
-		  mode = "read"
-		  
-		  sendstring = chrb(&hC5)
-		  
-		  me.Write(sendstring)
 		End Sub
 	#tag EndMethod
@@ -214,15 +127,4 @@
 		  carType = "MR-03"
 		End Sub
-	#tag EndMethod
-
-	#tag Method, Flags = &h21
-		Private Function prepareDB() As Boolean
-		  //Open the database file
-		  fsicsdb = new REALSQLDatabase
-		  dim f as FolderItem = GetFolderItem("fsicsdb")
-		  fsicsdb.DatabaseFile = f
-		  
-		  return f.Exists
-		End Function
 	#tag EndMethod
 
@@ -327,128 +229,4 @@
 		    MsgBox "Please select a profile to delete"
 		    
-		  end if
-		End Sub
-	#tag EndMethod
-
-	#tag Method, Flags = &h0
-		Sub saveProfile(theName as String)
-		  if theName <> "" then
-		    
-		    dim rs as RecordSet
-		    dim status as Boolean
-		    
-		    //Find a record
-		    rs = fsicsdb.SQLSelect("SELECT * FROM carprofiles WHERE name= '"+theName+"'")
-		    
-		    //Make sure we got a record
-		    if rs <> nil then
-		      //delete the record before saving
-		      deleteProfile(theName)
-		    end if
-		    
-		    rs.Close
-		    
-		    status = createProfile(theName)
-		    
-		  else
-		    
-		    MsgBox "Please select a profile to modify"
-		    
-		  end if
-		End Sub
-	#tag EndMethod
-
-	#tag Method, Flags = &h0
-		Function listProfiles() As String()
-		  dim rs as RecordSet
-		  dim s() as string
-		  
-		  //Find records
-		  rs = fsicsdb.SQLSelect("SELECT name FROM carprofiles")
-		  
-		  if rs <> nil then
-		    
-		    while rs.EOF = false
-		      s.Append rs.Field("name").StringValue
-		      rs.MoveNext
-		    wend
-		    
-		  end if
-		  
-		  rs.Close
-		  Return s()
-		End Function
-	#tag EndMethod
-
-	#tag Method, Flags = &h0
-		Sub loadProfile(theName as string)
-		  //Find the profile in the database, update the bytes and fire the event
-		  dim rs as RecordSet
-		  
-		  rs = fsicsdb.SQLSelect("SELECT * FROM carprofiles WHERE name= '"+theName+"'")
-		  
-		  //Make sure we got a record to work with
-		  if rs <> Nil then
-		    
-		    if rs.Field("cartype").StringValue <> "" then
-		      carType = rs.Field("cartype").StringValue
-		    end if
-		    
-		    if rs.Field("byte01").StringValue <> "" then
-		      byte01 = chrb(rs.Field("byte01").IntegerValue)
-		    end if
-		    if rs.Field("byte02").StringValue <> "" then
-		      byte02 = chrb(rs.Field("byte02").IntegerValue)
-		    end if
-		    if rs.Field("byte03").StringValue <> "" then
-		      byte03 = chrb(rs.Field("byte03").IntegerValue)
-		    end if
-		    if rs.Field("byte04").StringValue <> "" then
-		      byte04 = chrb(rs.Field("byte04").IntegerValue)
-		    end if
-		    if rs.Field("byte05").StringValue <> "" then
-		      byte05 = chrb(rs.Field("byte05").IntegerValue)
-		    end if
-		    if rs.Field("byte06").StringValue <> "" then
-		      byte06 = chrb(rs.Field("byte06").IntegerValue)
-		    end if
-		    if rs.Field("byte07").StringValue <> "" then
-		      byte07 = chrb(rs.Field("byte07").IntegerValue)
-		    end if
-		    if rs.Field("byte08").StringValue <> "" then
-		      byte08 = chrb(rs.Field("byte08").IntegerValue)
-		    end if
-		    if rs.Field("byte09").StringValue <> "" then
-		      byte09 = chrb(rs.Field("byte09").IntegerValue)
-		    end if
-		    if rs.Field("byte10").StringValue <> "" then
-		      byte10 = chrb(rs.Field("byte10").IntegerValue)
-		    end if
-		    if rs.Field("byte11").StringValue <> "" then
-		      byte11 = chrb(rs.Field("byte11").IntegerValue)
-		    end if
-		    if rs.Field("byte12").StringValue <> "" then
-		      byte12 = chrb(rs.Field("byte12").IntegerValue)
-		    end if
-		    if rs.Field("byte13").StringValue <> "" then
-		      byte13 = chrb(rs.Field("byte13").IntegerValue)
-		    end if
-		    if rs.Field("byte14").StringValue <> "" then
-		      byte14 = chrb(rs.Field("byte14").IntegerValue)
-		    end if
-		    if rs.Field("byte15").StringValue <> "" then
-		      byte15 = chrb(rs.Field("byte15").IntegerValue)
-		    end if
-		    if rs.Field("byte16").StringValue <> "" then
-		      byte16 = chrb(rs.Field("byte16").IntegerValue)
-		    end if
-		    if rs.Field("byte17").StringValue <> "" then
-		      byte17 = chrb(rs.Field("byte17").IntegerValue)
-		    end if
-		    if rs.Field("byte18").StringValue <> "" then
-		      byte18 = chrb(rs.Field("byte18").IntegerValue)
-		    end if
-		    
-		    valuesChanged()
 		  end if
 		End Sub
@@ -678,11 +456,293 @@
 	#tag EndMethod
 
+	#tag Method, Flags = &h0
+		Function listProfiles() As String()
+		  dim rs as RecordSet
+		  dim s() as string
+		  
+		  //Find records
+		  rs = fsicsdb.SQLSelect("SELECT name FROM carprofiles")
+		  
+		  if rs <> nil then
+		    
+		    while rs.EOF = false
+		      s.Append rs.Field("name").StringValue
+		      rs.MoveNext
+		    wend
+		    
+		  end if
+		  
+		  rs.Close
+		  Return s()
+		End Function
+	#tag EndMethod
+
+	#tag Method, Flags = &h0
+		Sub loadProfile(theName as string)
+		  //Find the profile in the database, update the bytes and fire the event
+		  dim rs as RecordSet
+		  
+		  rs = fsicsdb.SQLSelect("SELECT * FROM carprofiles WHERE name= '"+theName+"'")
+		  
+		  //Make sure we got a record to work with
+		  if rs <> Nil then
+		    
+		    if rs.Field("cartype").StringValue <> "" then
+		      carType = rs.Field("cartype").StringValue
+		    end if
+		    
+		    if rs.Field("byte01").StringValue <> "" then
+		      byte01 = chrb(rs.Field("byte01").IntegerValue)
+		    end if
+		    if rs.Field("byte02").StringValue <> "" then
+		      byte02 = chrb(rs.Field("byte02").IntegerValue)
+		    end if
+		    if rs.Field("byte03").StringValue <> "" then
+		      byte03 = chrb(rs.Field("byte03").IntegerValue)
+		    end if
+		    if rs.Field("byte04").StringValue <> "" then
+		      byte04 = chrb(rs.Field("byte04").IntegerValue)
+		    end if
+		    if rs.Field("byte05").StringValue <> "" then
+		      byte05 = chrb(rs.Field("byte05").IntegerValue)
+		    end if
+		    if rs.Field("byte06").StringValue <> "" then
+		      byte06 = chrb(rs.Field("byte06").IntegerValue)
+		    end if
+		    if rs.Field("byte07").StringValue <> "" then
+		      byte07 = chrb(rs.Field("byte07").IntegerValue)
+		    end if
+		    if rs.Field("byte08").StringValue <> "" then
+		      byte08 = chrb(rs.Field("byte08").IntegerValue)
+		    end if
+		    if rs.Field("byte09").StringValue <> "" then
+		      byte09 = chrb(rs.Field("byte09").IntegerValue)
+		    end if
+		    if rs.Field("byte10").StringValue <> "" then
+		      byte10 = chrb(rs.Field("byte10").IntegerValue)
+		    end if
+		    if rs.Field("byte11").StringValue <> "" then
+		      byte11 = chrb(rs.Field("byte11").IntegerValue)
+		    end if
+		    if rs.Field("byte12").StringValue <> "" then
+		      byte12 = chrb(rs.Field("byte12").IntegerValue)
+		    end if
+		    if rs.Field("byte13").StringValue <> "" then
+		      byte13 = chrb(rs.Field("byte13").IntegerValue)
+		    end if
+		    if rs.Field("byte14").StringValue <> "" then
+		      byte14 = chrb(rs.Field("byte14").IntegerValue)
+		    end if
+		    if rs.Field("byte15").StringValue <> "" then
+		      byte15 = chrb(rs.Field("byte15").IntegerValue)
+		    end if
+		    if rs.Field("byte16").StringValue <> "" then
+		      byte16 = chrb(rs.Field("byte16").IntegerValue)
+		    end if
+		    if rs.Field("byte17").StringValue <> "" then
+		      byte17 = chrb(rs.Field("byte17").IntegerValue)
+		    end if
+		    if rs.Field("byte18").StringValue <> "" then
+		      byte18 = chrb(rs.Field("byte18").IntegerValue)
+		    end if
+		    
+		    valuesChanged()
+		  end if
+		End Sub
+	#tag EndMethod
+
+	#tag Method, Flags = &h21
+		Private Function prepareDB() As Boolean
+		  //Open the database file
+		  fsicsdb = new REALSQLDatabase
+		  dim f as FolderItem = GetFolderItem("fsicsdb")
+		  fsicsdb.DatabaseFile = f
+		  
+		  return f.Exists
+		End Function
+	#tag EndMethod
+
+	#tag Method, Flags = &h0
+		Sub readCar()
+		  //Read values from the currently attached car
+		  dim sendstring as string
+		  
+		  mode = "read"
+		  
+		  sendstring = chrb(&hC5)
+		  
+		  me.Write(sendstring)
+		End Sub
+	#tag EndMethod
+
+	#tag Method, Flags = &h0
+		Sub resetCar()
+		  //This sends the command to reset the car back to a default configuration
+		  //Defaults are different for each car type
+		  setDefaultValues
+		  
+		  //Send the default values to the car
+		  writeCar
+		End Sub
+	#tag EndMethod
+
+	#tag Method, Flags = &h0
+		Sub saveProfile(theName as String)
+		  if theName <> "" then
+		    
+		    dim rs as RecordSet
+		    dim status as Boolean
+		    
+		    //Find a record
+		    rs = fsicsdb.SQLSelect("SELECT * FROM carprofiles WHERE name= '"+theName+"'")
+		    
+		    //Make sure we got a record
+		    if rs <> nil then
+		      //delete the record before saving
+		      deleteProfile(theName)
+		    end if
+		    
+		    rs.Close
+		    
+		    status = createProfile(theName)
+		    
+		  else
+		    
+		    MsgBox "Please select a profile to modify"
+		    
+		  end if
+		End Sub
+	#tag EndMethod
+
+	#tag Method, Flags = &h0
+		Sub setCarType(value as string)
+		  //When setting car type we must reconfigure the serial port
+		  //Some car types have a different baud rate
+		  
+		  select case value
+		    
+		  case "MR-03"
+		    carType = value
+		    byte15 = chrb(&h05)
+		    byte16 = chrb(&h5A)
+		    byte17 = chrb(&h3C)
+		  case "dNaNo"
+		    carType = value
+		    byte15 = chrb(&hFF)
+		    byte16 = chrb(&h80)
+		    byte17 = chrb(&h80)
+		  case "ASF"
+		    carType = value
+		    byte15 = chrb(&hFF)
+		    byte16 = chrb(&hFF)
+		    byte17 = chrb(&hFF)
+		    
+		  else
+		    MsgBox "Error setting Car Type"
+		  end select
+		  
+		  valuesChanged()
+		End Sub
+	#tag EndMethod
+
+	#tag Method, Flags = &h0
+		Sub setDefaultValues()
+		  //Set the defaults for the bytes sent to a car
+		  
+		  select case carType
+		    
+		  case "MR-03"
+		    byte01 = chrb(&hD5)
+		    byte02 = chrb(&h5A)
+		    byte03 = chrb(&h64)
+		    byte04 = chrb(&hFF)
+		    byte05 = chrb(&h02)
+		    byte06 = chrb(&h02)
+		    byte07 = chrb(&h01)
+		    byte08 = chrb(&hFF)
+		    byte09 = chrb(&hBC)
+		    byte10 = chrb(&h44)
+		    byte11 = chrb(&h88)
+		    byte12 = chrb(&h78)
+		    byte13 = chrb(&hFF)
+		    byte14 = chrb(&h2C)
+		    byte15 = chrb(&h05)
+		    byte16 = chrb(&h5A)
+		    byte17 = chrb(&h3C)
+		    byte18 = chrb(&h87)
+		    
+		  case "dNaNo"
+		    byte01 = chrb(&hD5)
+		    byte02 = chrb(&h5A)
+		    byte03 = chrb(&hFF)
+		    byte04 = chrb(&hFF)
+		    byte05 = chrb(&h0A)
+		    byte06 = chrb(&h03)
+		    byte07 = chrb(&h01)
+		    byte08 = chrb(&h40)
+		    byte09 = chrb(&hBC)
+		    byte10 = chrb(&h44)
+		    byte11 = chrb(&h88)
+		    byte12 = chrb(&h78)
+		    byte13 = chrb(&h03)
+		    byte14 = chrb(&hFF)
+		    byte15 = chrb(&hFF)
+		    byte16 = chrb(&h80)
+		    byte17 = chrb(&h80)
+		    byte18 = chrb(&hA7)
+		    
+		  case "ASF"
+		    byte01 = chrb(&hD5)
+		    byte02 = chrb(&h5A)
+		    byte03 = chrb(&hFF)
+		    byte04 = chrb(&hFF)
+		    byte05 = chrb(&h0A)
+		    byte06 = chrb(&h03)
+		    byte07 = chrb(&h01)
+		    byte08 = chrb(&h78)
+		    byte09 = chrb(&hBC)
+		    byte10 = chrb(&h44)
+		    byte11 = chrb(&h88)
+		    byte12 = chrb(&h78)
+		    byte13 = chrb(&h03)
+		    byte14 = chrb(&hFF)
+		    byte15 = chrb(&hFF)
+		    byte16 = chrb(&hFF)
+		    byte17 = chrb(&hFF)
+		    byte18 = chrb(&hDD)
+		    
+		  else
+		    //default thing to do
+		    MsgBox "Error invalid car type"
+		    return
+		  end select
+		  
+		  //trigger the event definition so main program knows the values changed
+		  valuesChanged()
+		End Sub
+	#tag EndMethod
+
+	#tag Method, Flags = &h0
+		Sub writeCar()
+		  //Send set bytes to the car
+		  mode = "write"
+		  
+		  dim sendstring as string
+		  
+		  calculateChecksum()
+		  
+		  sendstring = byte01 + byte02 + byte03 + byte04 + byte05 + byte06 + byte07 + byte08 + byte09 + byte10 + byte11 + byte12 + byte13 + byte14 + byte15 + byte16 + byte17 + byte18
+		  
+		  me.Write(sendstring)
+		End Sub
+	#tag EndMethod
+
+
+	#tag Hook, Flags = &h0
+		Event profileImported(profileName as string)
+	#tag EndHook
 
 	#tag Hook, Flags = &h0
 		Event valuesChanged()
-	#tag EndHook
-
-	#tag Hook, Flags = &h0
-		Event profileImported(profileName as string)
 	#tag EndHook
 
@@ -713,8 +773,11 @@
 		You should have received a copy of the GNU General Public License
 		along with Flip Side ICS Software.  If not, see <http://www.gnu.org/licenses/>.
-		
 	#tag EndNote
 
 
+	#tag Property, Flags = &h21
+		Private buffer As String
+	#tag EndProperty
+
 	#tag Property, Flags = &h0
 		byte01 As String
@@ -722,4 +785,40 @@
 
 	#tag Property, Flags = &h0
+		byte02 As String
+	#tag EndProperty
+
+	#tag Property, Flags = &h0
+		byte03 As String
+	#tag EndProperty
+
+	#tag Property, Flags = &h0
+		byte04 As String
+	#tag EndProperty
+
+	#tag Property, Flags = &h0
+		byte05 As String
+	#tag EndProperty
+
+	#tag Property, Flags = &h0
+		byte06 As String
+	#tag EndProperty
+
+	#tag Property, Flags = &h0
+		byte07 As String
+	#tag EndProperty
+
+	#tag Property, Flags = &h0
+		byte08 As String
+	#tag EndProperty
+
+	#tag Property, Flags = &h0
+		byte09 As String
+	#tag EndProperty
+
+	#tag Property, Flags = &h0
+		byte10 As String
+	#tag EndProperty
+
+	#tag Property, Flags = &h0
 		byte11 As String
 	#tag EndProperty
@@ -753,42 +852,6 @@
 	#tag EndProperty
 
-	#tag Property, Flags = &h0
-		byte02 As String
-	#tag EndProperty
-
-	#tag Property, Flags = &h0
-		byte03 As String
-	#tag EndProperty
-
-	#tag Property, Flags = &h0
-		byte04 As String
-	#tag EndProperty
-
-	#tag Property, Flags = &h0
-		byte05 As String
-	#tag EndProperty
-
-	#tag Property, Flags = &h0
-		byte06 As String
-	#tag EndProperty
-
-	#tag Property, Flags = &h0
-		byte07 As String
-	#tag EndProperty
-
-	#tag Property, Flags = &h0
-		byte08 As String
-	#tag EndProperty
-
-	#tag Property, Flags = &h0
-		byte09 As String
-	#tag EndProperty
-
-	#tag Property, Flags = &h0
-		byte10 As String
-	#tag EndProperty
-
-	#tag Property, Flags = &h0
-		carType As String = "MR-03"
+	#tag Property, Flags = &h21
+		Private carType As String = "MR-03"
 	#tag EndProperty
 
@@ -797,41 +860,10 @@
 	#tag EndProperty
 
-	#tag Property, Flags = &h0
-		mode As String = "none"
+	#tag Property, Flags = &h21
+		Private mode As String = "none"
 	#tag EndProperty
 
 
 	#tag ViewBehavior
-		#tag ViewProperty
-			Name="Name"
-			Visible=true
-			Group="ID"
-			InheritedFrom="serial"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="Index"
-			Visible=true
-			Group="ID"
-			Type="Integer"
-			InheritedFrom="serial"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="Super"
-			Visible=true
-			Group="ID"
-			InheritedFrom="serial"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="Left"
-			Visible=true
-			Group="Position"
-			InheritedFrom="serial"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="Top"
-			Visible=true
-			Group="Position"
-			InheritedFrom="serial"
-		#tag EndViewProperty
 		#tag ViewProperty
 			Name="Baud"
@@ -877,4 +909,160 @@
 		#tag EndViewProperty
 		#tag ViewProperty
+			Name="byte01"
+			Group="Behavior"
+			InitialValue="&hFF"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte02"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte03"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte04"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte05"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte06"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte07"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte08"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte09"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte10"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte11"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte12"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte13"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte14"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte15"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte16"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte17"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="byte18"
+			Group="Behavior"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="carType"
+			Group="Behavior"
+			InitialValue="MR-03"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="CTS"
+			Visible=true
+			Group="Behavior"
+			Type="Boolean"
+			InheritedFrom="serial"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="DTR"
+			Visible=true
+			Group="Behavior"
+			Type="Boolean"
+			InheritedFrom="serial"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="Index"
+			Visible=true
+			Group="ID"
+			Type="Integer"
+			InheritedFrom="serial"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="Left"
+			Visible=true
+			Group="Position"
+			InheritedFrom="serial"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="mode"
+			Group="Behavior"
+			InitialValue="read"
+			Type="String"
+			EditorType="MultiLineEditor"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="Name"
+			Visible=true
+			Group="ID"
+			InheritedFrom="serial"
+		#tag EndViewProperty
+		#tag ViewProperty
 			Name="Parity"
 			Visible=true
@@ -905,4 +1093,16 @@
 		#tag EndViewProperty
 		#tag ViewProperty
+			Name="Super"
+			Visible=true
+			Group="ID"
+			InheritedFrom="serial"
+		#tag EndViewProperty
+		#tag ViewProperty
+			Name="Top"
+			Visible=true
+			Group="Position"
+			InheritedFrom="serial"
+		#tag EndViewProperty
+		#tag ViewProperty
 			Name="XON"
 			Visible=true
@@ -910,139 +1110,4 @@
 			Type="Boolean"
 			InheritedFrom="serial"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="CTS"
-			Visible=true
-			Group="Behavior"
-			Type="Boolean"
-			InheritedFrom="serial"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="DTR"
-			Visible=true
-			Group="Behavior"
-			Type="Boolean"
-			InheritedFrom="serial"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte01"
-			Group="Behavior"
-			InitialValue="&hFF"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte11"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte12"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte13"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte14"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte15"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte16"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte17"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte18"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte02"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte03"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte04"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte05"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte06"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte07"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte08"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte09"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="byte10"
-			Group="Behavior"
-			Type="String"
-			EditorType="MultiLineEditor"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="carType"
-			Group="Behavior"
-			InitialValue="MR-03"
-			Type="String"
-		#tag EndViewProperty
-		#tag ViewProperty
-			Name="mode"
-			Group="Behavior"
-			InitialValue="read"
-			Type="String"
 		#tag EndViewProperty
 	#tag EndViewBehavior
