Publication 1756-RM004B-EN-P - October 2000
CIP Messaging API 4-7
Object Registration
MVIcip_RegisterAssemblyObj
Syntax:
int MVIcip_RegisterAssemblyObj(
MVIHANDLE apiHandle,
MVIHANDLE *objHandle,
DWORD reg_param,
MVICALLBACK (*connect_proc)(),
MVICALLBACK (*service_proc)(),
MVICALLBACK (*rxdata_proc)() );
Parameters:
apiHandle handle returned by previous call to MVIcip_Open
objHandle pointer to variable of type MVIHANDLE. 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
rxdata_proc pointer to callback function to receive data from an
open connection
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. See Section 4.3.4 for details.