我这样写开关定时器出错了:
'开定时器
Public Function Command_LON() As Integer
Dim sErrorMessage As String
Dim msgData As String
Dim rc As Integer
Dim bRc As Boolean
rc = 0
msgData = ""
sErrorMessage = ""
Dim sdat As String
sdat = ChrW(27) & “16 54 0D" ' LON Command Data Send
bRc = gclsLCR.SendMessage(sdat)
If bRc = False Then
GoTo Func_Err
End If
Debug.Print (sdat)
Func_Err:
Command_LON = rc
End Function
'关定时器
Public Function Command_LOFF() As Integer
Dim rc As Integer
rc = 0
Dim sdat As String
Dim bRc As Boolean
sdat = ChrW(27) & " 16 55 0D" ' LOFF Command Data Send
bRc = gclsLCR.SendMessage(sdat)
If bRc = False Then
GoTo Func_Err
End If
Func_Err:
Debug.Print (sdat)
Command_LOFF = rc
End Function