beautypg.com

Object registration – ProSoft Technology MVI56E-LDM User Manual

Page 85

background image

ControlLogix Platform ♦ "C" Programmable

CIP API Functions

Linux Application Development Module

Developer's Manual

ProSoft Technology, Inc.

Page 79 of 264

March 12, 2014

5.2

Object Registration

OCXcip_RegisterAssemblyObj

Syntax

int OCXcip_RegisterAssemblyObj(OCXHANDLE apihandle,

OCXHANDLE * objHandle,

DWORD reg_param,

OCXCALLBACK (*connect_proc)(),

OCXCALLBACK (*service_proc)());

Parameters

apihandle

handle returned by previous call to OCXcip_Open

objHandle

pointer to variable of type OCXHANDLE. On successful return,
this variable will contain a value which identifies this object.

reg_param

value that will be passed back to the application as a parameter
in the connect_proc and service_proc callback functions.

connect_proc

pointer to callback function to handle connection requests

service_proc

pointer to callback function to handle service requests

Description
This function is used by an application to register all instances of the Assembly
Object with the CIP API. The object must be registered before a connection can
be established with it.

apihandle

must be a valid handle returned from

MVIcip_Open

.

reg_param

is a value that will be passed back to the application as a parameter in

the

connect_proc

and

service_proc

callback functions. The application may use

this to store an index or pointer. It is not used by the CIP API.

connect_proc

is a pointer to a callback function to handle connection requests to

the registered object. This function will be called by the backplane device driver
when a Class 1 scheduled connection request for the object is received. It will
also be called when an established connection is closed. Refer to Callback
Functions for information.

service_proc

is a pointer to a callback function which handles service requests to

the registered object. This function will be called by the backplane device driver
when an unscheduled message is received for the object. Refer to Callback
Functions for information.

Return Value

OCX_SUCCESS

object was registered successfully

OCX_ERR_NOACCESS

handle does not have access

OCX_ERR_BADPARAM

connect_proc or service_proc is NULL

OCX_ERR_ALREADY_REGISTERED

object has already been registered