DriverSession::InitializeIO
Establishes the I/O connection with the instrument.
Syntax
Section titled “Syntax”virtual ViStatus InitializeIO();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 initialization and is used to establish the I/O connection with the instrument. By default, this function will use the VISA library to open an instrument session using the viOpen function. In simulation mode, this function should do nothing.
Example
Section titled “Example”The following code demonstrates how to override the InitializeIO function:
class Acme4321DriverSession : public DriverSession{public: Acme4321DriverSession(ViSession handle) : DriverSession(handle, 2000, 2000, 2000, false, 1000) { }
virtual ViStatus InitializeIO() override { ViStatus status = VI_SUCCESS;
// Don't try to establish an I/O connection if we're simulating, because, well, that's what "simulating" means // if (!SimulationEnabled()) { // ... establish the I/O connection using a custom DLL or other appropriate mechanism }
return status; }};