Return value: considerations, Example – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 132

Advertising
background image

Publication 1747-UM002A-US-P - June 2000

6-72 Library of Routines

Return Value:

Considerations:

Supported in the Windows NT API library only.

Example:

HANDLE

handle;

intrc;

MSGBUF

eosMSG

/* Request an output scan, but don’t wait */

OC_DemandOutputScan(handle, OCNOWAIT);

/* Could have other code here */

/* Wait 1 second for the EOS */

rc = OC_WaitForEosDmdOut(handle, 1000);

switch(rc) {

case SUCCESS: /* got EOS*/

/* reset the EOS_DMDOUT event*/

OC_PollScanner (handle,OCMSG_EOS_DMDOUT,&eosMSG);

/* do logic, etc. sychronized with the I/O scan */

break;

case ERR_OCRESPONSE:/* timed out */

printf(“\nTimed out waiting for EOS\n”);

break;

default;

printf(“\nError!\n”);

break;

}

Name:

Value:

Description:

SUCCESS

0

demand output EOS message was received

ERR_RESPONSE

10

msTimeout

milliseconds elapsed without an EOS

ERR_OCACCESS

2

handle

does not have access to scanner

Advertising
This manual is related to the following products: