beautypg.com

Mylistenaddr, Mytalkaddr, Onevent – Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual

Page 347

background image

15B. Driver488/SUB, W31, W95, & WNT

III. COMMAND REFERENCES - 15. Command References

III-332

Personal488 User’s Manual, Rev. 3.0

This is a new function in Driver488/W95. This function is similar to the

MakeDevice

function except

that

MakeNewDevice

will create a new device based on the parameters specified, instead of simply

cloning an existing device. To change the default values assigned to the device, it is necessary to call
the appropriate configuration functions such as

BusAddress

,

IOAddress

, and

TimeOut

.

MyListenAddr

SYNTAX

int pascal MyListenAddr (DevHandleT devHandle);

devHandle

refers to either an interface or an external device. If

devHandle

refers to an external device, the command acts on the associated interface.

RETURNS

-1 if error

MODE

CA

BUS STATES

ATN, MLA

SEE ALSO

MyTalkAddr, Talk, Listen, SendCmd

EXAMPLES

errorcode = MyListenAddr (ieee);

The

MyListenAddr

command addresses the interface to Listen.

MyTalkAddr

SYNTAX

int pascal MyTalkAddr (DevHandleT devHandle);

devHandle

refers to either an interface or an external device. If

devHandle

refers to an external device, the command acts on the associated interface.

RETURNS

-1 if error

MODE

CA

BUS STATES

ATN, MTA

SEE ALSO

MyListenAddr, Listen, SendCmd

EXAMPLES

errorcode = MyTalkAddr (ieee);

The

MyTalkAddr

command addresses the interface to Talk.

OnEvent

Driver488/SUB only

SYNTAX

int pascal OnEvent(DevHandleT devHandle,UserHandleFP

handler,OpaqueP argument);

devHandle

refers to either an interface or an external device.

handler

is a user-specified interrupt-handler function that is to perform some

function, defined by the user, when one of the

Arm

ed conditions occur.

argument

is the 32-bit argument passed to the

handler

function. It may be used

to point to information used by the

handler

function.

RETURNS

-1 if error

MODE

Any

BUS STATES

None

SEE ALSO

Arm, Disarm, LightPen

EXAMPLE

void
Handler(OpaqueP arg)
{
printf(“Interrupt handler got arg = %ld\n”,arg);
}
errorcode = OnEvent(ieee,Handler,(OpaqueP)(15));

The

OnEvent

command specifies the function to be called when an

Arm

ed event occurs. The function

handler

is passed the specified 32-bit argument entry. The

handler

can use the argument to identify

the portion of the program that set up the

OnEvent

, and then use

Status

and other commands to