beautypg.com

Basic data acquisition, Block data acquisition – Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual

Page 186

background image

II. SOFTWARE GUIDES - 9. Driver488/SUB

9G. Pascal

Personal488 User’s Manual, Rev. 3.0

II-171

Writeln(‘Buffer overrun’);

if bitSet(stadc,8) then

{ Read and interpret the ADC488 error status }
Writeln(‘ADC488 error’);
errnum: = 5;
lrv: = ioOutput (adc,’E?’);
lrv: = ioEnter (adc,errtext);
Val (errtext,errnum,code);
ifbitSet (errnum,1) then

Writeln (‘Invalid DDC’);

ifbitSet (errnum,2) then

Writeln (‘Invalid DDC option’);

ifbitSet (errnum,4) then

Writeln (‘Conflict error’);

ifbitSet (errnum,8) then

Writeln (‘NVRAM setup error’);

ifbitSet (errnum,16) then

Writeln (‘Calibration error’);

ifbitSet (errnum,32) then

Writeln (‘NVRAM calibration error’);

end;

ifbitSet (stadc,32) then

Writeln (‘Ready’);

ifbitSet (stadc,64) then

Writeln (‘SRQ asserted’);

ifbitSet (stadc,128) then

Writeln (‘Data acquisition complete’);

{ Set up interrupt pointers }
nilptr: = nil;
rv: = ioOnEvent (ieee,@isr,nilptr);

end;

Basic Data Acquisition

With both Driver488/SUB and the external device ready for action, we next might try taking a simple
reading using the ADC488. Here, we use the serial poll (

SPoll

) capabilities of the system to

determine when a response is ready and format the reply.

While not bitset (ioSPoll(adc),32) do begin end;
lrv: = ioEnter (adc,response);
Val (response,voltage,code);
Writeln (‘ADC488 channel #1 reading value is’,voltage);

Block Data Acquisition

First, we set up the ADC488 (

adc

) for the following configuration:

Compensated binary output format (G10)
100 usec scan interval (I3)
No pre-trigger scans = 0, 100 post-trigger scans (N100)
Continuous trigger on GET (T1)

We then wait for the ADC488 to start the acquisition process. Once the acquisition is complete, which
is determined by the MSB of the ADC488’s serial poll response, the buffer pointer of the ADC488 is
reset (

B0

).:

lrv: = ioOutput (adc,’G10I3N100T1X’);
while not bitset (ioSPoll (adc),32) do begin end;
rv: = ioTrigger (adc);
while not bitset (ioSPoll (adc),128) do begin end;
lrv: = ioOutput (adc,’BOX’);

Next, we fill the buffer with 100 readings from the ADC488. The

noterm

terminator structure is used

to disable scanning for terminators such as carriage-return and line-feed.