I use C++ to control digitizer. I have an simulated NI5122 on my laptop. I get a strange problem now.
I use comand "niScope_init" to get ViSession "vi". And the value of "vi" is 1. After I run command "niScope_Fetch", the value of "vi" becomes to 0.
Then, all other commands cannot be excuted as ViSession is now invalid. I am sure I do not excute "niScope_close".
If I set "vi" to 1 manually (code: "vi = 1", not by "niScope_init"), I can use other commands again. However, everytime I use "niScope_Fetch" or "niScope_Read", "vi" becomes 0.
I do not know why it happens. Can anyone tell me? Thanks.
p.s. my code:
StateCode = niScope_init(PCIName,VI_FALSE,VI_FALSE,&vi);
StateCode = niScope_Fetch(vi,"0,1",1,MaxSample,wfmPtr,&wfmInfo);