My latest program. It controls all 256 X10 addresses. The code is 3Megs, so I can't post it easily. The Main view (1st image) is the normal state when executed.
The House codes are selected using the lower left Combo Box. There are 16 of these forms - one for each House Code.
This view shows the Activity Monitor.
Here is some of the code:
Public bszAction As Variant
Public bszParm1 As Variant
Public bszParm2 As Variant
Public bszParm3 As Variant
Public bszParm4 As Variant
Public bszParm5 As Variant
Public strLine As Variant
Public strTime As String
Private Sub ActiveHome1_RecvAction(ByVal bszAction As Variant, ByVal bszParm1 As Variant, ByVal bszParm2 As Variant, ByVal bszParm3 As Variant, ByVal bszParm4 As Variant, ByVal bszParm5 As Variant, ByVal bszReserved As Variant)
strTime = CDate(Now)
strLine = bszAction + Chr(9) + bszParm1 + Chr(9) + bszParm2 + Chr(9)
Text1000.Text = strTime + Space(7) + strLine + vbCrLf + Text1000.Text
Text1000.Text = UCase(Text1000.Text)
End Sub
Private Sub Form_Load()
Combo10000.AddItem "A"
Combo10000.AddItem "B"
Combo10000.AddItem "C"
Combo10000.AddItem "D"
Combo10000.AddItem "E"
Combo10000.AddItem "F"
Combo10000.AddItem "G"
Combo10000.AddItem "H"
Combo10000.AddItem "I"
Combo10000.AddItem "J"
Combo10000.AddItem "K"
Combo10000.AddItem "L"
Combo10000.AddItem "M"
Combo10000.AddItem "N"
Combo10000.AddItem "O"
Combo10000.AddItem "P"
Combo20000.AddItem "1"
Combo20000.AddItem "2"
Combo20000.AddItem "3"
Combo20000.AddItem "4"
Combo20000.AddItem "5"
Combo20000.AddItem "6"
Combo20000.AddItem "7"
Combo20000.AddItem "8"
Combo20000.AddItem "9"
Combo20000.AddItem "10"
Combo20000.AddItem "11"
Combo20000.AddItem "12"
Combo20000.AddItem "13"
Combo20000.AddItem "14"
Combo20000.AddItem "15"
Combo20000.AddItem "16"
Combo30000.AddItem "A"
Combo30000.AddItem "B"
Combo30000.AddItem "C"
Combo30000.AddItem "D"
Combo30000.AddItem "E"
Combo30000.AddItem "F"
Combo30000.AddItem "G"
Combo30000.AddItem "H"
Combo30000.AddItem "I"
Combo30000.AddItem "J"
Combo30000.AddItem "K"
Combo30000.AddItem "L"
Combo30000.AddItem "M"
Combo30000.AddItem "N"
Combo30000.AddItem "O"
Combo30000.AddItem "P"
Combo40000.AddItem "A ON"
Combo40000.AddItem "A OFF"
Combo40000.AddItem "A DIM"
Combo40000.AddItem "A BRIGHT"
Combo40000.AddItem "A ALLLIGHTSON"
Combo40000.AddItem "A ALLUNITSOFF"
Combo40000.AddItem "A STATUSON"
Combo40000.AddItem "A STATUSOFF"
Combo40000.AddItem "A STATUSREQUEST"
Combo40000.AddItem "A PRESETDIM1"
Combo40000.AddItem "A PRESETDIM2"
Combo40000.AddItem "A EXTCODE"
Combo40000.AddItem "A EXTENDEDDATATRANSFER"
Combo40000.AddItem "A HAILREQUEST"
Combo40000.AddItem "A HAILACKNOWLEDGE"
Text1000.Text = ""
End Sub
Private Sub Command40000_Click()
If Combo30000.Text = "A" Then
X10ControllerA.Visible = True
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "B" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = True
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "C" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = True
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "D" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = True
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "E" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = True
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "F" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = True
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "G" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = True
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "H" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = True
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "I" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = True
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "J" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = True
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "K" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = True
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "L" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = True
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "M" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = True
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "N" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = True
X10ControllerO.Visible = False
X10ControllerP.Visible = False
End If
If Combo30000.Text = "O" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = True
X10ControllerP.Visible = False
End If
If Combo30000.Text = "P" Then
X10ControllerA.Visible = False
X10ControllerB.Visible = False
X10ControllerC.Visible = False
X10ControllerD.Visible = False
X10ControllerE.Visible = False
X10ControllerF.Visible = False
X10ControllerG.Visible = False
X10ControllerH.Visible = False
X10ControllerI.Visible = False
X10ControllerJ.Visible = False
X10ControllerK.Visible = False
X10ControllerL.Visible = False
X10ControllerM.Visible = False
X10ControllerN.Visible = False
X10ControllerO.Visible = False
X10ControllerP.Visible = True
End If
Combo30000.Text = ""
End Sub
Private Sub Combo40000_KeyPress(KeyAscii As Integer)
Char = Chr(KeyAscii)
KeyAscii = Asc(UCase(Char))
End Sub
Private Sub Command1_Click()
If Option1(1).Value = True Then
Text1.ForeColor = &HFF00&
Text1.BackColor = &HFF00&
Text1.Text = Frame1.Tag + " ON"
ActiveHome1.SendAction "sendplc", Text1.Text
End If
If Option1(0).Value = True Then
Text1.ForeColor = &HFF&
Text1.BackColor = &HFF&
Text1.Text = Frame1.Tag + " OFF"
ActiveHome1.SendAction "sendplc", Text1.Text
End If
End Sub
Private Sub Command100_Click()
Option1(0).Value = False
Option1(1).Value = False
Text1.Text = ""
Text1.BackColor = &H80000005
End Sub
Private Sub Command2_Click()
If Option2(1).Value = True Then
Text2.ForeColor = &HFF00&
Text2.BackColor = &HFF00&
Text2.Text = Frame2.Tag + " ON"
ActiveHome1.SendAction "sendplc", Text2.Text
End If
If Option2(0).Value = True Then
Text2.ForeColor = &HFF&
Text2.BackColor = &HFF&
Text2.Text = Frame2.Tag + " OFF"
ActiveHome1.SendAction "sendplc", Text2.Text
End If
End Sub
Private Sub Command200_Click()
Option2(0).Value = False
Option2(1).Value = False
Text2.Text = ""
Text2.BackColor = &H80000005
End Sub
Private Sub Command3_Click()
If Option3(1).Value = True Then
Text3.ForeColor = &HFF00&
Text3.BackColor = &HFF00&
Text3.Text = Frame3.Tag + " ON"
ActiveHome1.SendAction "sendplc", Text3.Text
End If
If Option3(0).Value = True Then
Text3.ForeColor = &HFF&
Text3.BackColor = &HFF&
Text3.Text = Frame3.Tag + " OFF"
ActiveHome1.SendAction "sendplc", Text3.Text
End If
End Sub
Private Sub Command300_Click()
Option3(0).Value = False
Option3(1).Value = False
Text3.Text = ""
Text3.BackColor = &H80000005
End Sub
Private Sub Command4_Click()
If Option4(1).Value = True Then
Text4.ForeColor = &HFF00&
Text4.BackColor = &HFF00&
Text4.Text = Frame4.Tag + " ON"
ActiveHome1.SendAction "sendplc", Text4.Text
End If
If Option4(0).Value = True Then
Text4.ForeColor = &HFF&
Text4.BackColor = &HFF&
Text4.Text = Frame4.Tag + " OFF"
ActiveHome1.SendAction "sendplc", Text4.Text
End If
End Sub
Private Sub Command400_Click()
Option4(0).Value = False
Option4(1).Value = False
Text4.Text = ""
Text4.BackColor = &H80000005
End Sub
Private Sub Command5_Click()
If Option5(1).Value = True Then
Text5.ForeColor = &HFF00&
Text5.BackColor = &HFF00&
Text5.Text = Frame5.Tag + " ON"
ActiveHome1.SendAction "sendplc", Text5.Text
End If
If Option5(0).Value = True Then
Text5.ForeColor = &HFF&
Text5.BackColor = &HFF&
Text5.Text = Frame5.Tag + " OFF"
ActiveHome1.SendAction "sendplc", Text5.Text
End If
End Sub
Private Sub Command500_Click()
Option5(0).Value = False
Option5(1).Value = False
Text5.Text = ""
Text5.BackColor = &H80000005
End Sub
Private Sub Command6_Click()
If Option6(1).Value = True Then
Text6.ForeColor = &HFF00&
Text6.BackColor = &HFF00&
Text6.Text = Frame6.Tag + " ON"
ActiveHome1.SendAction "sendplc", Text6.Text
End If
If Option6(0).Value = True Then
Text6.ForeColor = &HFF&
Text6.BackColor = &HFF&
Text6.Text = Frame6.Tag + " OFF"
ActiveHome1.SendAction "sendplc", Text6.Text
End If
End Sub
Private Sub Command600_Click()
Option6(0).Value = False
Option6(1).Value = False
Text6.Text = ""
Text6.BackColor = &H80000005
End Sub
Private Sub Command7_Click()
If Option7(1).Value = True Then
Text7.ForeColor = &HFF00&
Text7.BackColor = &HFF00&
Text7.Text = Frame7.Tag + " ON"
ActiveHome1.SendAction "sendplc", Text7.Text
End If
If Option7(0).Value = True Then
Text7.ForeColor = &HFF&
Text7.BackColor = &HFF&
Text7.Text = Frame7.Tag + " OFF"
ActiveHome1.SendAction "sendplc", Text7.Text
End If
End Sub
Cheers!