VirtualELoad#
- class VirtualELoad( )[source]#
Bases:
ELoadDriverBaseSingle-channel E-Load simulated in-process: no transport, server, or hardware.
The load sinks from a simulated source: a fixed voltage behind an internal resistance. With the input off the terminals read the open-circuit voltage at 0 A; with it on, the readings are the operating point the active mode and level set on that source, plus noise (0.5%). As on the
BK85XXB,short_outputalso switches the input: a short pulls the terminals to 0 V at the source’s short-circuit current, and ending it turns the input off. Range and slew-rate settings are accepted and have no effect on readings, so anyInstroELoadcall works.Levels the source cannot reach are not errors: CC and CR stop at the short-circuit current, and CP stops at the source’s maximum power (half its open-circuit voltage), where a real load would lose regulation. There are no ratings, protections, or time dynamics.
Create a virtual E-Load.
- Parameters:
Both stay settable as attributes, e.g. to sag the source mid-run, and are validated on every set.
- Raises:
ValueError – If
source_voltageis negative orsource_resistanceis not positive.
Example:
from instro.eload import InstroELoad, LoadMode from instro.eload.drivers import VirtualELoad eload = InstroELoad(name="eload", driver=VirtualELoad(source_voltage=12.0, source_resistance=0.5)) with eload: eload.set_mode(LoadMode.CC) eload.set_level(2.0) eload.output_enable(True) print(eload.get_current().latest) # about 2.0 print(eload.get_voltage().latest) # about 11.0
Attributes
Internal resistance of the simulated source, in ohms.
Open-circuit voltage of the simulated source, in volts.
Methods
Nothing to disconnect.
Measure the current the load is sinking on
channel(amperes).Measure the voltage at
channel's terminals (volts).Nothing to connect to.
Turn the input on or off; a short set by
short_outputstays set.Set
mode's level; each mode keeps its own.Set the operating mode on
channel: CC, CV, CP, or CR.Accepted; no effect on readings.
Accepted; no effect on readings, which settle instantly.
Start or end a short; like the
BK85XXB, this also turns the input on or off.- short_output(enable: bool, channel: int) None[source]#
Start or end a short; like the
BK85XXB, this also turns the input on or off.The short stays set until
short_output(False): turning the input off and on again withoutput_enableleaves it shorted, asINPutalone leavesINPut:SHORton the BK85XXB.
- set_mode( ) None[source]#
Set the operating mode on
channel: CC, CV, CP, or CR.Not every model supports every mode; drivers should raise
NotImplementedErrorfor unsupported combinations.
- set_level( ) None[source]#
Set
mode’s level; each mode keeps its own.curr_limitcaps the current in CV mode.
- set_slewrate(
- direction: SlewRateDirection,
- rate: float,
- channel: int,
Accepted; no effect on readings, which settle instantly.
- output_enable(enable: bool, channel: int) None[source]#
Turn the input on or off; a short set by
short_outputstays set.