Hi, everyone
Thanks!
It seems that I didn't solve this problem, but now I maybe understand why it happened.
--------------------------------------------------------------------------------
GerdW said:
Why do you want to initialize an instrument in 2 different places?
Why do you want to close an instrument in 2 different places?
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Graziano said:
i guess the problem is that, running two times SubVI1 you initialize instrument two times (it is not desirable...), and, worst, running SubVi2 you close instrument twice!
--------------------------------------------------------------------------------
That makes me think about the number of doing init & close. My project calls on that there must be a strict requirements about the number of calling those function in one process.
That is to say,when running them, if VI1 and VI2 are in different process but not in the same one, the program is going to run successfully. But now, VI1 and VI2 are threads which in the same process, so my project's strict requirements makes them run failue.I used SPY++ to analysis, and found those two threads are actually in one process.
--------------------------------------------------------------------------------
Graziano said:
I suggest to put SubVI1 and SubVI2 outside VI1 and VI2, and you run them once, at the start and stop of your measurement.
--------------------------------------------------------------------------------
I believe that is a good idea, I can deal the problem in this way. Thank you!
But if anybody has the idea which can deal with the problem between the threads, I will be so glad......
What does that called, Synchronized between threads.....maybe......
To altenbach
I am afraid showing the code doesn't work, because all the VI SubVIs and code is base on the japanese system.and all of them must call the functions form DLL which is protected by my company. I am sorry about that......
Thanks a lot!! Everyone.