beautypg.com

ProSoft Technology MVI56E-LDM User Manual

Page 173

background image

ControlLogix Platform ♦ "C" Programmable

CIP API Functions

Linux Application Development Module

Developer's Manual

ProSoft Technology, Inc.

Page 167 of 264

March 12, 2014

OCXcip_GetIdObject

Syntax

int OCXcip_GetIdObject (OCXHANDLE apihandle,

OCXCIPIDOBJ *idoObject);

Parameters

apihandle

handle returned by previous call to OCXcip_Open

idobject

Pointer to structure of type OCXCIPIDOBJ

Description

OCXcip_GetIdObject

retrieves the identity object for the module.

apihandle

must be a valid handle returned from

OCXcip_Open

.

idobject

is a pointer to a structure of type

OCXCIPIDOBJ

. The members of this

structure will be updated with the module identity data.
The following example defines the

OCXCIPIDOBJ

structure:

typedef struct tagOCXCIPIDOBJ

{

WORD VendorID; //Vendor ID Number

WORD DeviceType; //General product type

WORD ProductCode: //Vendor-specific product identifier

BYTE MajorRevision; //Major revision level

BYTE MinorRevision; //Minor revision level

DWORD SerialNo; //Module serial number

BYTE Name [32]; //Text module name (null-terminated)

} OCXCIPIDOBJ;

Return Value

OCX_SUCCESS

ID object was retrieved successfully

OCX_ERR_NOACCESS

apihandle does not have access

Example

OCXCIPHANDLE apihandle;
OCXCIPIDOBJ idobject;

// Read ID data from ControlLogix in slot 0

OCXcip_GetIdObject(apihandle,&idobject);

printf ("ModuleName: %s Serial Number: %lu\n",
idobject.Name, idobject.SerialNo);