beautypg.com

Find listeners – Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual

Page 308

background image

III. COMMAND REFERENCES - 15. Command References

15A. Driver488/DRV Commands

Personal488 User’s Manual, Rev. 3.0

III-293

selects which response is to be used. In general, when Driver488 receives a request for data, it is
provided with the address in memory of a buffer that is to hold the response, and with the buffer length.

If

FILL OFF

is specified, then the buffer is filled with any available response, and the remainder of the

buffer (if it is larger than the response) is not changed. If no response is available, then the entire
buffer is left unchanged, but no error is indicated.

If

FILL ERROR

is specified, then the buffer is filled with any available response, and the remainder of

the buffer (if it is larger than the response) is not be changed. If no response is available, then the
entire buffer is left unchanged and a

SEQUENCE - NO DATA AVAILABLE

error occurs.

If

FILL

term is specified, where term is one of

CR

,

LF

,

$char

, or

‘X

, the buffer is filled with any

available response, and the remainder of the buffer (if it is larger than the response) is filled with the
specified character. If no response is available, the entire buffer is filled with that character.

If the error is due to an actual programming error, it is to the user’s advantage to have Driver488
automatically detect this error. In this case, error detection should be enabled with the

FILL ERROR

command. Normal I/O with Driver488 in both BASIC and Turbo Pascal 3.0 is performed on a
character-by-character basis and so neither language reads more data than is available. Thus,

FILL ERROR

is appropriate for both languages. Note, however, that the

OPEN

for input command in

some versions of BASIC does try to read one character upon opening the file. For this reason, the files
should be opened in the following sequence:

100 OPEN “\DEV\IEEEOUT” FOR OUTPUT AS #1
110 IOCTL#1,"BREAK"
120 PRINT#1,"RESET"
130 OPEN “\DEV\IEEEIN” FOR INPUT AS #2
140 PRINT#1,"FILL OFF"

The

RESET

command guarantees that

FILL$000

(the default condition,

FILL

with the null character) is

in effect when the

OPEN

statement tries to read the first character from Driver488. Driver488 responds

with a null character that BASIC ignores so that the first real response from Driver488 will be
corrupted.

In some languages, such as C, the I/O routines may try to read a fixed length block from Driver488.
Use of the BASIC

GET

file I/O also has this effect. The size of the block requested varies. It may be as

much as several thousand bytes, or it may be the record size or buffer length defined for the file. In any
case, if

FILL

is

OFF

, then no error is signaled, and the returned characters are placed into the first bytes

of the buffer. The remainder of the block is not modified. It is, though, sometimes useful to fill the
remainder of the block with some specific byte value. This is accomplished with the

FILL term

command.

FILL term

forces Driver488 to return as many characters as are requested by the I/O

routines, even if they are dummy fill characters.

FIND LISTENERS

SYNTAX

FIND LISTENERS pri-addr

RESPONSE

The number of active listeners found, followed by those

addresses, separated by commas.

MODE

Any

BUS STATES

UNL, LAG

SEE ALSO

CHECK LISTENER, BUS ADDRESS, STATUS

EXAMPLES

PRINT#1,"FIND LISTENERS 12"
LINE INPUT#1,A$

0

No Listeners Found

1,12

Primary Address Listener Found

2,1200,1201

Secondary Address Listeners Found

The

FIND LISTENERS

command finds all of the devices configured to listen at the specified primary

address on the IEEE 488 bus. It takes the primary address to check, and returns the number of listeners
found and their addresses.