Gw-instek GSP-827 Programming Manual Manuel d'utilisateur Page 16

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 18
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 15
Copyright 2003 GOODWILL INSTRUMENT CO., LTD.
Dim STime As Double, NTime As Double, Wait As Double
STime = timeGetTime
NTime = timeGetTime
Wait = NTime - STime
Do Until Wait >= DelaymSec
DoEvents
NTime = timeGetTime
If NTime < STime Then 'Maximum timegettime 2^32
Wait = 2 ^ 32 - STime + NTime
Else
Wait = NTime - STime
End If
Loop
End Function
'============================ Send command to GSP-827 ====================================
Public Function SendCMD(CMD As String) As Boolean
Dim Q As String
If Not MSComm1.PortOpen Then 'If port is not open, quit and return false
SendCMD = False
Exit Function
End If
MSComm1.Output = Trim(CMD) & Chr(13) 'Add CR at end of command and send the command to unit
Q = ReadCOM() 'Read the return from unit
Q = Trim(Replace(Q, Chr(13), " ", 1)) 'Replace CR with space
If Q = "OK" Then
ErrStr = ""
SendCMD = True
Else
ErrStr = Trim(rdBuffer)
SendCMD = False
End If
End Function
'========================== Send query command and read the return string ====================================
Public Function SendQuery(QueryStr As String) As String
Dim Q As String
If Not MSComm1.PortOpen Then Exit Function
If MSComm1.InBufferCount Then 'Delete the data in buffer
rdBuffer = MSComm1.Input
Vue de la page 15
1 2 ... 11 12 13 14 15 16 17 18

Commentaires sur ces manuels

Pas de commentaire