DioGetErrorString
関数を使用することで、全ての関数についてそのエラーコードを文字列に変換することができます。
DioGetErrorString 関数で使用する文字列は、最大256バイトです。
Dim Ret As Integer
Dim ErrorRet As Integer
Dim Id As Short
Dim ErrorString As New StringBuilder("", 256)
Ret = DioInit( "DIO000" , Id )
ErrorRet = DioGetErrorString( Ret, ErrorString )
System.Diagnostics.Debug.WriteLine( "DioInit:" & ErrorString
)
Ret = DioExit( Id )
ErrorRet = DioGetErrorString( Ret , ErrorString )
System.Diagnostics.Debug.WriteLine( "DioExit:" & ErrorString
)
int Ret;
int ErrorRet;
short Id;
string ErrorString;
Ret = dio.Init( "DIO000", out Id );
ErrorRet = dio.GetErrorString( Ret , ErrorString );
System.Diagnostics.Debug.WriteLine( "DioInit:" + ErrorString
);
Ret = dio.Exit( Id );
ErrorRet = dio.GetErrorString( Ret , ErrorString );
System.Diagnostics.Debug.WriteLine( "DioExit:" + ErrorString
);
long Ret;
long ErrorRet;
short Id;
char ErrorString[256];
Ret = DioInit( "DIO000" , &Id );
ErrorRet = DioGetErrorString( Ret , ErrorString );
printf("DioInit:%s", ErrorString );
Ret = DioExit( Id );
ErrorRet = DioGetErrorString( Ret , ErrorString );
printf("DioExit:%s", ErrorString );
Ret = ctypes.c_long()
ErrorRet = ctypes.c_long()
Id = ctypes.c_short()
ErrorString = ctypes.create_string_buffer(256)
Ret.value = cdio.DioInit ( b"DIO000" , ctypes.byref(Id) )
ErrorRet.value = cdio.DioGetErrorString( Ret, ErrorString )
print( f"DioInit : {ErrorString.value.decode('sjis')}" )
Ret.value = cdio.DioExit ( Id )
ErrorRet.value = cdio.DioGetErrorString( Ret, ErrorString )
print( f"DioExit : {ErrorString.value.decode('sjis')}" )