Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5565

NI-Scope driver C function niScope_errorHandler

$
0
0

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.


Viewing all articles
Browse latest Browse all 5565

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>