Omega CYD211 User Manual page 46

Single input temperature monitor
Table of Contents

Advertisement

Table 4-3. Visual Basic Serial Interface Program
Public gSend As Boolean
Private Sub cmdSend_Click()
gSend = True
End Sub
Private Sub Form_Load()
Dim strReturn As String
Dim strHold As String
Dim Term As String
Dim ZeroCount As Integer
Dim strCommand As String
frmSerial.Show
Term = Chr(13) & Chr(10)
ZeroCount = 0
strReturn = ""
strHold = ""
If frmSerial.MSComm1.PortOpen = True Then '
frmSerial.MSComm1.PortOpen = False
End If
frmSerial.MSComm1.CommPort = 1
frmSerial.MSComm1.Settings = "9600,o,7,1" 'Baud,Parity,Data,Stop
frmSerial.MSComm1.InputLen = 1
frmSerial.MSComm1.PortOpen = True
Do
Do
DoEvents
Loop Until gSend = True
gSend = False
strCommand = frmSerial.txtCommand.Text
strReturn = ""
strCommand = UCase(strCommand)
If strCommand = "EXIT" Then
End
End If
Program continues on the next page...
4-8
Omega Model CYD211 User's Manual
'Global used for Send button state
'Routine to handle Send button press
'Set Flag to True
'Main code section
'Used to return response
'Temporary character space
'Terminators
'Counter used for Timing out
'Data string sent to instrument
'Show main window
'Terminators are <CR><LF>
'Initialize counter
'Clear return string
'Clear holding string
Close serial port to change settings
'Example of Comm 1
'Read one character at a time
'Open port
'Wait loop
'Give up processor to other events
'Loop until Send button pressed
'Set Flag as false
'Get Command
'Clear response display
'Set all characters to upper case
'Get out on EXIT
Remote Operation

Advertisement

Table of Contents
loading

Table of Contents