08-11-2008 03:28 PM
08-12-2008 01:44 AM
08-12-2008 10:32 AM
In a word: no.
@DJDDA wrote:
Will it cause errors, program crashing, etc. for me to give a Close command on a VISA session that isn't open any more?
08-12-2008 11:09 AM
08-12-2008 01:11 PM
12-11-2014 01:59 AM
I close all VISA Sessions /before/ they are used.
Much easier to do than closing at exit.
Especially during development and debugging it happens that the prog ends prematurely and unplanned.
When I restarted the program in these cases , I got VISA errors and even bluescreens.
Closing VISA sessions at the very beginning solved these problems for me.
12-11-2014 08:37 AM
@PeterHeckert wrote:
Much easier to do than closing at exit.
But you really should be closing them when you are done with them. If you try to close something that isn't open, it is not an issue.
12-11-2014 09:10 AM - edited 12-11-2014 09:16 AM
Yes it is true, closing everything at exit is good programming style.
However, it is sometimes difficult.
I test PCB boards which have an inbuilt USB to Serial interface. After each test a new PCB is inserted.
If the PCB is defective then the serial interface (e.g. COM 3) might malfunction or might not be present at OS (Windows) level. All trouble must be expected and the test must be aborted and the next PCB is inserted.
For example, the serial interface can vanish while the program is running.
I had a lot of crashes, before I inserted code to close and reset everything at program start.