Oc_waitfordii, Oc_waitfordii -68, Syntax – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 128: Parameters: description, Return value: considerations, Example

Advertising
background image

Publication 1747-UM002A-US-P - June 2000

6-68 Library of Routines

OC_WaitForDII

Blocks the calling thread until a DII interrupt is received from the
scanner or

msTimeout

milliseconds have elapsed.

Syntax:

int

OC_WaitForDII(HANDLE handle, DWORD msTimeout)

Parameters:

Description:

If a DII has been received since the last OCMSG_DIINT message was
retrieved with the OC_PollScanner function, OC_WaitForDII returns
SUCCESS immediately.

Return Value:

Considerations:

Supported in the Windows NT API library only.

Example:

HANDLE

handle; intrc;

MSGBUF

diiMSG

/* Wait for 10 seconds for a DII */

rc = OC_WaitForDII(handle, 10000);

switch(rc) {

case SUCCESS: /* got a DII */

/* fetch the DII message */

OC_PollScanner (handle,OCMSG_DIINT,&diiMSG);

break;

case ERR_OCRESPONSE:/* timed out */

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

break;

default;

printf(“\nError!\n”);

break;

}

Parameter:

Description:

handle

Must be a valid handle returned from OC_OpenScanner

msTimeout

Specifies the number of milliseconds to wait
Set to INFINITE to wait forever

Name:

Value:

Description:

SUCCESS

0

a DII was received

ERR_RESPONSE

10

msTimeout

milliseconds elapsed without a DII

ERR_OCACCESS

2

handle

does not have access to scanner

Advertising
This manual is related to the following products: