GX5296, GX5961, GX5964, File
Returns the error description for an error number.
GtDio6xGetErrorString (nError, pszError, nErrorMaxLen, nCount)
Name |
Type |
Comments |
nError |
SHORT |
Error number, pnStatus, as returned from other DIO functions. |
pszError |
LPSTR |
Error buffer. |
nErrorMaxLen |
SHORT |
Maximum length of error buffer. |
pnStatus |
SHORT |
Returned status: 0 on success, negative value on failure. |
The error buffer is filled the string describing the error code contained in nError. nErrror is the last parameter pnStatus returned from all of this library functions.
See Error Code for a description of the available error codes.
The following example prints the error string if the GtDio6xSetupInitialization function failed:
SHORT nStatus, nStatus2;
CHAR szError[1024];
GtDio6xSetupInitialization (0, 1, 0x0200, &nMasterHandle, &nStatus);
if (nStatus<0);
{ GtDio6xGetErrorString(nStatus, szError, sizeof (szError), &nStatus2);
printf(szError);
return;
}