ClassPrefix Initialize With Options

IVI Driver Help

Edition Date: August 2011

Part Number: 370430H-01

»View Product Info
Download Help (Windows Only)

IVI Inherent Function

To form the ClassPrefix VI name, use the prefix of the class driver that you are working with. For example, if you are working with the IviDmm class driver, use the prefix IviDmm to create the correct VI name, IviDmm Initialize With Options. Details.

logical name ("SampleScope") Passes the logical name that identifies the particular driver session to use. The driver session, in turn, identifies a specific driver and device and specifies the initial settings for the session. You configure the logical name, driver session, specific driver, and hardware asset with MAX.

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

Default Values:

"SampleScope" for IviScope

"SampleDmm" for IviDmm

"SamplePower" for IviDCPwr

"SampleSwitch" for IviSwtch

"SampleFgen" for IviFgen

id query (True) Specify whether you want the instrument driver to perform an ID Query.

Valid Range:

TRUE (1)—Perform ID Query (Default Value)

FALSE (0)—Skip ID Query

When you set this parameter to TRUE, the driver verifies that the instrument you initialize is a type that this driver supports.

Circumstances can arise where it is undesirable to send an ID Query command string to the instrument. When you set this parameter to FALSE, the VI initializes the instrument without performing an ID Query.

reset device (True) Specify whether you want the to reset the instrument during the initialization procedure.

Valid Range:

TRUE (1)—Reset Device (Default Value)

FALSE (0)—Do not Reset

error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

option string ("Simulate=0,RangeCheck=0,QueryInstrStatus=0,Cache=1,InterchangeCheck=0") You can use this parameter to set the initial value of certain properties for the session. The following table lists the name and the properties you use in this parameter to identify the property.
NameProperty
Range Check CLASSPREFIX_ATTR_RANGE_CHECK
QueryInstrStatus CLASSPREFIX_ATTR_QUERY_INSTRUMENT_STATUS
Cache CLASSPREFIX_ATTR_CACHE
Simulate CLASSPREFIX_ATTR_SIMULATE
RecordCoercions CLASSPREFIX_ATTR_RECORD_COERCIONS
InterchangeCheck CLASSPREFIX_ATTR_INTERCHANGE_CHECK
UseSpecificSimulation CLASSPREFIX_ATTR_USE_SPECIFIC_SIMULATION

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 pass NULL or an empty string for this parameter, the session uses the default values for the properties. You can override the default values by assigning a value explicitly in a string you pass for this parameter. You do not have to specify all of the properties and may leave any of them out. If you do not specify one of the properties, its default value will be used.

The default values for the properties are shown below:

NameDefault Value
RangeCheckTRUE
QueryInstrStatusFALSE
CacheTRUE
SimulateFALSE
RecordCoercionsFALSE
InterchangeCheck FALSE
DriverSetup""

The following are valid values for ViBoolean properties:

True: 1, TRUE, or TRUE
False: 0, False, or FALSE
Default Value:  ""

An example option string:

"Simulate=0,RangeCheck=1,QueryInstStatus=0,Cache=1,Spy=0,InterchangeCheck=0"

Note  Spying on IVI API calls within NI I/O Trace is a feature that is only available if you have NI I/O Trace installed on your system. NI I/O Trace is installed with several NI software packages.
instrument handle out The instrument driver that you use to identify the instrument in all subsequent instrument driver VI calls.
Notes
  1. This VI creates a new session each time you invoke it, which is useful if you have multiple physical instances of the same type of instrument.
  2. Avoid creating multiple concurrent instrument handles to the same physical instrument. Although you can create more than one instrument driver handle for the same resource, it is best not to do so.
error out The error out cluster passes error or warning information out of a VI to be used by other VIs.

The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.

ClassPrefix Initialize With Options Details

This VI performs the following initialization actions:

  • Creates a new IVI instrument driver session.
  • Opens a session to the specific driver using the logical name of the IVI virtual instrument.
  • If the ID Query parameter is set to TRUE, this VI queries the instrument ID and checks that it is valid for this instrument driver.
  • If the Reset parameter is set to TRUE, this VI resets the instrument to a known state.
  • Sends initialization commands to set the instrument to the state necessary for the operation of the instrument driver.
  • Returns an instrument handle that you use to identify the instrument in all subsequent instrument driver VI calls.
Note  This VI creates a new session each time you invoke it. Although you can open more than one IVI session for the same resource, it is best not to do so. You can use the same session in multiple program threads.
Caution   All IVI names, such as logical names or virtual names, are case-sensitive. If you use logical names, driver session names, or virtual names in your program, you must make sure that the name you use matches the name in the IVI Configuration Store file exactly, without any variations in the case of the characters in the name.

WAS THIS ARTICLE HELPFUL?

Not Helpful