Hi,
thank you for answer.
I corrected the code to
niScope_Read(vi,@channel[1],5.0,ActualRecordLength,@data[0],@wfmInfo);
and I also try to set array size
SetLength(data,actualRecordLength * SizeOf(double));
and
Stack window is the same
#0 fpc_reraise at :0
#1 ?? at :0
#2 TFORM1__STARTBTNCLICK(0x102ec0, <error reading variable>) at main.pas:92
#3 TCONTROL__CLICK(<error reading variable>) at .\include\control.inc:2720
#4 TBUTTONCONTROL__CLICK(<error reading variable>) at .\include\buttoncontrol.inc:54
#5 TCUSTOMBUTTON__CLICK(<error reading variable>) at .\include\buttons.inc:169
#6 TBUTTONCONTROL__WMDEFAULTCLICKED({MSG = 66567, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, WPARAMFILLER = {}, LPARAMLO = 0, LPARAMHI = 0, LPARAMFILLER = {}, RESULTLO = 0, RESULTHI = 0, RESULTFILLER = {}}, <error reading variable>) at .\include\buttoncontrol.inc:20
#7 SYSTEM_TOBJECT_$__DISPATCH$formal at :0
#8 TBUTTONCONTROL__ISCHECKEDSTORED(<error reading variable>) at .\include\buttoncontrol.inc:16
#9 TWINCONTROL__WNDPROC({MSG = 66567, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, WPARAMFILLER = {}, LPARAMLO = 0, LPARAMHI = 0, LPARAMFILLER = {}, RESULTLO = 0, RESULTHI = 0, RESULTFILLER = {}}, <error reading variable>) at .\include\wincontrol.inc:5326
#10 DELIVERMESSAGE(0x102ec0, void) at lclmessageglue.pas:112
#11 WINDOWPROC(1049672, 273, 11968, 1180764) at win32callback.inc:2480
#12 CUSTOMFORMWNDPROC(1049672, 273, 11968, 1180764) at win32wsforms.pp:395
#13 USER32!IsWindowVisible at :0
#14 ?? at :0
#15 USER32!IsWindowVisible at :0
#16 ADJUSTFORMBOUNDS at win32wsforms.pp:316
#17 USER32!DestroyReasons at :0
#18 ?? at :0
When I commented the code and leave only three functions
niScope_init(...)
niScope_AutoSetup(...)
niScope_close(...)
program crashed with the same error.
In C code for measurement data (data array in my code) allocate by this code ViReal64 = double:
ViReal64 *waveformPtr = NULL;
waveformPtr = (ViReal64*) malloc (sizeof(ViReal64) * actualRecordLength);
niScope_Read(vi,channel,5.0,actualRecordLength,waveformPtr,&wfmInfo);
Probably it is not directly array.