Publication 1756-RM004B-EN-P - October 2000
CIP Messaging API 4-19
msgSize
points to the size in bytes of the data pointed to by msgBuf.
The application should update this with the size of the response data
before returning.
extendederr
is a pointer to a word which can be set by the callback
function to an extended error code if the service request is refused.
Return Value:
The
service_proc
routine must return one of the following values:
MVI_SUCCESS message processed successfully
MVI_CIP_BAD_INSTANCE invalid class instance
MVI_CIP_BAD_SERVICE invalid service code
MVI_CIP_BAD_ATTR invalid attribute
MVI_CIP_ATTR_NOT_SETTABLE attribute is not settable
MVI_CIP_PARTIAL_DATA data size invalid
MVI_CIP_BAD_ATTR_DATA attribute data is invalid
MVI_CIP_FAILURE generic failure code
Example:
MVIHANDLE Handle;
MVICALLBACK service_proc ( MVIHANDLE objHandle, MVICIPSERVSTRUC
*sServ )
{
// Select which instance is being accessed.
// The application defines how each instance is defined.
switch(sServ->instance)
{
case 1: // Instance 1
// Check serviceCode and attribute; perform
// requested service if appropriate
break;
case 2: // Instance 2
// Check serviceCode and attribute; perform
// requested service if appropriate
break;
default:
return(MVI_CIP_BAD_INSTANCE); // Invalid instance
}
}
See Also:
MVIcip_RegisterAssemblyObj
service_proc