CNiIviDriver::SetSession

Measurement Studio IVI

Class
CNiIviDriver::
SetSession()
Data ItemsFunctionsGo to hierarchy chart    Prev page: SessionIsValidNext page: SetSession    
Public Function Declared in:
NiIviDriver.h

'Declaration' icon -- Shortcut to top of page. Declaration

inline void SetSession(
    const CString& rsrcName,
    bool reset,
    bool idQuery,
    const CString& options = "",
    bool destructorClosesSession = true);

'Description' icon -- Shortcut to top of page. Description

Constructor that creates a new session from the resource descriptor provided and assigns it to the object. If the object is already using a valid session and the DestructorClosesSession property is true, the function closes the existing session.

Shortcut to top of page. Parameters

const CString& rsrcName

Logical name that identifies the particular virtual instrument to use. The virtual instrument, in turn, identifies a specific driver and device and specifies the initial settings for the session. You configure the logical name, virtual instrument, specific driver, and device with National Instruments Measurement and Automation Explorer.

If you want to use your program with a different physical instrument, change the configuration of the logical name to use the virtual instrument for the new physical instrument. You can change the initial settings for the session by changing the configuration of the virtual instrument.

bool reset

Specifies if you want to reset the instrument during the initialization procedure.

bool idQuery

Specifies if you want the instrument driver to verify that the instrument you initialize is a type that this driver supports.

const CString& options = ""

Set the initial values for the following properties:

  • RangeCheck
  • QueryInstrStatus
  • Cache
  • Simulate
  • RecordCoercions
  • Spy
  • InterchangeCheck

The format of this string is "propertyName=value" where propertyName is the name of the property and value is the value to which the property will be set. To set multiple properties, separate their assignments with a comma. If you do not specify a value for a property, the driver uses the value from National Instruments Measurement and Automation Explorer.

bool destructorClosesSession = true

Determines if the session associated with the object is closed when the object is destroyed.

'See Also' icon -- Shortcut to top of page. See Also