Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual
Page 256

II. SOFTWARE GUIDES - 10. Driver488/W31
10F. Visual Basic
Personal488 User’s Manual, Rev. 3.0
II-241
While ((Spoll(adc) And 128) = 0)
Wend
‘Reset the buffer pointer of the ADC488
rv% = ioOutput(adc, “B0X”)
Next, we fill the buffer with 100 readings from the ADC488. Since the data being returned from the
ADC 488 is in a binary format, the noterm terminator structure is used to disable scanning for
terminators such as carriage return and line feed.
noterm.eoi = 0
noterm.nChar = 0
rv% = EnterXI(adc, intResp(0), 200, 1, noterm, 0, 0)
The
EnterX
function will use a DMA transfer if available. Because DMA transfers are performed
entirely by the hardware, the program can continue with other work while the DMA transfer function
occurs. For example, the program will process the previous set of data while collecting a new set of
data into a different buffer. However, before processing the data we must wait for the transfer to
complete. For illustration purposes, we query the Driver488/W31 status both before and after waiting.
‘Display DRIVER488/W31 status
rv% = Status(ieee%, substat)
Call showstat(substat)
‘Wait for completion of input operation
rv% = ioWait(adc)
‘Display DRIVER488/W31 status
rv% = Status(ieee%, substat)
Call showstat(substat)
Now we process the buffer:
‘Print the received characters
mystring = “”
For i% = 0 To 99
mystring = mystring + Str$(intResp(i%))+nl
Next i%
The readings are stored in the local variable
mystring
in the above example. They could, however be
placed into a text-type control. Refer to the Driver488/W31 status display in the Driver488/W31 ADC
Example Program window, shown in the following figure:
The functions described so far in this Sub-Chapter provide enough functionality for a basic data
acquisition program. The program listing which appears at the end of this Sub-Chapter, covers the
examples used. Additional functions provided by Driver488/W31 are described in the “Section III:
Command References” of this manual
Driver488/W31 Status Display