Sample Program
7-13
IM 701730-17E
7
msg = "MEASURE:CHANNEL1:PTOPEAK:VALUE?" 'Get P-P value
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
Query(0) = "Peak To Peak:" + Left$(qry, rlen - 1)
msg = "MEASURE:CHANNEL1:AVERAGE:VALUE?" 'Get Average value
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
Query(1) = "Average:" + Left$(qry, rlen - 1)
msg = "MEASURE:CHANNEL1:FREQUENCY:VALUE?" 'Get Freq value
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
Query(2) = "Frequency:" + Left$(qry, rlen - 1)
msg = "COMMUNICATE:HEADER ON" 'Query Header On
sts = TmSend(Dev, msg)
If (sts <> CTL_OK) Then
Call DisplayError(Dev)
GetMeasure = 1
Exit Function
End If
GetMeasure = 0
End Function
----------------------------------------------------------------------------------------
7.6 Sets/Queries Measure Value