Rockwell-automation 1747-PCINT API Software for 1746 I/O Manual de usuario Pagina 105

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 155
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 104
OC_PollScanner Library of Routines 6–51
Publication 1747-6.5.3 June 1998
The data returned in the MsgData member array depends upon the value in MsgID:
Separate queues hold messages received from each source. The host application must call OC_PollScanner
periodically to read messages from each enabled source to prevent messages from being discarded. If a
message queue is full when a new message is received, the oldest message is discarded and the next call to
OC_PollScanner results in a return value of ERR_OCOVERRUN. The queue can hold as many as
five messages.
Return Value:
Considerations:
Supported in the DOS API library and the Windows NT API library
Example:
HANDLE Handle;
MSGBUF msgbuf;
int retcode;
retcode = OC_PollScanner( Handle, OCMSG_ANY, &msgbuf );
/* Check msgbuf.MsgID for what message is available */
This MsgID: Returns:
MsgID=OCMSG_IOINT
MsgData[0]slot number that generated the interrupt
MsgID=OCMSG_DIINT
MsgData[0]mask of last bit transition that generated the interrupt
MsgData[2]lowbyte of count of matches that generated the interrupt
MsgData[3]highbyte of count of matches that generated the interrupt
MsgID=OCMSG_EOS_DMDIN
MsgID=OCMSG_EOS_DMDOUT
MsgID=OC_EOS
MsgData[0]number of scans that occurred since the last end-of-scan
message of this type was read
Name: Value: Description:
SUCCESS
0
scanner was polled successfully
ERR_OCACCESS
2
handle does not have access to scanner
ERR_OCOVERRUN
16
a message has been discarded
Vista de pagina 104
1 2 ... 100 101 102 103 104 105 106 107 108 109 110 ... 154 155

Comentarios a estos manuales

Sin comentarios