IP Control of lights
Posted: Sat Sep 10, 2005 4:08 am
Scottbot
Good morning
I have an ip controller that controls garden lights etc. It has a web interface or comes with an SDK( with DLL) which I have modified I sthere any way of getting this directly controlled by house bot?
Below is module for Dll link and below that the Modified VB6 code
Module
Option Explicit
Declare Function Initreceivep6 Lib "socket.dll" Alias "receivep6" () As Long
Declare Function Datareceive Lib "socket.dll" Alias "receive" () As Long
Declare Function Datatransfer Lib "socket.dll" Alias "transfer" (ByVal variable As Long) As Long
Declare Function Datatransferp5 Lib "socket.dll" Alias "transferp5" (ByVal variable As Long) As Long
Declare Function Setdata Lib "socket.dll" Alias "setdata" (ByVal variable As Long) As Long
Declare Function Cleandata Lib "socket.dll" Alias "cleandata" (ByVal variable As Long) As Long
Declare Sub Setip Lib "socket.dll" Alias "setip" (ByVal variable As String)
VB6 code
Option Explicit
Dim wr_iostatus
Private Sub Delay(Optional ByVal HowLong As Single)
Dim OldTime As Single, Continue As Single
OldTime = Timer
Do While Continue < HowLong
Continue = Timer - OldTime
Loop
End Sub
Private Sub Command2_Click()
Dim J
J = Datatransfer(wr_iostatus)
Form1.Text1 = "io control setting val : " & J
End Sub
Private Sub Command3_Click()
Setip (Text2.Text)
Call Form_Load
End Sub
Private Sub Command10_Click()
Command10.Visible = False
Command18.Visible = True
wr_iostatus = Setdata(&H40)
End Sub
Private Sub Command11_Click()
Command11.Visible = False
Command19.Visible = True
wr_iostatus = Setdata(&H80)
End Sub
Private Sub Command18_Click()
Command10.Visible = True
Command18.Visible = False
wr_iostatus = Cleandata(&HBF)
End Sub
Private Sub Command19_Click()
Command11.Visible = True
Command19.Visible = False
wr_iostatus = Cleandata(&H7F)
End Sub
Private Sub Form_Load()
Dim P6
Timer2.Enabled = True
P6 = Initreceivep6
If (P6 And &H40) Then
Command10.Visible = False
Command18.Visible = True
Setdata (&H40)
Else
Command10.Visible = True
Command18.Visible = False
Cleandata (&HBF)
End If
If (P6 And &H80) Then
Command11.Visible = False
Command19.Visible = True
Setdata (&H80)
Else
Command11.Visible = True
Command19.Visible = False
Cleandata (&H7F)
End If
End Sub
Private Sub Timer2_Timer()
Label6.Caption = Date & Time
End Sub
Regards PT
Good morning
I have an ip controller that controls garden lights etc. It has a web interface or comes with an SDK( with DLL) which I have modified I sthere any way of getting this directly controlled by house bot?
Below is module for Dll link and below that the Modified VB6 code
Module
Option Explicit
Declare Function Initreceivep6 Lib "socket.dll" Alias "receivep6" () As Long
Declare Function Datareceive Lib "socket.dll" Alias "receive" () As Long
Declare Function Datatransfer Lib "socket.dll" Alias "transfer" (ByVal variable As Long) As Long
Declare Function Datatransferp5 Lib "socket.dll" Alias "transferp5" (ByVal variable As Long) As Long
Declare Function Setdata Lib "socket.dll" Alias "setdata" (ByVal variable As Long) As Long
Declare Function Cleandata Lib "socket.dll" Alias "cleandata" (ByVal variable As Long) As Long
Declare Sub Setip Lib "socket.dll" Alias "setip" (ByVal variable As String)
VB6 code
Option Explicit
Dim wr_iostatus
Private Sub Delay(Optional ByVal HowLong As Single)
Dim OldTime As Single, Continue As Single
OldTime = Timer
Do While Continue < HowLong
Continue = Timer - OldTime
Loop
End Sub
Private Sub Command2_Click()
Dim J
J = Datatransfer(wr_iostatus)
Form1.Text1 = "io control setting val : " & J
End Sub
Private Sub Command3_Click()
Setip (Text2.Text)
Call Form_Load
End Sub
Private Sub Command10_Click()
Command10.Visible = False
Command18.Visible = True
wr_iostatus = Setdata(&H40)
End Sub
Private Sub Command11_Click()
Command11.Visible = False
Command19.Visible = True
wr_iostatus = Setdata(&H80)
End Sub
Private Sub Command18_Click()
Command10.Visible = True
Command18.Visible = False
wr_iostatus = Cleandata(&HBF)
End Sub
Private Sub Command19_Click()
Command11.Visible = True
Command19.Visible = False
wr_iostatus = Cleandata(&H7F)
End Sub
Private Sub Form_Load()
Dim P6
Timer2.Enabled = True
P6 = Initreceivep6
If (P6 And &H40) Then
Command10.Visible = False
Command18.Visible = True
Setdata (&H40)
Else
Command10.Visible = True
Command18.Visible = False
Cleandata (&HBF)
End If
If (P6 And &H80) Then
Command11.Visible = False
Command19.Visible = True
Setdata (&H80)
Else
Command11.Visible = True
Command19.Visible = False
Cleandata (&H7F)
End If
End Sub
Private Sub Timer2_Timer()
Label6.Caption = Date & Time
End Sub
Regards PT