Handling interrupt messages, Handling errors – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 49

Advertising
background image

Publication 1747-UM002A-US-P - June 2000

Developing Applications 3-17

Handling Interrupt
Messages

Modules that communicate via discrete input interrupts or module
interrupts require special attention. The API buffers these interrupts
internally until they are extracted via OC_PollScanner. The internal
message buffer can hold as many as 5 messages. If the message buffer
is full, the oldest message in the buffer is overwritten by the next
message. Interrupts will be missed if OC_PollScanner is not called by
the application more often than interrupts are received.

For Windows NT, use the OC_WaitForxxx functions.

Handling Errors

Every function call returns a status code for the function. Check this
status code before using the data returned by the function. The
scanner reports faults and other errors via messages. The API library
buffers these errors internally and reports their existence as an
Extended Error. The application must periodically call
OC_GetExtendedError to determine if an extended error message
exists.

The library buffers extended errors in a queue. The queue can hold as
many as 5 extended errors at one time. If the queue is full when a
new extended error is received from the scanner, the oldest extended
error is lost and ERR_OCOVERRUN is returned. The host application
must call OC_GetExtendedError periodically to remove existing
extended errors from the buffer.

Extended Errors cause the scanner to fault. Once the scanner is
faulted, it is forced to Idle mode and cannot go to Scan mode until the
Extended Errors are extracted via OC_GetExtendedError and the fault
is cleared via OC_ClearFault. For Windows NT, use the
OC_WaitForExtError function.

Advertising
This manual is related to the following products: