beautypg.com

Ioctl (basic statement), Ioctl$ (basic statement) – Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual

Page 310

background image

III. COMMAND REFERENCES - 15. Command References

15A. Driver488/DRV Commands

Personal488 User’s Manual, Rev. 3.0

III-295

The

IO ADDRESS

command specifies the I/O port base address of the I/O adapter. The base address is

set by a sixteen-bit integer,

ioaddr

, that is usually given as a hexadecimal number. For example, to

use the default I/O address, the command would be

IO ADDRESS &H02E1

.

The default I/O port base address for the IEEE 488 hardware interface is

&H02E1

for the first interface,

&H22E1

for the second,

&H42E1

for the third, and

&H62E1

for the fourth interface. The default I/O

port base addresses for the serial hardware interface is

&H03F8

. Other standard I/O port base addresses

are

&H02F8

,

&H03E8

,

&H02E8

. The

IO ADDRESS

value must match the hardware switch settings on

the I/O adapter.

IOCTL (BASIC Statement)

SYNTAX

IOCTL#2,"BREAK"

RESPONSE

None

MODE

Any

BUS STATES

None

SEE ALSO

IOCTL$

EXAMPLE

IOCTL#2,"BREAK"

Send the IOCTL message “BREAK” to the Driver488

The

IOCTL

command is a BASIC statement that can be used to reset Driver488 unconditionally. When

the message

“BREAK”

is sent to Driver488 via the

IOCTL Write

DOS function (

&H4403

, accessible

via the

IOCTL

BASIC statement), Driver488 stops any command currently executing, and prepares to

accept a new command. This can be used even when Driver488 is not expecting a command, but is
transferring data. Commands such as

ABORT

or

RESET

may then be used to reset the entire IEEE 488

bus.

IOCTL

resets the

EOL OUT

terminators to their default values to guarantee that Driver488 is able to

recognize the next command correctly. No

IOCTL

commands other than

BREAK

are supported by

Driver488. The

IOCTL

command can be accomplished in other languages by using MS-DOS function

calls.

IOCTL$ (BASIC Statement)

SYNTAX

A$=IOCTL$(#2)

A$

is a string variable that is set to one of the following:

0

if there is nothing to read,

1

if there is something to read,

2

if data should be written,

3

if the remainder of a command is expected.

RESPONSE

None

MODE

Any

BUS STATES

None

SEE ALSO

IOCTL

EXAMPLE

100 PRINT#1,"ENTER16"
110 A$=IOCTL$(#2)
120 IF A$="1" THEN PRINT INPUT$(1,#2): GOTO 110
130 PRINT “NO INPUT READY”

The

IOCTL$

command is a BASIC statement that can be used to determine the communication state of

Driver488. When data is read from Driver488 using the

IOCTL Read

DOS command (

&H4402

, access

via the

IOCTL$

BASIC function), Driver488 returns a single ASCII character, either

0

,

1

,

2

, or

3

. The

meaning of these responses is:

0

: A response of

0

indicates that Driver488 is ready to receive a command. It has no data to read,

nor is it expecting data for output to the IEEE 488 bus.