Section 7 Sample Programs
7-16
9 Const NUM% = 156' Specifies the number of data items to be
read.
1Ø Dim TRACE%(NUM%)' Declares the data storage array.
11 Dim dbuf%(NUM%)' Declares the receive data buffer.
12 Dim UPRBYTE%, LWRBYTE%
13 Dim I%
14 '
15 '
16 Call ibwrt(Ans%, "MEAS WAVEFORM")'
Transits to the Vector Error Waveform
Display screen.
17 Call ibwrt(Ans%, "TRFORM VECT")'
Transits to the Vector Error Waveform
Display screen.
18 Call ibwrt(Ans%, "STORAGE NRM")'
Sets the normal mode.
19 Call ibwrt(Ans%, "BIN 1")'
Sets the read data format to binary.
2Ø Call ibwrt(Ans%, "SWP")'
Starts measurement.
21 '
22 Call ibwrt(Ans%, "XMV? Ø," + Str$(NUM%))'
Inquiries about the measured value of a
vector error.
23 Call ibrdi(Ans%, dbuf%(), NUM% * 2)'
Receives the binary data.
24 For I% = Ø To NUM% - 1
25 UPRBYTE% = dbuf%(I%) And &HFF'
Fetches the upper byte data.
26 LWRBYTE% = (dbuf%(I%) / &H1ØØ) And &HFF'
Fetches the lower byte data.
27
If UPRBYTE% >= 128 Then UPRBYTE% = UPRBYTE% - &H1ØØ '
Corrects a minus value.
28 TRACE%(I%) = UPRBYTE% * &H1ØØ + LWRBYTE%'
Converts data to a 2-byte decimal number.
29 Next I%
3Ø '
31 For I% = Ø To NUM% - 1
32 form2Ø4.Print "Vector Error at "; I% + 6; "symbol
= "; TRACE%(I%) / 1ØØ; "%"
33 Next I%
34 End Sub