beautypg.com

Reading driver status, External device initialization – Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual

Page 177

background image

9F. QuickBASIC

II. SOFTWARE GUIDES - 9. Driver488/SUB

II-162

Personal488 User’s Manual, Rev. 3.0

rv% = ioDisarm% (ieee%, 0) ;

Note that an external device handle is acceptable in this and other functions which actually refer to the
interface; the external device handle will simply be translated to the handle of the interface to which the
device is attached, prior to taking action. This translation is fully automatic within Driver488/SUB and
requires little overhead, so you need not and should not go to great lengths to pass an interface handle,
if your application structure makes the use of external device handles the more logical choice.

Reading Driver Status

Your application may interrogate Driver488/SUB at any time to determine its status and other
information.

Status

information is returned in a structure provided by the application and can be

displayed by the

showstat

function shown below:

rv%=ioStatus%(ieee%,substat)
CALL showstat (substat)

Another function to display the information contained in the

Status

structure could be:

SUB showstat (substat AS IeeeStatus)

PRINT “SC

:”; substat.SC,

PRINT “CA

:”; substat.CA,

PRINT “Primaddr

:”; substat.Primaddr

PRINT “Secaddr

:”; substat.Secaddr,

PRINT “SRQ

:”; substat.SRQ,

PRINT “addrChange

:”; substat.addrChange

PRINT “talker

:”; substat.talker,

PRINT “listener

:”; substat.listene,

PRINT “triggered

:”; substat.triggered

PRINT “cleared

:”; substat.cleared,

PRINT “transfer

:”; substat.transfer,

PRINT “byteIn

:”; substat.byteIn

PRINT “byteOut

:”; substat.byteOut

END SUB

External Device Initialization

Refer to the device manufacturer’s documentation on specific requirements for initializing your
IEEE 488 instrument. In the case of the ADC488, appropriate initialization involves sending it a

Clear

command and placing it into

Remote

mode:

rv% = ioRemote% (adc%)
rv% = ioClear% (adc%)

For our hypothetical application, we also wish to have the ADC488 generate a service request should it
detect a command error. This involves sending a command string consisting of textual data to the
ADC488:

rv% = ioOutput & (adc%, “M8X”)

We may also wish to perform other initialization and configuration. In this case, we set up the
ADC488 (

adc

) in the following configuration:

Differential inputs (A0)
Scan group channel 1 (C1)
Compensated ASCII floating-point output format (G0)
Channel 1 range to +/-10V (R3)
One-shot trigger on talk (T6)

The command to perform this configuration combines the above strings and adds the

Output

command for the ADC488:

rv% = ioOutput& (adc%, “A0C1G0R3T6X”)