neMESYS SDK  20150729
Error Handling

This group defines all required error handling functions. More...

Functions

NCS_Func long __stdcall NCS_GetDevErrorMsg (ncs_hdl hDevice, unsigned char DosingUnit, long DevErrCode, char *pErrString, unsigned char MaxErrStringSize)
 Get an descriptive error message for a certain device error code. More...
 
NCS_Func void __stdcall NCS_GetErrorMsg (long ErrCode, char *pErrMsgBuf, unsigned long ErrMsgBugSize)
 Get an descriptive error message for a certain error code. More...
 
NCS_Func long __stdcall NCS_GetLastDevErr (ncs_hdl hDevice, unsigned char DosingUnit, long *pLastErr)
 Get last error from device that is in fault state. More...
 

Detailed Description

This group defines all required error handling functions.

All functions of neMESYS API return an error code. This error code is returned as a signed 32 bit integer. If no error occured, then ERR_NOERR is returned. The value of ERR_NOERR is 0. If an error occurred, then the error code is returned a s a negative value. I.e. if a cartain function parameter is out of range, then -ERR_PARAM_RANGE will be returned. That means you can check if the return code is < 0 to know if an error occured.

To check if a device error occured during dosage, you should periodically call NCS_IsInFaultState(). If this function returns true then you can call the function NCS_GetLastDevErr() to read the last error from the device. You can use the functions NCS_GetErrMsg() or NCS_GetDevErrorMsg() to translate an error code into a human readable string.

Function Documentation

NCS_Func long __stdcall NCS_GetDevErrorMsg ( ncs_hdl  hDevice,
unsigned char  DosingUnit,
long  DevErrCode,
char *  pErrString,
unsigned char  MaxErrStringSize 
)

Get an descriptive error message for a certain device error code.

Parameters
[in]hDeviceValid device handle
[in]DosingUnitDosing unit number of dosing unit that caused error
[in]DevErrCodeThe device error code (NCS_GetLastDevErr())
[in]pErrStringBuffer for storing the returned error string
[in]MaxErrStringSizeSize of buffer pErrString
Returns
Error code - ERR_NOERR indicates success
NCS_Func void __stdcall NCS_GetErrorMsg ( long  ErrCode,
char *  pErrMsgBuf,
unsigned long  ErrMsgBugSize 
)

Get an descriptive error message for a certain error code.

Parameters
[in]ErrCodeError code returned by function
[out]pErrMsgBufBuffer for storing the error string
[in]ErrMsgBugSizeSize of string buffer pErrorString points to
Examples:
neMESYS_Init.cpp.
NCS_Func long __stdcall NCS_GetLastDevErr ( ncs_hdl  hDevice,
unsigned char  DosingUnit,
long *  pLastErr 
)

Get last error from device that is in fault state.

If a device is in fault state, then this funtcion returns the error code of this device.

Parameters
[in]hDeviceValid device handle
[in]DosingUnitIndex of neMESYS pump from 0 to number of pumps - 1
[out]pLastErrLast device error that occured
Returns
Error code - ERR_NOERR indicates success