Hello again,
I have found a probem!! (but I still i don't know why it occures:( )
In one of the SubVIs there are dynamic events used in order to refresh Front Panel during the measurement. This solution is used because measurement loop is inside another SubVI.
The problem is that after starting the measurement memory consumption (can be observed in Task Manager) is getting higher and higher (should be almost at the same level) so after 1000-th iteration it is about 150MB. This "memory leak" is the reason why entire application gets stuck at the end.
I simplified the VI I mentioned so it is possible to run it without any hardware, I put it as an attachement.
Could you please look at this and give me some advice.
Thanks in advance
wbiker