Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-Scope driver C function niScope_errorHandler

Hi,

I have a question about  niScope_errorHandler declarated in niscope.h header

ViStatus _VI_FUNC niScope_errorHandler (ViSession vi,
                                        ViInt32 errorCode,
                                        ViChar errorSource[MAX_FUNCTION_NAME_SIZE],
                                        ViChar errorDescription[MAX_ERROR_DESCRIPTION]);

 

Parameter errorSource is a array of char (string) and it inserts to errorDescription. For simulation error of absenting device, I used one of CVI example and it returned correct description with inserted errorSource.

I created bindings for Pascal and function looks

 function niScope_errorHandler(vi:ViSession; errorCode:ViInt32; errorSource:string; errorDescription:string):ViStatus;cdecl;external External_library name 'niScope_errorHandler';

 and errorSource returned unreadeable string (should be niScope_init) and of course insert unreadable part of string to errorDescription

 

From function description I understand that one array of char (errorSource) inserted into another array of char (errorDescription) = ANSI string.

I don't understand why errorSource part is unreadable (CVi example returned readable) because errorDescription is good, after inserting it stil ANSI string.

It's looks that errorSource have different codepage, but it not make sence. :manfrustrated:

Without knowing of how function internally work, I probably can't solve it.

0 Kudos
Message 1 of 2
(4,049 Views)

For first time, I understand function description bad, it my mistake.

 

I close this topic.

0 Kudos
Message 2 of 2
(4,024 Views)