ProSoft Technology MVI56E-LDM User Manual
Page 145

ControlLogix Platform ♦ "C" Programmable
CIP API Functions
Linux Application Development Module
Developer's Manual
ProSoft Technology, Inc.
Page 139 of 264
March 12, 2014
OCXcip_GetDeviceIdObject
Syntax
int OCXcip_GetDeviceIdObject (OCXHANDLE apihandle,
BYTE *pPathStr,
OCXCIPIDOBJ *idoObj,
WORD timeout);
Parameters
apihandle
handle returned by previous call to OCXcip_Open
pPathStr
path to device being read
idobject
pointer to structure receiving the Identify Object Data
timeout
number of milliseconds to wait for the read to complete
Description
OCXcip_GetDeviceIdObject
retrieves the identity object from the device at the
address specified in
pPathStr
.
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.
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
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
OCX_ERR_MEMALLOC
returned if not enough memory is available
OCX_ERR_BADPARAM
returned if path was incorrect
Example
OCXCIPHANDLE apihandle;