ProSoft Technology MVI69-ADM User Manual
Page 328

Side-Connect API Library Functions
MVI-ADM ♦ 'C' Programmable
Developer's Guide
'C' Programmable Application Development Module
Page 328 of 342
ProSoft Technology, Inc.
February 20, 2013
MVIsc_GetLastPcccError
Syntax
int MVIsc_GetLastPcccError(HANDLE handle, BYTE *status, BYTE *extstatus);
Parameters
handle
Handle returned by previous call to MVIsc_Open
status
Pointer to byte to receive PCCC status code
extstatus
Pointer to byte to receive PCCC extended status code
Description
MVIsc_GetLastPcccError retrieves the status and extended status from the last
PCCC error response received from the PLC-5. This function should only be
called after a previous function call has returned MVISC_ERR_PCCCFAIL.
If status is equal to 0xF0, then extstatus contains an extended error code.
Return Value
MVISC_SUCCESS
status and extstatus have been retrieved
MVISC_ERR_NOACCESS
handle does not have access
Example
HANDLE Handle;
int rc;
BYTE status, extstatus;
/* assume rc is set to the return code from a function such */
/* as MVIsc_PLCBTRead */
if (rc == MVISC_ERR_PCCCFAIL) /* debug the PCCC failure */
{
MVIsc_GetLastPcccError(Handle, &status, &extstatus);
printf("\nStatus: %x Extended Status: %x\n", status, extstatus);
}