Publication 1756-RM004B-EN-P - October 2000
4-14 CIP Messaging API
connect_proc
Syntax:
MVICALLBACK connect_proc( MVIHANDLE objHandle,
MVICIPCONNSTRUC *sConn );
Parameters:
objHandle handle of registered object instance
sConn pointer to structure of type MVICIPCONNSTRUCT
Description:
connect_proc
is a callback function which is passed to the CIP API in
the MVIcip_RegisterAssemblyObj call. The CIP API calls the
connect_proc
function when a Class 1 scheduled connection request is
made for the registered object instance specified by
objHandle
.
sConn
is a pointer to a structure of type MVICIPCONNSTRUCT. This
structure is shown below:
typedef struct tagMVICIPCONNSTRUC
{
MVIHANDLE connHandle; // unique value which identifies this connection
DWORD reg_param; // value passed via MVIcip_Register AssemblyObj
WORD reason; // specifies reason for callback
WORD instance; // instance specified in open
WORD producerCP; // producer connection point specified in open
WORD consumerCP; // consumer connection point specified in open
DWORD *lOTApi; // pointer to originator to target packet interval
DWORD *lTOApi; // pointer to target to originator packet interval
DWORD lODeviceSn; // Serial number of the originator
WORD iOVendorId; // Vendor Id of the originator
WORD rxDataSize; // size in bytes of receive data
WORD txDataSize; // size in bytes of transmit data
BYTE *configData; // pointer to configuration data sent in open
WORD configSize; // size of configuration data sent in open
WORD *extendederr; // an extended error code if an error occurs
} MVICIPCONNSTRUC;