Main Content

Measure AC Voltage on Keysight 34460A Digital Multimeter Using IVI-C Driver

This example shows how to initialize the Ag3446x IVI-C driver, read a few properties of the driver, measure AC voltage using Keysight® Technologies 34460A digital multimeter, and output the result in MATLAB®.

Requirements

To run this example, you must have the following installed on your computer:

  • Keysight IO libraries version 2021 or newer

  • Keysight 3446x Digital Multimeters IVI and MATLAB Instrument Drivers version 1.1.5.0

View Installed IVI-C Drivers

View a list of the IVI-C drivers and associated MATLAB drivers that are installed on your computer using ividriverlist.

list = ividriverlist
list=16×4 table
             VendorDriver          MATLABDriver            IVIClass                                                                                                                                                                                                                                                                                                                                                        SupportedModels                                                                                                                                                                                                                                                                                                                                                
          __________________    __________________    __________________    ______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

    1     "Ag3446x"             "Ag3446x"             "IVIDmm"              {["34460A"    "34461A"    "34465A"    "34470A"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ]}
    2     "AgAC6800"            "AgAC6800"            "IVIACPwr"            {["AC6801A"    "AC6801B"    "AC6802A"    "AC6802B"    "AC6803A"    "AC6803B"    "AC6804A"    "AC6804B"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ]}
    3     "IviACPwr"            "IviACPwr"            "IVIACPwr"            {[""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]}
    4     "IviCounter"          "IviCounter"          "IVICounter"          {[""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]}
    5     "IviDCPwr"            "IviDCPwr"            "IVIDCPwr"            {[""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]}
    6     "IviDigitizer"        "IviDigitizer"        "IVIDigitizer"        {[""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]}
    7     "IviDmm"              "IviDmm"              "IVIDmm"              {[""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]}
    8     "IviDownconverter"    "IviDownconverter"    "IVIDownconverter"    {[""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]}
    9     "IviFgen"             "IviFgen"             "IVIFgen"             {[""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]}
    10    "IviPwrMeter"         "IviPwrMeter"         "IVIPwrMeter"         {[""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]}
    11    "IviRfSigGen"         "IviRfSigGen"         "IVIRfSigGen"         {[""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]}
    12    "IviScope"            "IviScope"            "IVIScope"            {[""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]}
    13    "IviSpecAn"           "IviSpecAn"           "IVISpecAn"           {[""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]}
    14    "IviSwtch"            "IviSwtch"            "IVISwtch"            {[""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]}
    15    "IviUpconverter"      "IviUpconverter"      "IVIUpconverter"      {[""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]}
    16    "NIFGEN"              "NIFGEN"              "IVIFgen"             {["NI PCI-5401"    "NI PCI-5402"    "NI PCI-5406"    "NI PCI-5411"    "NI PCI-5412"    "NI PCI-5421"    "NI PCI-5431"    "NI PXI-5401"    "NI PXI-5402"    "NI PXI-5404"    "NI PXI-5406"    "NI PXI-5411"    "NI PXI-5412"    "NI PXI-5421"    "NI PXI-5422"    "NI PXI-5431"    "NI PXI-5441"    "NI PXIe-5413 (1CH)"    "NI PXIe-5413 (2CH)"    "NI PXIe-5423 (1CH)"    "NI PXIe-5423 (2CH)"    "NI PXIe-5433 (1CH)"    "NI PXIe-5433 (2CH)"    "NI PXIe-5442"    "NI PXIe-5450"    "NI PXIe-5451"    "PCI_5402"    "PCI_5406"    "PCI_5412"    "PCI_5421"    "PXI_5402"    "PXI_5404"    "PXI_5406"    "PXI_5412"    "PXI_5421"    "PXI_5422"    "PXI_5441"    "PXIe_5442"    "PXIe_5450"    "PXIe_5451"]}

Connect to Instrument

Connect to a simulated Keysight 34460A Digital Multimeter using ividev with the instrument's MATLAB driver name and resource name. This example uses the Ag3446x driver's simulation mode to run without physically connecting any hardware. Since simulation mode is enabled, the resource name can be specified as empty.

dev = ividev("Ag3446x","",Simulate=true)
dev = 
  Ag3446x with properties:

                          Model: "34460A" 
                   Manufacturer: "Agilent Technologies" 
                   SerialNumber: "" 
                   ResourceName: "" 
                   VendorDriver: "Ag3446x" 
                       Simulate: 1 

          InherentIVIAttributes: [1x1 InherentIVIAttributes] 
                 ACMeasurements: [1x1 ACMeasurements] 
                 BasicOperation: [1x1 BasicOperation] 
       ConfigurationInformation: [1x1 ConfigurationInformation] 
          FrequencyMeasurements: [1x1 FrequencyMeasurements] 
             InstrumentSpecific: [1x1 InstrumentSpecific] 
    MeasurementOperationOptions: [1x1 MeasurementOperationOptions] 
          MultiPointAcquisition: [1x1 MultiPointAcquisition] 
        TemperatureMeasurements: [1x1 TemperatureMeasurements] 
                        Trigger: [1x1 Trigger] 

Show all functions

Get General Device Properties

Query information about the driver and its attributes. You can explore properties and sub-properties of the object by clicking on the property links from the object output display.

dev.InherentIVIAttributes
ans = 
  InherentIVIAttributes with properties:

    AdvancedSessionInformation: [1x1 AdvancedSessionInformation] 
            DriverCapabilities: [1x1 DriverCapabilities] 
          DriverIdentification: [1x1 DriverIdentification] 
      InstrumentIdentification: [1x1 InstrumentIdentification] 
                   UserOptions: [1x1 UserOptions] 

dev.InherentIVIAttributes.DriverIdentification
ans = 
  DriverIdentification with properties:

    SpecificDriverClassSpecMajorVersion: 4 
    SpecificDriverClassSpecMinorVersion: 2 
              SpecificDriverDescription: "IVI driver for the Agilent 3446x family of DMM [Compiled for 64-bit.]" 
                   SpecificDriverPrefix: "Ag3446x" 
                 SpecificDriverRevision: "1.1.5.0" 
                   SpecificDriverVendor: "Agilent Technologies" 

Configure AC Voltage Measurement

Configure the AC Voltage measurement properties such as the range and resolution.

AutoRange = -1;
Resolution = 0.001;
configureMeasurement(dev,"AC_VOLTS",AutoRange,Resolution);

Configure Multipoint Acquisition

Configure multipoint trigger count, sample count, sample trigger, and sample interval properties.

TriggerCount = 1;
SampleCount = 10;
SampleInterval = 0.0001;
configureMultiPoint(dev,TriggerCount,SampleCount,"IMMEDIATE",SampleInterval);

Initiate Low Level Measurement and Fetch Data

Initiate measurement.

initiate(dev);

Return an array of values from the measurement using the fetchMultiPoint function.

maxTimeMillisec = 5000;
arraySize = 10;
[readingArray,actualPoints] = fetchMultiPoint(dev,maxTimeMillisec,arraySize);

Visualize Data

Display the fetched data. The measured output values are all 0 because this example is running with simulated hardware.

fprintf('Measuring AC Volts\nMeasured Data: %s',num2str(readingArray))
Measuring AC Volts
Measured Data: 0  0  0  0  0  0  0  0  0  0

Display Any Errors

If there are any errors, query the driver to retrieve and display them.

errorNum = 1;
while (errorNum ~= 0)
    [errorNum,errorMsg] = error_query(dev);
    fprintf('ErrorQuery: %d, %s\n',errorNum,errorMsg);
end
ErrorQuery: 0, No error.

Clean Up

Disconnect and clear the ividev object from the workspace.

clear dev

See Also

| |

Related Topics