mirror of
https://github.com/njchorda/Agilent-34405A-MATLAB-Library.git
synced 2026-02-25 01:10:45 -05:00
Added documentation for Agilent34405A MATLAB Instrument Driver, including requirements, installation instructions, usage examples, supported measurement modes, configuration utilities, properties, and notes.
3.3 KiB
3.3 KiB
Agilent34405A — MATLAB Instrument Driver
A MATLAB class for controlling the Agilent 34405A bench multimeter over USB/VISA. Provides a clean, object-oriented interface for all major measurement modes, configuration, and instrument lifecycle management.
Requirements
- MATLAB with the Instrument Control Toolbox
- NI-VISA driver installed
Agilent34405AStatesenumeration class (companion file)
Installation
- Clone or download this repository.
- Add the folder to your MATLAB path:
addpath('/path/to/Agilent34405A'); - Ensure the multimeter is connected via USB and recognized by NI-VISA.
Quick Start
% Instantiate — automatically finds the instrument via USB
dmm = Agilent34405A();
% Read DC voltage
v = dmm.readDCV();
% Read AC current
i = dmm.readACI();
% Read temperature
t = dmm.readTemp();
% Clean up when done
dmm.deInit();
Supported Measurement Modes
| Method | Description |
|---|---|
readDCV() |
DC Voltage |
readACV() |
AC Voltage |
readDCI() |
DC Current |
readACI() |
AC Current |
readTemp() |
Temperature |
read2WRes() |
2-Wire Resistance |
readCont() |
Continuity |
readDiode() |
Diode Test |
readCapacitance() |
Capacitance |
readFrequency() |
Frequency |
readPeriod() |
Period |
scan() |
Scan mode |
All measurement methods automatically switch the instrument to the correct mode if it isn't already configured.
Configuration & Utilities
Set Measurement Scale
% obj.setScale(state_string, [resolution, range])
dmm.setScale('VOLT:DC', [0.001, 10]);
Trigger & Sample Settings
dmm.sampleCount = 20; % Number of samples (default: 10)
dmm.triggerCount = 4; % Trigger count (default: 1)
dmm.setSampleCount(); % Apply sample count to instrument
dmm.setTriggerCount(); % Apply trigger count to instrument
dmm.setTriggerSource('BUS'); % Set trigger source
Send Arbitrary SCPI Command
% Automatically reads response if command contains '?'
response = dmm.sendCommand('VOLT:DC:RANG?');
dmm.sendCommand('DISP:TEXT "Hello"');
Other Utilities
dmm.getConfig() % Query current instrument configuration
dmm.selfTest() % Run built-in self-test and print result
dmm.reset() % Send *RST to instrument
dmm.setBeep(true) % Enable/disable beeper
dmm.setLocal() % Return front-panel control to user
dmm.approxTime(state) % Benchmark acquisition time for a given state
dmm.deInit() % Cleanly close and release the VISA connection
Properties
| Property | Default | Description |
|---|---|---|
visaAddress |
(auto-detected) | USB/VISA address of the instrument |
state |
DCV |
Current measurement mode |
numSamples |
512 |
Internal sample buffer size |
sampleCount |
10 |
Samples per trigger sent to instrument |
triggerCount |
8 |
Number of triggers |
Notes
- The constructor automatically detects the instrument address using
instrhwinfo('visa','ni')— no manual address configuration needed. - The beeper is silenced on startup by default.
deInit()should always be called when finished to cleanly release the VISA resource.
License
MIT License — see LICENSE for details.