Thanks for your reply. It seems that the discussion is going to take a wrong turn. I think I have not been clear what I try to accomplish, so here goes.
I have no problem during "normal operation". I call run_block, get_times_and_values etc. and they work fine. I only call close_unit in destructor of my oscilloscope-communicator class.
The problems is that because the destructor of the communicator class may not be called in some circumstances when application is malfunctioning (the oscilloscope handling is implemented in a dll within our own framework) the closing of the connection to the oscilloscope may or may not be done properly (stop & close_unit).
Now when the watchdog restarts everything again, the next open_unit may fail if closing unit was not done properly, and afaik there is no way to correct the situation other than unplugging the scope, which is not a good solution in my case. So I would like to know if there is some way to regain control of the scope in this kind of situation without the unplug feature.
Kind regards and thank you for your patience