beautypg.com

ProSoft Technology MVI56E-LDM User Manual

Page 155

background image

ControlLogix Platform ♦ "C" Programmable

CIP API Functions

Linux Application Development Module

Developer's Manual

ProSoft Technology, Inc.

Page 149 of 264

March 12, 2014

OCXcip_GetExDeviceObject

Syntax

int OCXcip_GetExDeviceObject(OCXHANDLE apihandle,
BYTE *pPathStr,
OCXCIPEXDEVOBJ *exdevobject,
WORD timeout);

Parameters

apihandle

handle returned by previous call to OCXcip_Open

pPathStr

path to device being read

exdevobject

pointer to structure receiving the extended device object data

timeout

number of milliseconds to wait for the read to complete

Description

OCXcip_GetExDeviceObject

retrieves the extended device object from the module

at the address specified in

pPathStr

.

apihandle

must be a valid handle returned from

OCXcip_Open

.

exdevobject

is a pointer to a structure of type

OCXCIPEXDEVOBJ

. The members of

this structure will be updated with the extended device object data from the
addressed module.

timeout

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

should wait for a response from the device.
The following example defines the

OCXCIPEXDEVOBJ

structure:

typedef struct tagOCXCIPEXDEVOBJ

{

BYTE Name[64];

BYTE Description[64];

BYTE GeoLocation[64];

WORD NumPorts;

OCXCIPEXDEVPORTATTR PortList[8];

} OCXCIPEXDEVOBJ;

The following example defines the OCXCIPEXDEVPORTATTR structure:

typedef struct tagOCXCIPEXDEVPORTATTR

{

WORD PortNum;

WORD PortUse;

} OCXCIPEXDEVPORTATTR;

Return Value

OCX_SUCCESS

ICP object was retrieved successfully

OCX_ERR_NOACCESS

apihandle does not have access

OCX_ERR_MEMALLOC

returned if not enough memory is available