niDMM_init

NI-DMM C/CVI/VB

niDMM_init

ViStatus = niDMM_init(ViString Resource_Name, ViBoolean ID_Query, ViBoolean Reset_Device, ViSession* Instrument_Handle)

Purpose

This function completes the following tasks:

  • Creates a new IVI instrument driver session.
  • Opens a session to the device you specify for the Resource_Name parameter.
  • If the ID_Query parameter is set to VI_TRUE (1), this function queries the instrument ID and checks that it is valid for this instrument driver.
  • If the Reset_Device parameter is set to VI_TRUE (1), this function 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 a ViSession handle that you use to identify the instrument in all subsequent instrument driver function calls.

Parameters

Input
Name Type Description
Resource_Name ViString Contains the Resource_Name of the device to initialize. The Resource_Name is assigned in Measurement & Automation Explorer (MAX). Refer to Related Documentation for the NI Digital Multimeters Getting Started Guide for more information about configuring and testing the DMM in MAX.

Valid Syntax:

  • NI-DAQmx name
  • DAQ::NI-DAQmx name[::INSTR]
  • DAQ::Traditional NI-DAQ device number[::INSTR]
  • IVI logical name
Caution  All IVI names for the Resource_Name, 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.
ID_Query ViBoolean Verifies that the device you initialize is one that the driver supports. NI-DMM automatically performs this query, so setting this parameter is not necessary.

Defined Values:

VI_TRUE (default) 1 Perform ID Query
VI_FALSE 0 Skip ID Query
Reset_Device ViBoolean Specifies whether to reset the instrument during the initialization procedure.

Defined Values:

VI_TRUE (default) 1 Reset Device
VI_FALSE 0 Don't Reset
Output
Name Type Description
Instrument_Handle ViSession* Returns a ViSession handle that you use to identify the instrument in all subsequent instrument driver function calls.

Return Value

Name Type Description
Status ViStatus Reports the Status of this operation. To obtain a text description of the status code, call niDMM_error_message. To obtain additional information concerning the error condition, use niDMM_GetError.