ProSoft Technology MVI56E-LDM User Manual
Page 196

CIP API Functions
ControlLogix Platform ♦ "C" Programmable
Developer's Manual
Linux Application Development Module
Page 190 of 264
ProSoft Technology, Inc.
March 12, 2014
OCXcip_ErrorString
Syntax
int OCXcip_ErrorString (int errorcode,
char * buf);
Parameters
errcode
Error code returned from an API function
buf
Pointer to user buffer to receive message
Description
OCXcip_ErrorString
returns a text error message associated with the error code
errcode. The Null-terminated error message is copied into the buffer specified by
buf. The buffer should be a minimum of 80 characters in length.
Return Value
OCX_SUCCESS
Message returned in buff
OCX_ERR_BADPARAM
Unknown error code
Example
char buf[80];
int rc;
.
.
//SOme OCX API is called
rc=OCXcip_.....(.....);
if (rc !=OCX_SUCCESS)
{
// Print error message
OCXcip_ErrorString (rc, buf };
printf ("Error: %s", buf);
}