Can anyone help me with my code? I want to clear the message from the display, and display another one to it. I thought i could clear the buffer but it doesnt want to do it. I am using the dcd and dsr line for input and i wanted to OR the two, to give various results.
My first message comes up then when a volt comes on the DSR line i have a message to be displayed, but the original message will stay there!!
Heres the beginning of my code:
Option Explicit
Private Declare Function SER_OPEN& Lib "SERSEN04.DLL" (ByVal commPort&, ByVal baudRate&)
Private Declare Function SER_CLOSE& Lib "SERSEN04.DLL" ()
Private Declare Sub SER_SEND Lib "SERSEN04.DLL" (theString$)
Private Declare Sub SER_RAWSEND Lib "SERSEN04.DLL" (theString$)
Dim intEnd As Integer
Private Sub cmdExit_Click()
intEnd = 1
End
End Sub
Private Sub cmdStart_Click()
MSComm1.PortOpen = True
Dim SerData As Integer, SerData1 As Integer
MSComm1.Output = "normal"
If MSComm1.DSRHolding > 0 Or MSComm1.CDHolding = 1 Then
'MSComm1.OutBufferCount = 0
'MSComm1.PortOpen = False
'MSComm1.PortOpen = True
MSComm1.Output = "Crying"
'If MSComm1.DSRHolding = False Then
'MSComm1.Output = "" 'Text2.Text
Else
MSComm1.Output = ""
End If
'Loop
'If MSComm1.DSRHolding = True Then
' MSComm1.InBufferCount = 0
' MSComm1.Output = "Crying"
'Else
' MSComm1.Output = ""
'MSComm1.PortOpen = False
' End If
End Sub
Private Sub Form_Load()
frmdetect.Top = (Screen.Height - frmdetect.Height) / 2
frmdetect.Left = (Screen.Width - frmdetect.Width) / 2
End Sub
Private Sub Delay(HowLong As Date)
Dim TempTime As Date
TempTime = DateAdd("s", HowLong, Now)
While TempTime > Now
DoEvents 'Allows windows to handle other stuff
Wend
End Sub
My first message comes up then when a volt comes on the DSR line i have a message to be displayed, but the original message will stay there!!
Heres the beginning of my code:
Option Explicit
Private Declare Function SER_OPEN& Lib "SERSEN04.DLL" (ByVal commPort&, ByVal baudRate&)
Private Declare Function SER_CLOSE& Lib "SERSEN04.DLL" ()
Private Declare Sub SER_SEND Lib "SERSEN04.DLL" (theString$)
Private Declare Sub SER_RAWSEND Lib "SERSEN04.DLL" (theString$)
Dim intEnd As Integer
Private Sub cmdExit_Click()
intEnd = 1
End
End Sub
Private Sub cmdStart_Click()
MSComm1.PortOpen = True
Dim SerData As Integer, SerData1 As Integer
MSComm1.Output = "normal"
If MSComm1.DSRHolding > 0 Or MSComm1.CDHolding = 1 Then
'MSComm1.OutBufferCount = 0
'MSComm1.PortOpen = False
'MSComm1.PortOpen = True
MSComm1.Output = "Crying"
'If MSComm1.DSRHolding = False Then
'MSComm1.Output = "" 'Text2.Text
Else
MSComm1.Output = ""
End If
'Loop
'If MSComm1.DSRHolding = True Then
' MSComm1.InBufferCount = 0
' MSComm1.Output = "Crying"
'Else
' MSComm1.Output = ""
'MSComm1.PortOpen = False
' End If
End Sub
Private Sub Form_Load()
frmdetect.Top = (Screen.Height - frmdetect.Height) / 2
frmdetect.Left = (Screen.Width - frmdetect.Width) / 2
End Sub
Private Sub Delay(HowLong As Date)
Dim TempTime As Date
TempTime = DateAdd("s", HowLong, Now)
While TempTime > Now
DoEvents 'Allows windows to handle other stuff
Wend
End Sub