Get Error Contents

By using function CntGetErrorString, it is possible to convert error code to a character string for all functions.
The character string used by function CntGetErrorString is 256 bytes at most.

Programming Example in C

long Ret;
long ErrorRet;
short Id;
char ErrorString[256];

Ret = CntInit( "CNT000" , &Id );
ErrorRet = CntGetErrorString( Ret , ErrorString );
printf("CntInit :%s", ErrorString );

Ret = CntExit( Id );
ErrorRet = CntGetErrorString( Ret , ErrorString );
printf("CntExit :%s", ErrorString );

 

Programming Example in Python

Ret = ctypes.c_long()

ErrorRet = ctypes.c_long()

Id = ctypes.c_short()

ErrorString = ctypes.create_string_buffer(256)

 

Ret.value = ccnt.CntInit ( b"CNT000" , ctypes.byref(Id) )

ErrorRet.value = ccnt.CntGetErrorString( Ret, ErrorString )

print( f"CntInit : {ErrorString.value.decode('sjis')}" )

 

Ret.value = ccnt.CntExit ( Id )

ErrorRet.value = ccnt.CntGetErrorString( Ret, ErrorString )

print( f"CntExit : {ErrorString.value.decode('sjis')}" )