beautypg.com

ProSoft Technology MVI56E-LDM User Manual

Page 175

background image

ControlLogix Platform ♦ "C" Programmable

CIP API Functions

Linux Application Development Module

Developer's Manual

ProSoft Technology, Inc.

Page 169 of 264

March 12, 2014

OCXcip_SetIdObject

Syntax

int OCXcip_SetIdObject (OCXHANDLE apihandle,

OCXCIPIDOBJ *idoObject);

Parameters

apihandle

handle returned by previous call to OCXcip_Open

idobject

Pointer to structure of type OCXCIPIDOBJ

Description

OCXcip_SetIdObject

allows an application to customize the identity of a 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;

OCXcip_GetIdObject(apihandle,&idobject); //Get default info

// Change module name

strcpy ((char*) idobject.Name, "Custom Module Name");

OCXcip_SetIdObject (apiHandle, &idobject);