func main() gconst Throw 0 gconst Close 1 global IP as string global Port as integer global Address as integer global DisplayLoconet as integer dim Switch, Connected, i, j, k, x, y as integer dim Status, Sensor as integer dim Byte(20) as integer dim Line as string dim Buffer as string dim Token as string dim ByteString as string Address = 1 Connected = 0 Token = chr(13)+chr(10) print "Loconet SE8c Tester V0.1" print "(c) Michael Mosher 2007" print " " print "Requires Loconet over TCP server" print " " if FileInfo(".\IP.dat",2) = "True" then IP = FileQuickLoad(".\IP.dat") print "load IP " + IP else IP = "127.0.0.1" print "defualt IP " + IP endif if FileInfo(".\Port.dat",2) = "True" then Port = FileQuickLoad(".\Port.dat") print "load Port " + Port else Port = 1234 print "defualt Port " + Port endif Connect_DisplayForm() Console(5) LoopMain: if FormAllButtons() = 1 then if FormButton(Button_Quit,0) > 0 then '------ Quit Handler ----- End endif if Connected = 0 then if FormButton(Button_Save,0) > 0 then '------ Save Handler ----- IP = FormTextBox(Text_IP) Port = FormTextBox(Text_Port) FileQuickSave(".\IP.dat", IP) FileQuickSave(".\Port.dat", Port) endif if FormButton(Button_Connect,0) > 0 then '------ Connect Handler ----- IP = FormTextBox(Text_IP) Port = FormTextBox(Text_Port) if ConnectTCP() = 0 then Main_DisplayForm() Connected = 1 Console(4) endif endif else if FormButton(Button_Address,0) > 0 then '------ Address Handler ----- Address = FormTextBox(Text_Address) endif for i = 0 to 31 if i\4 = 0 then y = i * 10 + 21 if i\4 = 1 then y = i * 10 + 26 if i\4 = 2 then y = i * 10 + 31 if i\4 = 3 then y = i * 10 + 36 if i\4 = 4 then y = (i-16) * 10 + 21 if i\4 = 5 then y = (i-16) * 10 + 26 if i\4 = 6 then y = (i-16) * 10 + 31 if i\4 = 7 then y = (i-16) * 10 + 36 if i < 16 then x = 1 else x =121 endif Switch = (Address + 3) * 64 + (i * 2) if FormButton(Button_Red1+i,0) > 0 then '------ Red Handler ----- FormBrush(255,0,0) FormFillRectangle(x, y,8,8) SendSw(Switch, Throw) endif if FormButton(Button_Grn1+i,0) > 0 then '------ Grn Handler ----- FormBrush(0,255,0) FormFillRectangle(x, y,8,8) SendSw(Switch, Close) endif if FormButton(Button_Yel1+i,0) > 0 then '------ Yel Handler ----- FormBrush(255,255,0) FormFillRectangle(x, y,8,8) SendSw(Switch+1, Throw) endif if FormButton(Button_Drk1+i,0) > 0 then '------ Dark Handler ----- FormBrush(90,90,90) FormFillRectangle(x, y,8,8) SendSw(Switch+1, Close) endif next for i = 0 to 7 if i > 3 then x = 180 else x = 60 endif y = i//4 * 45 + 20 Switch = Address * 8 - 8 + i if FormButton(Button_Close1+i,0) > 0 then '------ Close Handler ----- FormBrush(0,128,0) FormFillRectangle(x, y, 8, 38) SendSw(Switch, Close) endif if FormButton(Button_Throw1+i,0) > 0 then '------ Throw Handler ----- FormBrush(128,0,0) FormFillRectangle(x, y, 8, 38) SendSw(Switch, Throw) endif next if FormButton(Button_DisplayLoconet,0) > 0 then '------ Display Loconet Handler ----- if DisplayLoconet = 1 then DisplayLoconet = 0 FormBrush(128,128,0) FormFillRectangle(111,246,5,18) Console(4) else DisplayLoconet = 1 FormBrush(255,255,0) FormFillRectangle(111,246,5,18) Console(5) endif endif endif endif if SocketBuff(1) > 0 then Buffer = SocketInput(1) k = 0 CheckLoop2: Line = GetWord(Buffer, 1, k+1, Token, Status) if Status <> -1 then if BeginsWith(Line, "RECEIVE") = 1 then i = 0 CheckLoop3: ByteString = GetWord(Line, 8, i+1, " ", Status) if Status <> -1 then Byte(i) = HexToDec(ByteString) i = i + 1 goto CheckLoop3 endif if Byte(0) = $B2 then Sensor = ((Byte(2) & $0f) * 256) + (Byte(1) * 2) + 1 if BitGet (Byte(2), 5) > 0 then Sensor = Sensor + 1 endif for j = 0 to 7 if j > 3 then x = 221 else x = 101 endif y = j//4 * 45 + 21 Switch = Address * 8 - 7 + j if Sensor = Switch then if BitGet(Byte(2),4) = 1 then FormBrush(255,255,0) else FormBrush(128,128,0) endif FormFillRectangle(x,y,8,38) endif next endif '$B2 endif 'RECEIVE k = k + 1 goto CheckLoop2 endif 'Get word endif 'socket data Goto LoopMain endfunc '------------------------------------------------------------------------------- func ConnectTCP() as integer TimerClear(1) SocketConnect(1,IP,Port) WaitLoop: if SocketState(1) = 4 then print "Connected" exit(0) else print "Waiting.... "+SocketData(1,6)+" / "+SocketData(1,5) endif pause(100) if Timer(1) > 30000 then MsgBox("Can't Connect", 0) exit(1) endif Goto WaitLoop endfunc '------------------------------------------------------------------------------- func SendSw(Add as integer, Dir as integer) dim B(4) as integer dim i, UserAdd integer dim Output as string B(0) = $B0 B(1) = Add & $7f B(2) = Add \ $80 B(2) = BitSet(B(2),4, 1) if Dir = Close then B(2) = BitSet(B(2),5,1) B(3) = 0 for i = 0 TO 2 B(3) = B(3) ^ B(i) next B(3) = B(3) ^ 255 UserAdd = Add + 1 Output = "SEND " + Convert(B(0),"X")+" "+Convert(B(1),"X")+" "+Convert(B(2),"X")+" "+Convert(B(3),"X")+chr(13)+chr(10) SocketOutput(1,Output) if DisplayLoconet = 1 then print "Sw " + UserAdd; if Dir = Close then print " C : "; else print " T : "; endif print Mid(Output,6,Len(Output)-7) endif endfunc '------------------------------------------------------------------------------- func HexToDec(Hex as string) as integer dim LeftChar as string dim RightChar as string LeftChar = Left(Hex, 1) RightChar = Right(Hex, 1) exit(DecDigit(LeftChar) * 16 + DecDigit(RightChar)) endfunc '------------------------------------------------------------------------------- func DecDigit(Digit as string) as integer StrIf Digit = "0" then exit (0) StrIf Digit = "1" then exit (1) StrIf Digit = "2" then exit (2) StrIf Digit = "3" then exit (3) StrIf Digit = "4" then exit (4) StrIf Digit = "5" then exit (5) StrIf Digit = "6" then exit (6) StrIf Digit = "7" then exit (7) StrIf Digit = "8" then exit (8) StrIf Digit = "9" then exit (9) StrIf Digit = "A" then exit (10) StrIf Digit = "B" then exit (11) StrIf Digit = "C" then exit (12) StrIf Digit = "D" then exit (13) StrIf Digit = "E" then exit (14) StrIf Digit = "F" then exit (15) endfunc '------------------------------------------------------------------------------- func Main_DisplayForm() dim i, n as integer FormRes(240,268) FormNew() FormBGColor(228,228,228) FormCLS() FormTextColor(0,0,0) FormFont("-",10,1) FormSettings(AlignCenter) FormLabel(Label_Heading,0,0,240,20,"Loconet SE8c Tester") FormFont("-",9,0) FormSettings(AlignRight) FormSettings(AlignLeft) ' FormLabel(Label_SE1, 0, 25,10,20,"1") ' FormLabel(Label_SE2, 0, 45,10,20,"2") ' FormLabel(Label_SE3, 0, 65,10,20,"3") ' FormLabel(Label_SE4, 0, 85,10,20,"4") ' FormLabel(Label_SE5, 0,105,10,20,"5") ' FormLabel(Label_SE6, 0,125,10,20,"6") ' FormLabel(Label_SE7, 0,145,10,20,"7") ' FormLabel(Label_SE8, 0,165,10,20,"8") FormBGColor(255,255,255) FormTextBox(Text_Address, 85, 220,75,20,Address) FormBGColor(211,211,211) FormFont("-",9,1) FormButton(Button_Quit, 10,245,60,20,"Quit") FormButton(Button_DisplayLoconet,70,245,40,20,"Ln") FormButton(Button_Address, 0,220,75,20,"Address:") FormBGColor(255,0,0) FormButton(Button_Red1 , 10, 20,10,10,"") FormButton(Button_Red2 , 10, 30,10,10,"") FormButton(Button_Red3 , 10, 40,10,10,"") FormButton(Button_Red4 , 10, 50,10,10,"") FormButton(Button_Red5 , 10, 65,10,10,"") FormButton(Button_Red6 , 10, 75,10,10,"") FormButton(Button_Red7 , 10, 85,10,10,"") FormButton(Button_Red8 , 10, 95,10,10,"") FormButton(Button_Red9 , 10,110,10,10,"") FormButton(Button_Red10, 10,120,10,10,"") FormButton(Button_Red11, 10,130,10,10,"") FormButton(Button_Red12, 10,140,10,10,"") FormButton(Button_Red13, 10,155,10,10,"") FormButton(Button_Red14, 10,165,10,10,"") FormButton(Button_Red15, 10,175,10,10,"") FormButton(Button_Red16, 10,185,10,10,"") FormButton(Button_Red17, 130, 20,10,10,"") FormButton(Button_Red18, 130, 30,10,10,"") FormButton(Button_Red19, 130, 40,10,10,"") FormButton(Button_Red20, 130, 50,10,10,"") FormButton(Button_Red21, 130, 65,10,10,"") FormButton(Button_Red22, 130, 75,10,10,"") FormButton(Button_Red23, 130, 85,10,10,"") FormButton(Button_Red24, 130, 95,10,10,"") FormButton(Button_Red25, 130,110,10,10,"") FormButton(Button_Red26, 130,120,10,10,"") FormButton(Button_Red27, 130,130,10,10,"") FormButton(Button_Red28, 130,140,10,10,"") FormButton(Button_Red29, 130,155,10,10,"") FormButton(Button_Red30, 130,165,10,10,"") FormButton(Button_Red31, 130,175,10,10,"") FormButton(Button_Red32, 130,185,10,10,"") FormBGColor(255,255,0) FormButton(Button_Yel1 , 20, 20,10,10,"") FormButton(Button_Yel2 , 20, 30,10,10,"") FormButton(Button_Yel3 , 20, 40,10,10,"") FormButton(Button_Yel4 , 20, 50,10,10,"") FormButton(Button_Yel5 , 20, 65,10,10,"") FormButton(Button_Yel6 , 20, 75,10,10,"") FormButton(Button_Yel7 , 20, 85,10,10,"") FormButton(Button_Yel8 , 20, 95,10,10,"") FormButton(Button_Yel9 , 20,110,10,10,"") FormButton(Button_Yel10, 20,120,10,10,"") FormButton(Button_Yel11, 20,130,10,10,"") FormButton(Button_Yel12, 20,140,10,10,"") FormButton(Button_Yel13, 20,155,10,10,"") FormButton(Button_Yel14, 20,165,10,10,"") FormButton(Button_Yel15, 20,175,10,10,"") FormButton(Button_Yel16, 20,185,10,10,"") FormButton(Button_Yel17, 140, 20,10,10,"") FormButton(Button_Yel18, 140, 30,10,10,"") FormButton(Button_Yel19, 140, 40,10,10,"") FormButton(Button_Yel20, 140, 50,10,10,"") FormButton(Button_Yel21, 140, 65,10,10,"") FormButton(Button_Yel22, 140, 75,10,10,"") FormButton(Button_Yel23, 140, 85,10,10,"") FormButton(Button_Yel24, 140, 95,10,10,"") FormButton(Button_Yel25, 140,110,10,10,"") FormButton(Button_Yel26, 140,120,10,10,"") FormButton(Button_Yel27, 140,130,10,10,"") FormButton(Button_Yel28, 140,140,10,10,"") FormButton(Button_Yel29, 140,155,10,10,"") FormButton(Button_Yel30, 140,165,10,10,"") FormButton(Button_Yel31, 140,175,10,10,"") FormButton(Button_Yel32, 140,185,10,10,"") FormBGColor(0,255,0) FormButton(Button_Grn1 , 30, 20,10,10,"") FormButton(Button_Grn2 , 30, 30,10,10,"") FormButton(Button_Grn3 , 30, 40,10,10,"") FormButton(Button_Grn4 , 30, 50,10,10,"") FormButton(Button_Grn5 , 30, 65,10,10,"") FormButton(Button_Grn6 , 30, 75,10,10,"") FormButton(Button_Grn7 , 30, 85,10,10,"") FormButton(Button_Grn8 , 30, 95,10,10,"") FormButton(Button_Grn9 , 30,110,10,10,"") FormButton(Button_Grn10, 30,120,10,10,"") FormButton(Button_Grn11, 30,130,10,10,"") FormButton(Button_Grn12, 30,140,10,10,"") FormButton(Button_Grn13, 30,155,10,10,"") FormButton(Button_Grn14, 30,165,10,10,"") FormButton(Button_Grn15, 30,175,10,10,"") FormButton(Button_Grn16, 30,185,10,10,"") FormButton(Button_Grn17, 150, 20,10,10,"") FormButton(Button_Grn18, 150, 30,10,10,"") FormButton(Button_Grn19, 150, 40,10,10,"") FormButton(Button_Grn20, 150, 50,10,10,"") FormButton(Button_Grn21, 150, 65,10,10,"") FormButton(Button_Grn22, 150, 75,10,10,"") FormButton(Button_Grn23, 150, 85,10,10,"") FormButton(Button_Grn24, 150, 95,10,10,"") FormButton(Button_Grn25, 150,110,10,10,"") FormButton(Button_Grn26, 150,120,10,10,"") FormButton(Button_Grn27, 150,130,10,10,"") FormButton(Button_Grn28, 150,140,10,10,"") FormButton(Button_Grn29, 150,155,10,10,"") FormButton(Button_Grn30, 150,165,10,10,"") FormButton(Button_Grn31, 150,175,10,10,"") FormButton(Button_Grn32, 150,185,10,10,"") FormBGColor(90,90,90) FormButton(Button_Drk1 , 40, 20,10,10,"") FormButton(Button_Drk2 , 40, 30,10,10,"") FormButton(Button_Drk3 , 40, 40,10,10,"") FormButton(Button_Drk4 , 40, 50,10,10,"") FormButton(Button_Drk5 , 40, 65,10,10,"") FormButton(Button_Drk6 , 40, 75,10,10,"") FormButton(Button_Drk7 , 40, 85,10,10,"") FormButton(Button_Drk8 , 40, 95,10,10,"") FormButton(Button_Drk9 , 40,110,10,10,"") FormButton(Button_Drk10, 40,120,10,10,"") FormButton(Button_Drk11, 40,130,10,10,"") FormButton(Button_Drk12, 40,140,10,10,"") FormButton(Button_Drk13, 40,155,10,10,"") FormButton(Button_Drk14, 40,165,10,10,"") FormButton(Button_Drk15, 40,175,10,10,"") FormButton(Button_Drk16, 40,185,10,10,"") FormButton(Button_Drk17, 160, 20,10,10,"") FormButton(Button_Drk18, 160, 30,10,10,"") FormButton(Button_Drk19, 160, 40,10,10,"") FormButton(Button_Drk20, 160, 50,10,10,"") FormButton(Button_Drk21, 160, 65,10,10,"") FormButton(Button_Drk22, 160, 75,10,10,"") FormButton(Button_Drk23, 160, 85,10,10,"") FormButton(Button_Drk24, 160, 95,10,10,"") FormButton(Button_Drk25, 160,110,10,10,"") FormButton(Button_Drk26, 160,120,10,10,"") FormButton(Button_Drk27, 160,130,10,10,"") FormButton(Button_Drk28, 160,140,10,10,"") FormButton(Button_Drk29, 160,155,10,10,"") FormButton(Button_Drk30, 160,165,10,10,"") FormButton(Button_Drk31, 160,175,10,10,"") FormButton(Button_Drk32, 160,185,10,10,"") FormBGColor(0,128,0) FormButton(Button_Close1 , 70, 20,20,20,"C") FormButton(Button_Close2 , 70, 65,20,20,"C") FormButton(Button_Close3 , 70,110,20,20,"C") FormButton(Button_Close4 , 70,155,20,20,"C") FormButton(Button_Close5 ,190, 20,20,20,"C") FormButton(Button_Close6 ,190, 65,20,20,"C") FormButton(Button_Close7 ,190,110,20,20,"C") FormButton(Button_Close8 ,190,155,20,20,"C") FormBGColor(128,0,0) FormButton(Button_Throw1 , 70, 40,20,20,"T") FormButton(Button_Throw2 , 70, 85,20,20,"T") FormButton(Button_Throw3 , 70,130,20,20,"T") FormButton(Button_Throw4 , 70,175,20,20,"T") FormButton(Button_Throw5 ,190, 40,20,20,"T") FormButton(Button_Throw6 ,190, 85,20,20,"T") FormButton(Button_Throw7 ,190,130,20,20,"T") FormButton(Button_Throw8 ,190,175,20,20,"T") FormBGColor(228,228,228) FormPen(255,255,255) FormRectangle(0, 20,10,10) FormRectangle(0, 30,10,10) FormRectangle(0, 40,10,10) FormRectangle(0, 50,10,10) FormRectangle(0, 65,10,10) FormRectangle(0, 75,10,10) FormRectangle(0, 85,10,10) FormRectangle(0, 95,10,10) FormRectangle(0,110,10,10) FormRectangle(0,120,10,10) FormRectangle(0,130,10,10) FormRectangle(0,140,10,10) FormRectangle(0,155,10,10) FormRectangle(0,165,10,10) FormRectangle(0,175,10,10) FormRectangle(0,185,10,10) FormRectangle(120, 20,10,10) FormRectangle(120, 30,10,10) FormRectangle(120, 40,10,10) FormRectangle(120, 50,10,10) FormRectangle(120, 65,10,10) FormRectangle(120, 75,10,10) FormRectangle(120, 85,10,10) FormRectangle(120, 95,10,10) FormRectangle(120,110,10,10) FormRectangle(120,120,10,10) FormRectangle(120,130,10,10) FormRectangle(120,140,10,10) FormRectangle(120,155,10,10) FormRectangle(120,165,10,10) FormRectangle(120,175,10,10) FormRectangle(120,185,10,10) FormRectangle(60, 20,10,40) FormRectangle(60, 65,10,40) FormRectangle(60,110,10,40) FormRectangle(60,155,10,40) FormRectangle(180, 20,10,40) FormRectangle(180, 65,10,40) FormRectangle(180,110,10,40) FormRectangle(180,155,10,40) FormRectangle(100, 20,10,40) FormRectangle(100, 65,10,40) FormRectangle(100,110,10,40) FormRectangle(100,155,10,40) FormRectangle(220, 20,10,40) FormRectangle(220, 65,10,40) FormRectangle(220,110,10,40) FormRectangle(220,155,10,40) FormRectangle(110,245,7,20) FormBrush(128,128,0) FormFillRectangle(111,246,5,18) endfunc '------------------------------------------------------------------------------- func Connect_DisplayForm() '--- Buttons --- gconst Button_Quit 0 gconst Button_Connect 1 gconst Button_Save 2 gconst Button_Address 3 gconst Button_DisplayLoconet 4 gconst Button_Red1 5 gconst Button_Red2 6 gconst Button_Red3 7 gconst Button_Red4 8 gconst Button_Red5 9 gconst Button_Red6 10 gconst Button_Red7 11 gconst Button_Red8 12 gconst Button_Red9 13 gconst Button_Red10 14 gconst Button_Red11 15 gconst Button_Red12 16 gconst Button_Red13 17 gconst Button_Red14 18 gconst Button_Red15 19 gconst Button_Red16 20 gconst Button_Red17 21 gconst Button_Red18 22 gconst Button_Red19 23 gconst Button_Red20 24 gconst Button_Red21 25 gconst Button_Red22 26 gconst Button_Red23 27 gconst Button_Red24 28 gconst Button_Red25 29 gconst Button_Red26 30 gconst Button_Red27 31 gconst Button_Red28 32 gconst Button_Red29 33 gconst Button_Red30 34 gconst Button_Red31 35 gconst Button_Red32 36 gconst Button_Yel1 37 gconst Button_Yel2 38 gconst Button_Yel3 39 gconst Button_Yel4 40 gconst Button_Yel5 41 gconst Button_Yel6 42 gconst Button_Yel7 43 gconst Button_Yel8 44 gconst Button_Yel9 45 gconst Button_Yel10 46 gconst Button_Yel11 47 gconst Button_Yel12 48 gconst Button_Yel13 49 gconst Button_Yel14 50 gconst Button_Yel15 51 gconst Button_Yel16 52 gconst Button_Yel17 53 gconst Button_Yel18 54 gconst Button_Yel19 55 gconst Button_Yel20 56 gconst Button_Yel21 57 gconst Button_Yel22 58 gconst Button_Yel23 59 gconst Button_Yel24 60 gconst Button_Yel25 61 gconst Button_Yel26 62 gconst Button_Yel27 63 gconst Button_Yel28 64 gconst Button_Yel29 65 gconst Button_Yel30 66 gconst Button_Yel31 67 gconst Button_Yel32 68 gconst Button_Grn1 69 gconst Button_Grn2 70 gconst Button_Grn3 71 gconst Button_Grn4 72 gconst Button_Grn5 73 gconst Button_Grn6 74 gconst Button_Grn7 75 gconst Button_Grn8 76 gconst Button_Grn9 77 gconst Button_Grn10 78 gconst Button_Grn11 79 gconst Button_Grn12 80 gconst Button_Grn13 81 gconst Button_Grn14 82 gconst Button_Grn15 83 gconst Button_Grn16 84 gconst Button_Grn17 85 gconst Button_Grn18 86 gconst Button_Grn19 87 gconst Button_Grn20 88 gconst Button_Grn21 89 gconst Button_Grn22 90 gconst Button_Grn23 91 gconst Button_Grn24 92 gconst Button_Grn25 93 gconst Button_Grn26 94 gconst Button_Grn27 95 gconst Button_Grn28 96 gconst Button_Grn29 97 gconst Button_Grn30 98 gconst Button_Grn31 99 gconst Button_Grn32 100 gconst Button_Drk1 101 gconst Button_Drk2 102 gconst Button_Drk3 103 gconst Button_Drk4 104 gconst Button_Drk5 105 gconst Button_Drk6 106 gconst Button_Drk7 107 gconst Button_Drk8 108 gconst Button_Drk9 109 gconst Button_Drk10 110 gconst Button_Drk11 111 gconst Button_Drk12 112 gconst Button_Drk13 113 gconst Button_Drk14 114 gconst Button_Drk15 115 gconst Button_Drk16 116 gconst Button_Drk17 117 gconst Button_Drk18 118 gconst Button_Drk19 119 gconst Button_Drk20 120 gconst Button_Drk21 121 gconst Button_Drk22 122 gconst Button_Drk23 123 gconst Button_Drk24 124 gconst Button_Drk25 125 gconst Button_Drk26 126 gconst Button_Drk27 127 gconst Button_Drk28 128 gconst Button_Drk29 129 gconst Button_Drk30 130 gconst Button_Drk31 131 gconst Button_Drk32 132 gconst Button_Close1 133 gconst Button_Close2 134 gconst Button_Close3 135 gconst Button_Close4 136 gconst Button_Close5 137 gconst Button_Close6 138 gconst Button_Close7 139 gconst Button_Close8 140 gconst Button_Throw1 141 gconst Button_Throw2 142 gconst Button_Throw3 143 gconst Button_Throw4 144 gconst Button_Throw5 145 gconst Button_Throw6 146 gconst Button_Throw7 147 gconst Button_Throw8 148 '--- Labels --- gconst Label_Heading 0 gconst Label_IP 1 gconst Label_Port 2 gconst Label_Address 3 gconst Label_SE1 4 gconst Label_SE2 5 gconst Label_SE3 6 gconst Label_SE4 7 gconst Label_SE5 8 gconst Label_SE6 9 gconst Label_SE7 10 gconst Label_SE8 11 '--- TextBoxes --- gconst Text_IP 0 gconst Text_Port 1 gconst Text_Address 2 ' FormRes(240,268) FormNew() FormBGColor(228,228,228) FormCLS() FormTextColor(0,0,0) FormFont("-",10,1) FormSettings(AlignCenter) FormLabel(Label_Heading,0,0,240,20,"Loconet over TCP connection") FormFont("-",9,0) FormSettings(AlignRight) FormLabel(Label_IP, 0, 20,60,20,"IP:") FormLabel(Label_Port, 0, 40,60,20,"Port:") FormBGColor(255,255,255) FormSettings(AlignLeft) FormTextBox(Text_IP, 65, 20,100,20,IP) FormTextBox(Text_Port, 65, 40,100,20,Port) FormSettings(Alignleft) FormBGColor(211,211,211) FormFont("-",9,1) FormButton(Button_Quit, 10,245,60,20,"Quit") FormButton(Button_Connect, 80,245,70,20,"Connect") FormButton(Button_Save, 160,245,70,20,"Save") endfunc