Cip api initialization functions – ProSoft Technology MVI56E-LDM User Manual
Page 79

ControlLogix Platform ♦ "C" Programmable
CIP API Functions
Linux Application Development Module
Developer's Manual
ProSoft Technology, Inc.
Page 73 of 264
March 12, 2014
5.1
CIP API Initialization Functions
OCXcip_Open
Syntax
int OCXcip_Open(OXCHANDLE *apihandle);
Parameters
apiHandle
pointer to variable of type OCXHANDLE
Description
OCXcip_Open
acquires access to the CIP API and sets apiHandle to a unique ID
that the application uses in subsequent functions. This function must be called
before any of the other CIP API functions can be used.
IMPORTANT: Once the API has been opened,
OCXcip_Close
should always be
called before exiting the application.
Return Value
OCX_SUCCESS
API was opened successfully
OCX_ERR_REOPEN
API is already open
OCX_ERR_NODEVICE
backplane driver could not be accessed
Note:
OCX_ERR_NODEVICE
will be returned if the backplane device driver is not
loaded.
Example
OCXHANDLE apiHandle;
if (OCXcip_Open(&apiHandle)!= OCX_SUCCESS)
{
printf ("Open failed!\n");
}
else
{
printf ("Open succeeded\n");
}
See Also
OCXcip_Close