[in] ViSession handle for the driver session.
DriverSession::CloseIO
Closes the I/O connection with the instrument.
Syntax
Section titled “Syntax”virtual ViStatus CloseIO();
ViStatus CloseIO(ViSession Vi);Parameters
Section titled “Parameters”Vi
Return value
Section titled “Return value”Returns a VI_SUCCESS if the operation was successful or a failure ViStatus otherwise.
Remarks
Section titled “Remarks”This function is automatically called as part of driver shutdown and is used to sever the I/O connection with the instrument. By default, Nimbus uses the VISA library viClose function to sever the connection with the instrument.
Example
Section titled “Example”The following code demonstrates how to override the CloseIO function:
class Acme4321DriverSession : public DriverSession{public: Acme4321DriverSession(ViSession handle) : DriverSession(handle, 2000, 2000, 2000, false, 1000) { }
virtual ViStatus CloseIO() override { // We're still using VISA, so we delegate to the base class, but then we perform custom post-processing. // Non-VISA-based drivers would override in a similar fashion but *not* delegate to the base. Rather, // they would perform a custom operation such as invoking functions on a helper DLL specific to the // I/O protocol in use. // auto status = __super::CloseIO(); ReturnOnError(status);
// ... free up additional driver specific resources.
return status; }};