Chapter 6 553
Programming Fundamentals
Programming in C Using the VTL
Programming Fundamentals
viOpenDefaultRM (&defaultRM);
viOpen (defaultRM, "GPIB0::23::INSTR", VI_NULL,VI_NULL,&vi);
.
.
viClose(vi);
viClose (defaultRM);
Closing a Session
The viClose function must be used to close each session. You can close
the specific device session, which will free all data structures that had
been allocated for the session. If you close the default resource manager
session, all sessions opened using that resource manager will be closed.
Since system resources are also used when searching for resources
(viFindRsrc)orwaitingforevents(viWaitOnEvent), the viClose
functionneedstobecalledtofreeupfindlistsandeventcontexts.