Example in Visual Basic
Private Sub cmdSetBaudRateSM_Click()
Dim ChangeBaudSerialCmd As Integer
Dim BaudRate As Integer
Dim strInputBuf As Variant
Dim PreviousSettings As String
PreviousSettings = commCtrl.Settings
'Check that we're in remote and have selected a baud rate
If CheckInitialConditions(True, False, True) = False Then
GoTo SetSMBaud_err_handler
End If
ChangeBaudSerialCmd = 197
BaudRate = GetBaudSerialCmd
commCtrl.Output = Chr$(ChangeBaudSerialCmd) + Chr$(BaudRate)
Delay (300)
'Change the Baud setting for the application also
If BaudRate = 0 Then
commCtrl.Settings = "9600,n,8,1"
ElseIf BaudRate = 1 Then
commCtrl.Settings = "19200,n,8,1"
ElseIf BaudRate = 2 Then
commCtrl.Settings = "38400,n,8,1"
ElseIf BaudRate = 3 Then
commCtrl.Settings = "56000,n,8,1"
ElseIf BaudRate = 4 Then
commCtrl.Settings = "115200,n,8,1"
Else
'Box will fail, set back to 9600.
commCtrl.Settings = "9600,n,8,1"
End If
Delay (1000)
strInputBuf = CStr(commCtrl.Input)
strInputBuf = Mid(strInputBuf, 1, 1)
If strInputBuf = "" Then
MsgBox "Invalid Baud Rate - NO STRING"
GoTo SetSMBaud_err_handler
End If
If Asc(strInputBuf) = 255 Then
MsgBox "Set Baud Rate Succesfully"
ElseIf Asc(strInputBuf) = 238 Then
MsgBox "SiteMaster Timed out"
GoTo SetSMBaud_err_handler
ElseIf Asc(strInputBuf) = 224 Then
MsgBox "Invalid Baud Rate - ERR 22–"
GoTo SetSMBaud_err_handler
133
'Setting Baud rate Serial Command
'Get the Serial cmd for the specific
'baud rate
'Sending
'the data
Need help?
Do you have a question about the Spectrum Master MS2711D and is the answer not in the manual?