LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using ViOpen repeatedly

I am using visa to open 20 gpib instruments. I have a point in the code where i need to open the 20 instrument sessions upon a user callback. My question is since this is not necessarily at the beginning of the life of the program should I have to viClose the same handle before I open it? The reason I need to do this is at any time the 20 instruments can be turned on or off, and there is basically a button on the screen letting the user check and open for all 20 instruments.

User_callback(

viClose(gpib_instrument_handle_1); //If handle not present this closes nothing, but i dont see that as a problem
// Do I need above line?/Does it present any problems if it is there?

viOpen (defaultRM, "GPIB0", VI_NULL, VI_NULL, &gpib_instrument_handle_1);

)

The question really is is there any memory issues with re-opening the same instrument handle again over and over again?

Thanks
0 Kudos
Message 1 of 2
(3,065 Views)
Hi Eward,

I don't see any problems with opening and closing the GPIB handle, but I don't quite understand why you want to do that. I don't think you need the statement:

viClose(gpib_instrument_handle_1);

But maybe you have a reason for that??

JenK
0 Kudos
Message 2 of 2
(3,043 Views)