7-12
IM 701730-17E
msg = "TIMEBASE:TDIV 100ms" 'T/div = 100ms
sts = TmSend(Dev, msg)
If (sts <> CTL_OK) Then
Call DisplayError(Dev)
GetMeasure = 1
Exit Function
End If
msg = "TRIGGER:SIMPLE:LEVEL 500mV" 'Trigger level = 500mV
sts = TmSend(Dev, msg)
If (sts <> CTL_OK) Then
Call DisplayError(Dev)
GetMeasure = 1
Exit Function
End If
msg = "MEASURE:CHANNEL1:PTOPEAK:STATE ON" 'Measure P-P On
sts = TmSend(Dev, msg)
If (sts <> CTL_OK) Then
Call DisplayError(Dev)
GetMeasure = 1
Exit Function
End If
msg = "MEASURE:CHANNEL1:AVERAGE:STATE ON" 'Measure Average On
sts = TmSend(Dev, msg)
If (sts <> CTL_OK) Then
Call DisplayError(Dev)
GetMeasure = 1
Exit Function
End If
msg = "MEASURE:CHANNEL1:FREQUENCY:STATE ON" 'Measure Frequency On
sts = TmSend(Dev, msg)
If (sts <> CTL_OK) Then
Call DisplayError(Dev)
GetMeasure = 1
Exit Function
End If
msg = "MEASURE:TRANGE -5,5" 'Measure Time Range -5,5
sts = TmSend(Dev, msg)
If (sts <> CTL_OK) Then
Call DisplayError(Dev)
GetMeasure = 1
Exit Function
End If
msg = "SSTART? 500" 'Start Single Trigger
sts = TmSend(Dev, msg) 'Wait until stop Acquisition
If (sts <> CTL_OK) Then
Call DisplayError(Dev)
GetMeasure = 1
Exit Function
End If
sts = TmReceive(Dev, qry, Len(qry), rlen)
If (sts <> CTL_OK) Then
Call DisplayError(Dev)
GetMeasure = 1
Exit Function
End If
stp = Val(qry)
If (stp = 1) Then
GetMeasure = 2
Exit Function
End If
msg = "MEASURE:MODE ON" 'Start Measure
sts = TmSend(Dev, msg)
If (sts <> CTL_OK) Then
Call DisplayError(Dev)
GetMeasure = 1
Exit Function
End If
msg = "MEASURE:WAIT? 100" 'Wait until stop Measure
sts = TmSend(Dev, msg)
If (sts <> CTL_OK) Then
Call DisplayError(Dev)
GetMeasure = 1
Exit Function
End If
sts = TmReceive(Dev, qry, Len(qry), rlen)
If (sts <> CTL_OK) Then
Call DisplayError(Dev)
GetMeasure = 1
Exit Function
End If
7.6 Sets/Queries Measure Value