beautypg.com

ProSoft Technology MVI56E-LDM User Manual

Page 111

background image

ControlLogix Platform ♦ "C" Programmable

CIP API Functions

Linux Application Development Module

Developer's Manual

ProSoft Technology, Inc.

Page 105 of 264

March 12, 2014

OCXcip_WaitForRxData

Syntax

int OCXcip_WaitForRxData(OCXHANDLE apihandle,
OCXHANDLE connHandle,
Int timeout );

Parameters

apiHandle

handle returned by previous call to OCXcip_Open

connHandle

handle of open connection

timeout

Number of milliseconds to wait for the read to complete

Description
This function will block the calling thread until data is received on the open
connection specified by

connHandle

. If the timeout expires before data is

received, the function returns

OCX_ERR_TIMEOUT

.

apiHandle

must be a valid handle return from

OCXcip_Open

.

connHandle

must be a

handle passed by the

connect_proc

callback function.

timeout

is used to specify the amount of time in milliseconds the application

should wait for a response from the Logix processor.

Return Value

OCX_SUCCESS

data was read successfully

OCX_ERR_NOACCESS

apihandle

does not have access

OCX_ERR_BADPARAM

connHandle

or offset/dataSize is invalid

OCX_ERR_TIMEOUT

The timeout expired before data was received

Example

OCXHANDLE apihandle;
OCXHANDLE connHandle;

// Synchronize with the controller scan

OCXcip_WaitForRxData (apiHandle, connHandle, 1000);

See Also
OCXcip_WriteConnected