Measurement-computing Personal488 rev.3.0 For DOS & Windows 3.Xi Manual de usuario Pagina 349

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 400
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 348
15B. Driver488/SUB, W31, W95, & WNT III. COMMAND REFERENCES - 15. Command References
III-334 Personal488 Users Manual, Rev. 3.0
OnEventVDM
Driver488/W95 (Console Mode Applications only)
SYNTAX
INT pascal OnEventVDM(DevHandleT devHandle, EventFuncT func);
devHandle
refers to either an interface or an external device.
func
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.
RETURNS
-1 if error
MODE
Any
SEE ALSO
OnEvent, Arm, Disarm
BUS STATES
None
EXAMPLE
qsk(x,Arm(ieee0, acSRQ));
qsk(x,OnEventVDM(ieee0, srqHandler));
Arm SRQ detection and set
up SRQ function handler
This function is new in Driver488/W95. The
OnEventVDM
(
VDM
refers to Virtual DOS Machine)
allows a call back to a user-specified function in a console mode application. The following is a full
example of a console mode program using the
OnEventVDM
function:
#include <windows.h>
#include <stdio.h>
#include iotieee.h
// For debugging
#define qsk(v,x) (v=x, printf(#x returned %d/n, v))
void
srqHandler(DevHandlerT devHandle, UINT mask)
{
LONG xfered;
printf(\007\n\nEVENT-FUNCTION on %d mask 0x%04x\n,devHandle,
mask);
qsk(xfered, Spoll(devHandle));
printf(\n\n);
}
void
main(void)
{
LONG result, xfered;
int ioStatus, x;
DevHandleT ieee0, wave14, wave16;
TermT myTerm;
UCHAR buffer[500];
printf(\n\nSRQTEST program PID %d\n,GetCurrentProcessId ());
qsk(ieee0, OpenName(ieee0));
qsk(wave14, OpenName(Wave14));
qsk(wave16, OpenName(Wave16));
qsk(result, Abort(wave14));
qsk(result, Abort(wave16));
qsk(x, Hello(ieee0, buffer));
printf(\n%s\n\n, buffer);
myTerm.EOI = 1;
myTerm.nChar = 0;
myTerm.termChar[0] = \r;
myTerm.termChar[1] = \n;
// Arm SRQ detection and set up SRQ function handler
qsk(x, Arm(ieee0, acSRQ));
qsk(x, OnEventVDM(ieee0, srqHandler));
// Tell the Wave to assert SRQ in 3 seconds
qsk(xfered,Output(wave16,t3000x,6L,1,0,&myTerm,0,&ioStatus));
printf(Completion code: 0x%04x\n, ioStatus);
Vista de pagina 348
1 2 ... 344 345 346 347 348 349 350 351 352 353 354 ... 399 400

Comentarios a estos manuales

Sin comentarios