public class HP34401A extends Equipment implements CurrentReadable, VoltageReadable
Most users will be happy with the default voltage measurement parameters.
Some users may wish to use setVoltageRange(java.lang.String)
and setVoltageResolution(java.lang.String)
to obtain better control of the measurement time and
resolution.
Expert users may even wish to control the integration time directly using
setVoltageNPLC(java.lang.String)
. For convenience, and to match the behavior of the
device itself, setVoltageResolution(java.lang.String)
overrides the integration
time set by setVoltageNPLC(java.lang.String)
. To control the two settings
independently, the user must call setVoltageNPLC(java.lang.String)
after
setVoltageResolution(java.lang.String)
.
Eventually the control of the resolution of the current measurement should be the same as the control of the voltage.
Modifier and Type | Field and Description |
---|---|
static float |
MAX_AMPS
Maximum current that the DVM can measure, value: 3 A
|
CONTROLLER_ID_NUMBER
Constructor and Description |
---|
HP34401A(java.lang.String name)
Creates a new instance of HP34401A
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getVoltageNPLC()
Get the requested DC voltage integration time in number of power cycles.
|
java.lang.String |
getVoltageRange()
Get the requested DC voltage measurement range, in Volts or as "
MINimum", "MAXimum", or "DEFault" .
|
java.lang.String |
getVoltageResolution()
Get the requested DC voltage measurement resolution, in Volts.
|
static void |
main(java.lang.String[] args) |
float |
readCurrent()
Measures current using autoranging and default resolution (integration
time of 10 power line cycles--i.e., 1/6 sec)
|
float |
readCurrent(float ampsExpected,
float ampsResolution)
Measures current using range appropriate for
ampsExpected ,
and resolution of ampsResolution . |
float |
readVoltage()
Measure voltage using the measurement parameters specified by the methods
setVoltageRange(java.lang.String) , setVoltageResolution(java.lang.String) , and
setVoltageNPLC(java.lang.String) . |
float |
readVoltageNPLC()
Queries the HP34401A device to obtain the DC voltage integration time in
number of power cycles.
|
float |
readVoltageRange()
Queries the HP34401A device to obtain the DC voltage measurement range.
|
float |
readVoltageResolution()
Queries the HP34401A device to obtain the DC voltage measurement
resolution.
|
void |
setVoltageNPLC(java.lang.String voltageNPLC)
Set the number of power line cycles to integrate the DC voltage
measurement over.
|
void |
setVoltageRange(java.lang.String voltageRange)
Set the DC voltage measurement range, in Volts.
|
void |
setVoltageResolution(java.lang.String voltageResolution)
Set the DC voltage measurement resolution, in Volts.
|
ask, clear, command, getName, interactive, isDisabled, read, readFloat, readLine, toString, write
isLogInits, isLogOthers, isLogSets, logInit, logOther, logSet, setAllLogging, setLogInits, setLogOthers, setLogSets
public static final float MAX_AMPS
public HP34401A(java.lang.String name)
public void setVoltageRange(java.lang.String voltageRange)
readVoltage()
.voltageRange
- The the DC voltage measurement range to set, in Volts.public java.lang.String getVoltageRange()
public float readVoltageRange()
public void setVoltageResolution(java.lang.String voltageResolution)
readVoltage()
.
Use MAXimum for fast but low-accuracy measurements. For
convenience, sets integration time setVoltageNPLC(java.lang.String)
to
DEFault so that device chooses integration time appropriate
for the requested resolution.
voltageResolution
- The DC voltage measurement resolution to set.public java.lang.String getVoltageResolution()
public float readVoltageResolution()
public void setVoltageNPLC(java.lang.String voltageNPLC)
readVoltage()
.
The DEFault value causes the device to select an integration
time appropriate for the selected range and resolution, and is the best
value for most applications. Value is overridden by calls to
setVoltageResolution(java.lang.String)
. Change takes effect in next call to
readVoltage()
.
voltageNPLC
- The requested DC voltage integration time in number of power
cyclespublic java.lang.String getVoltageNPLC()
public float readVoltageNPLC()
public float readVoltage()
setVoltageRange(java.lang.String)
, setVoltageResolution(java.lang.String)
, and
setVoltageNPLC(java.lang.String)
. For fast but less accurate measurements, call
setVoltageResolution(java.lang.String)
with parameter "MAX"
first.readVoltage
in interface VoltageReadable
public float readCurrent()
readCurrent
in interface CurrentReadable
public float readCurrent(float ampsExpected, float ampsResolution)
ampsExpected
,
and resolution of ampsResolution
.readCurrent
in interface CurrentReadable
ampsExpected
- expected value of current in amps, for range settingampsResolution
- desired resolution for measurement, in ampspublic static void main(java.lang.String[] args)