Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Opening and Closing Sessions...

What is the suggested practice for opening and closing communication
sessions in an application. Do use viOpenDefaultRM at the beginning and use
this as a global object or do we use good object oriented design practice
and use viOpenDefaultRM and then use viOpen to open communication in a local
set of varibles in the function or sub and then close both objects before
exiting.
Please comment,
Gary
0 Kudos
Message 1 of 2
(3,342 Views)
You may do whichever you prefer.
Each instrument class I create does it's own OpenDefaultRM and keeps the return value internally.
I know many people who do not use object oriented languages and simply keep the DefaultRM value in a global variable.

As far as the recommended practice, I don't know of any official recommendation regarding this detail.
0 Kudos
Message 2 of 2
(3,342 Views)