ProSoft Technology MVI69-ADM User Manual
Page 283

MVI-ADM ♦ 'C' Programmable
CIP Messaging Library Functions
'C' Programmable Application Development Module
Developer's Guide
ProSoft Technology, Inc.
Page 283 of 342
February 20, 2013
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 (page 272)