beautypg.com

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

Page 196

background image

II. SOFTWARE GUIDES - 9. Driver488/SUB

9I. Operating Modes

Personal488 User’s Manual, Rev. 3.0

II-181

Status Indicator

Description

“P” (Peripheral)

Driver488 is in the Peripheral (

*CA

) operating mode.

“C” (Controller)

Driver488 is the Active Controller (

CA

).

“T1” (Trigger)

Driver488, as a Peripheral, has received a

Trigger

bus command.

“C1” (Clear)

Driver488, as a Peripheral, has received a

Clear

bus command.

“T” (Talk)

Driver488 is in the

Talk

state and can

Output

to the bus.

“L” (Listen)

Driver488 is in the

Listen

state and can

Enter

from the bus.

“I” (Idle)

Driver488 is in neither the

Talk

nor

Listen

state.

“G1” (Change)

An Address Change has occurred, that is, a change between Peripheral

and Controller, or among

Talk

,

Listen

, and

Idle

has occurred.

This is, perhaps, the most useful interrupt in the Peripheral mode.

The following BASIC program fragment illustrates the use of the Address Change and Addressed State
indicators to communicate with the Active Controller.

First check

Status

until it indicates there has been an Address Change:

while (1) {

Status (ieee, &stat);
if (!stat.addrChange) { continue;}
if (stat.idle) {continue;)

/* If we are addressed to listen, we ENTER a line from the */
/* controller and print it out. */

if (stat.listener) {

Enter (ieee, data);
printf (“%d”, data);
printf (“\n”;
continue;

}

/* If we are addressed to talk, we INPUT a line from the keyboard*/
/* and OUTPUT it to the controller.*/

if (stat.talker) {

gets (message);
Output (ieee, message);
continue;

}
printf (Bad addressed state.\n”);
break;

}

It is also possible to detect these conditions with the

Arm

command and handle them in an Interrupt

Service Routine (ISR). The

Peripheral

,

Controller

,

Talk

,

Listen

, and

Idle

conditions cause

interrupts only when the Address Change indicator

“G1”

in the

Status

response is set. The

Change

,

Trigger

, and

Clear

indicators are all reset by the

Status

command. Thus, the

Status

command

should be used in the Interrupt Service Routine to prevent re-interruption by an indicator which has not
been reset.

The various

Arm

conditions and their descriptions are provided in the following table: