From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Vi handle is reset automatically

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);

0 Kudos
Message 1 of 1
(3,804 Views)