
10-46
IM 704610-01E
If (sts < 0) Then
Call DisplayError(sts, msg)
GetStatistics = 1
Exit Function
End If
sts = TmReceive(Dev, qry, 100, length) 'Receive Query
If (sts < 0) Then
Call DisplayError(sts, msg)
GetStatistics = 1
Exit Function
End If
temp = Left$(qry, length - 1)
sts = val(temp) And 1
If sts = 1 Then
Exit Do
End If
If count > 100 Then
msg = ":STOP" + term 'Stop
sts = TmSend(Dev, msg) 'Send Command
If (sts < 0) Then
Call DisplayError(sts, msg)
GetStatistics = 1
Exit Function
End If
Exit Do
End If
count = count + 1
Sleep 100
Loop
msg = ":CALC:AVER?" + term 'Get Average value
sts = TmSend(Dev, msg) 'Send Command
If (sts < 0) Then
Call DisplayError(sts, msg)
GetStatistics = 1
Exit Function
End If
sts = TmReceive(Dev, qry, 100, length) 'Receive Query
If (sts < 0) Then
Call DisplayError(sts, msg)
GetStatistics = 1
Exit Function
End If
temp = Left$(qry, length - 1)
i = 0
Query(i) = msg + Space$(13 - Len(temp)) + temp
'Get Standard Deviation value
msg = ":CALC:SDEV?" + term
sts = TmSend(Dev, msg) 'Send Command
If (sts < 0) Then
Call DisplayError(sts, msg)
GetStatistics = 1
Exit Function
End If
sts = TmReceive(Dev, qry, 100, length) 'Receive Query
If (sts < 0) Then
Call DisplayError(sts, msg)
GetStatistics = 1
Exit Function
End If
temp = Left$(qry, length - 1)
i = i + 1
Query(i) = msg + Space$(13 - Len(temp)) + temp
Call TmFinish(Dev)
Dev = -1
GetStatistics = 0
End Function
10.4 Sample Program