Morning everyone,
Im trying to create a remote controlled thermostat programme. At present the server is sent the temperature using IP Sockets. This temperature is displayed in strData on the Server Form.
I think i want to create a select case statement to send a charater to the serial port using the VB Component MS Comm but at present i unsure how to create it without using multiple if statements. How do you code a select case statement?
At present the code in vb is the following
If strData = "#20#" Then
MSComm1.Output = "A"
End If
If strData = "#22#" Then
MSComm1.Output = "S"
End If
If strData = "#24#" Then
MSComm1.Output = "D"
End If
If strData = "#26#" Then
MSComm1.Output = "F"
End If
If strData = "#28#" Then
MSComm1.Output = "G"
End If
If strData = "#28#" Then
MSComm1.Output = "H"
End If
Secondly the device connected to the serial port will send back a "#!#" character when connected.
Im hoping to use images on the server to show whether they are connected or not to the device. A clear circle will be displayed if not connected and a green circle when the system is connect.
How should i do this? Should i use imported jpg's? What code will be needed? is it MSCOmm.input = "#!#"?
This must sound very trivial to some people but im very much a beginner and any assistance will be appreciated.
Im trying to create a remote controlled thermostat programme. At present the server is sent the temperature using IP Sockets. This temperature is displayed in strData on the Server Form.
I think i want to create a select case statement to send a charater to the serial port using the VB Component MS Comm but at present i unsure how to create it without using multiple if statements. How do you code a select case statement?
At present the code in vb is the following
If strData = "#20#" Then
MSComm1.Output = "A"
End If
If strData = "#22#" Then
MSComm1.Output = "S"
End If
If strData = "#24#" Then
MSComm1.Output = "D"
End If
If strData = "#26#" Then
MSComm1.Output = "F"
End If
If strData = "#28#" Then
MSComm1.Output = "G"
End If
If strData = "#28#" Then
MSComm1.Output = "H"
End If
Secondly the device connected to the serial port will send back a "#!#" character when connected.
Im hoping to use images on the server to show whether they are connected or not to the device. A clear circle will be displayed if not connected and a green circle when the system is connect.
How should i do this? Should i use imported jpg's? What code will be needed? is it MSCOmm.input = "#!#"?
This must sound very trivial to some people but im very much a beginner and any assistance will be appreciated.
Last edited: