LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

why my system crashed and restart when I call cvi dll

Hello:
I'm using labwindowscvi5.0.1 to do some work.Now I have a puzzle about my program.I made a dll program in the cvi,and called this dll program in VC++6.0.The dll program is:
i16 iarraybuffer[1000]={0};
f64 darraybuffer[1000]={0.0};
int i;

void DLLEXPORT __stdcall IntConvBufSync(i16 channeln,i16 gain,u32 ulpointnumber,f64 dsamplerate,f64 darray[1000])
{
Timeout_Config (1, 180);
DAQ_Op (1, channeln, gain, iarraybuffer, ulpointnumber, dsamplerate);
DAQ_VScale (1, channeln, gain, 1.0, 0.0, ulpointnumber, iarraybuffer,darraybuffer);
for(i=0;i<1000;i++)
darray[i]=darraybuffer[i];
Timeout_Config (1, -1);
}

the C++ program is:(under win32 console application)

#include
"cvirte.h"
#include "aisinglech1dll.h"
#include "iostream.h"

int main (int argc, char *argv[])
{
int i;
double vcdarray[1000];
IntConvBufSync(1,1,100,1000.0,vcdarray);
for(i=0;i<150;i++)
{
cout<<<"\t"< }
return 1;
}

If change all the number 1000(the size of iarraybuffer,darraybuffer,darray,vcdarray)
to 10000,then the C++ program can only run 5 times and get correct result.when to the six time,it made my system blue screen and restart,and my .cpp code turn to binary code.If I change all the number 10000 to 1000,at present,I have run the C++ program 12 times and get correct result.So I guess whether when I run the sixty time,my system will crash and restart.I hope to know why.If you know,please tell me,thanks.
0 Kudos
Message 1 of 2
(2,832 Views)
Hello not have,
I do not know why you system is crashing, but I do have some recommendations that should help you troubleshoot this issue. First, have you tested calling this DLL from CVI (does it crash there also)? Also, try making modifications to your DLL and testing it again (comment out the DAQ calls for instance), are there other changes besides the array sizes that effect whether or not it crashes? Does the Blue Screen give any information regarding what caused the crash? If you continue to have difficulties, feel free to contact us at http://www.ni.com/ask.

Jeremiah Cox
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 2
(2,832 Views)