beautypg.com

ProSoft Technology MVI56E-LDM User Manual

Page 80

background image

CIP API Functions

ControlLogix Platform ♦ "C" Programmable

Developer's Manual

Linux Application Development Module

Page 74 of 264

ProSoft Technology, Inc.

March 12, 2014

OCXcip_OpenNB

Syntax

int OCXcip_OpenNB(OXCHANDLE *apihandle);

Parameters

apiHandle

pointer to variable of type OCXHANDLE

Description

OCXcip_OpenNB

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.
Most applications will use

OCXcpi_Open

instead of this function. This version of

the open function allows access to a limited subset of API functions that are not
related to the ControlLogix backplane. This can be useful in some situations if an
application separate from the host application needs access to a device such as
the alphanumeric display.
An application should only use either

OCXcip_Open

or

OCXcip_OpenNB

, but never

both.
The API functions that can be accessed after calling

OCXcip_OpenNB

are:

OCXcip_Close

OCXcip_GetDisplay

OCXcip_GetUserLED

OCXcip_GetLED3

OCXcip_GetIdObject

OCXcip_GetModuleStatus

OCXcip_GetSwitchPosition

OCXcip_GetVersionInfo

OCXcip_ReadSRAM

OCXcip_SetDisplay

OCXcip_SetUserLED

OCXcip_SetLED3

OCXcip_SetModuleStatus

OCXcip_Sleep

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

Note:

OCX_ERR_NODEVICE

will be returned if the backplane device driver is not

loaded.