niScope Initialize with Options

NI-SCOPE LabVIEW

niScope Initialize with Options

Performs the following initialization actions:

  • Creates a new IVI instrument driver and optionally sets the initial state of the following session properties: Range Check, Cache, Simulate, Record Value Coercions.
  • Opens a session to the device that you specify in the resource name parameter.
  • Resets the instrument to a known state if the reset device parameter is set to True; refer to niScope Reset for the default state of each digitizer.
  • Queries the instrument ID and verifies that it is valid for this instrument driver if the id query parameter is set to True.
  • Returns an instrument handle that you use to identify the instrument in all subsequent instrument driver VI calls.

resource name specifies the device name assigned by Measurement & Automation Explorer (MAX).

Examples

ExampleDevice TypeSyntax
1Traditional NI-DAQ deviceDAQ::1 (1 = device number)
2NI-DAQmx device myDAQmxDevice (myDAQmxDevice = device name)
3NI-DAQmx device DAQ::myDAQmxDevice (myDAQmxDevice = device name)
4NI-DAQmx device DAQ::2 (2 = device name)
5IVI logical name or IVI virtual namemyLogicalName (myLogicalName = name)

For Traditional NI-DAQ devices, the syntax is DAQ::n, where n is the device number assigned by MAX, as shown in Example 1.

For NI-DAQmx devices, the syntax is just the device name specified in MAX, as shown in Example 2. Typical default names for NI-DAQmx devices in MAX are Dev1 or PXI1Slot1. You can rename an NI-DAQmx device by right-clicking on he name in MAX and entering a new name.

An alternative syntax for NI-DAQmx devices consists of DAQ::NI-DAQmx device name, as shown in Example 3. This naming convention allows for the use of an NI-DAQmx device in an application that was originally designed for a Traditional NI-DAQ device. For example, if the application expects DAQ::1, you can rename the NI-DAQmx device to 1 in MAX and pass in DAQ::1 for the resource name, as shown in Example 4.

If you use the DAQ::n syntax and an NI-DAQmx device name already exists with that same name, the NI-DAQmx device is matched first.

You can also pass in the name of an IVI logical name or an IVI virtual name configured with the IVI Configuration utility, as shown in Example 5. A logical name identifies a particular virtual instrument. A virtual name identifies a specific device and specifies the initial settings for the session.

Caution  Traditional NI-DAQ and NI-DAQmx device names are not case-sensitive. However, all IVI names, such as logical 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.
id query verifies that the digitizer you initialize is one that NI-SCOPE supports. NI-SCOPE automatically performs this query, so setting this parameter is not necessary.
option string specifies initialization commands.

The following table lists the properties and the name you use in this parameter to identify the property:

NameAttribute Defined ConstantDefault Value
RangeCheck niScope»Inherent IVI Settings»User Options»Range Check TRUE
Cache niScope»Inherent IVI Settings»User Options»Cache TRUE
Simulate niScope»Inherent IVI Settings»User Options»Simulate FALSE
RecordCoercions niScope»Inherent IVI Settings»User Options»Record Value CoercionsFALSE

Defined Values

TRUE (1)
FALSE (0)

You can use the option string to simulate a device. The DriverSetup flag specifies the model that is to be simulated and the type of the model. One example to simulate an NI PXI-5102 would be as follows:

Option String: Simulate = 1, DriverSetup = Model:5102; BoardType:PXI

Refer to the example niScope EX Simulated Acquisition for more information on simulation.

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.
reset device specifies whether to reset the instrument during the initialization procedure.
Note  For the NI 5112, repeatedly resetting the device may cause excessive wear on the electromechanical relays. Refer to NI 5112 Electromechanical Relays for recommended programming practices.

Default Value: TRUE

error in describes error conditions that occur before this VI runs. The default input of this cluster is no error. If an error already occurred, this VI returns the value of error in in error out. The VI runs normally only if no incoming error exists. Otherwise, the VI passes the error in value to error out. The error in cluster contains the following parameters:
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a negative error code. If status is FALSE, code is 0 or a warning code.
source identifies where an error occurred. The source string includes the name of the VI that produced the error, what inputs are in error, and how to eliminate the error.
instrument handle identifies a particular instrument session.
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source identifies where and why an error occurred. The source string includes the name of the VI that produced the error, what inputs are in error, and how to eliminate the error.