Main Content

Set Output Voltage and Make Measurements from Keysight AgE3633A DC Power Supply Using IVI-C Driver

This example shows how to initialize the driver, read a few properties of the driver, set output voltage, enable all outputs and measure the output voltage, disable all outputs and measure the output voltage by using Keysight™ Technologies E3633A DC power supply and output the results in MATLAB®.

Requirements

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

  • Keysight IO libraries version 2021 or newer

  • Keysight E36xx, E36xxx DC Power Supply IVI and MATLAB Instrument Drivers version 1.8.0.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=19×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     "AgE36xx"             "AgE36xx"             "IVIDCPwr"            {["E36102A"    "E36102B"    "E36103A"    "E36103B"    "E36104A"    "E36104B"    "E36105A"    "E36105B"    "E36106A"    "E36106B"    "E36231A"    "E36232A"    "E36233A"    "E36234A"    "E36311A"    "E36312A"    "E36313A"    "E3631A"    "E3632A"    "E3633A"    "E3634A"    "E3640A"    "E3641A"    "E3642A"    "E3643A"    "E3644A"    "E3645A"    "E3646A"    "E3647A"    "E3648A"    "E3649A"    "EDU36311A"]}
    4     "agl453xdni"          "agl453xdni"          "IVIDigitizer"        {["L4532A"    "L4534A"                                                                                                                                                                                                                                                                                                                                                                                            ]}
    5     "IviACPwr"            "IviACPwr"            "IVIACPwr"            {[""                                                                                                                                                                                                                                                                                                                                                                                                              ]}
    6     "IviCounter"          "IviCounter"          "IVICounter"          {[""                                                                                                                                                                                                                                                                                                                                                                                                              ]}
    7     "IviDCPwr"            "IviDCPwr"            "IVIDCPwr"            {[""                                                                                                                                                                                                                                                                                                                                                                                                              ]}
    8     "IviDigitizer"        "IviDigitizer"        "IVIDigitizer"        {[""                                                                                                                                                                                                                                                                                                                                                                                                              ]}
    9     "IviDmm"              "IviDmm"              "IVIDmm"              {[""                                                                                                                                                                                                                                                                                                                                                                                                              ]}
    10    "IviDownconverter"    "IviDownconverter"    "IVIDownconverter"    {[""                                                                                                                                                                                                                                                                                                                                                                                                              ]}
    11    "IviFgen"             "IviFgen"             "IVIFgen"             {[""                                                                                                                                                                                                                                                                                                                                                                                                              ]}
    12    "IviPwrMeter"         "IviPwrMeter"         "IVIPwrMeter"         {[""                                                                                                                                                                                                                                                                                                                                                                                                              ]}
    13    "IviRfSigGen"         "IviRfSigGen"         "IVIRfSigGen"         {[""                                                                                                                                                                                                                                                                                                                                                                                                              ]}
    14    "IviScope"            "IviScope"            "IVIScope"            {[""                                                                                                                                                                                                                                                                                                                                                                                                              ]}
    15    "IviSpecAn"           "IviSpecAn"           "IVISpecAn"           {[""                                                                                                                                                                                                                                                                                                                                                                                                              ]}
    16    "IviSwtch"            "IviSwtch"            "IVISwtch"            {[""                                                                                                                                                                                                                                                                                                                                                                                                              ]}
      ⋮

Connect to Instrument

Connect to a simulated Keysight AgE3633A Power Supply using ividev with the instrument's MATLAB driver name and resource name. This example uses the AgE36xx 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("AgE36xx","",Simulate=true)
dev = 
  AgE36xx with properties:

                    Model: "E3633A" 
             Manufacturer: "Agilent Technologies" 
             SerialNumber: "" 
             ResourceName: "" 
             VendorDriver: "AgE36xx" 
                 Simulate: 1 

           CalibrationIDs: "Calibration1" 
                OutputIDs: "Output1" 
               TriggerIDs: "Trigger1" 

    InherentIVIAttributes: [1x1 InherentIVIAttributes] 
             Calibrations: [1x1 Calibrations] 
              DigitalPort: [1x1 DigitalPort] 
                  Display: [1x1 Display] 
                     DLog: [1x1 DLog] 
                   Output: [1x1 Output] 
                  Outputs: [1x1 Outputs] 
                   Status: [1x1 Status] 
                   System: [1x1 System] 
                  Trigger: [1x1 Trigger] 
                 Triggers: [1x1 Triggers] 

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: 3 
    SpecificDriverClassSpecMinorVersion: 0 
              SpecificDriverDescription: "IVI driver for the Agilent E36xx family of programmable power supplies [Compiled for 64-bit.]" 
                   SpecificDriverPrefix: "AgE36xx" 
                 SpecificDriverRevision: "1.8.0.0" 
                   SpecificDriverVendor: "Agilent Technologies" 

Set Output Voltage

Configure the voltage of Output1 to 1.23 volts using the configureVoltageLevel function.

outputVoltage = 1.23; % Volts
configureVoltageLevel(dev,"Output1",outputVoltage)
fprintf("Output 1 set to: 1.23 Volts \n");
Output 1 set to: 1.23 Volts 

Enable All Outputs and Measure Output Voltage

Set all outputs enable property as true.

dev.Outputs.Enabled = true;
fprintf("All outputs enabled \n");
All outputs enabled 

The measured voltage should be the same as the output voltage set before.

measVol = measure(dev,"Output1","MEASURE_VOLTAGE");
fprintf("Output 1 Measurement = %.4g Volts\n", measVol);
Output 1 Measurement = 1.23 Volts

Disable All Outputs and Measure Output Voltage

Set all outputs enable property as false.

dev.Outputs.Enabled = false;

Since all outputs have been disabled, the measured voltage should be 0.

measVol = measure(dev,"Output1","MEASURE_VOLTAGE");
fprintf("Output 1 Measurement = %.4g Volts\n", measVol);
Output 1 Measurement = 0 Volts

Query and 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