public class YPowerSupply extends YFunction
| Modifier and Type | Class and Description |
|---|---|
static interface |
YPowerSupply.TimedReportCallback
TimedReportCallback for PowerSupply
|
static interface |
YPowerSupply.UpdateCallback
Deprecated UpdateCallback for PowerSupply
|
| Modifier and Type | Field and Description |
|---|---|
protected String |
_command |
protected double |
_currentLimit |
protected double |
_currentLimitAtStartUp |
protected double |
_inputVoltage |
protected double |
_measuredCurrent |
protected double |
_measuredVoltage |
protected int |
_powerOutput |
protected int |
_powerOutputAtStartUp |
protected YPowerSupply.UpdateCallback |
_valueCallbackPowerSupply |
protected double |
_voltageLimit |
protected double |
_voltageLimitAtStartUp |
protected String |
_voltageTransition |
static String |
COMMAND_INVALID
invalid command value
|
static double |
CURRENTLIMIT_INVALID
invalid currentLimit value
|
static double |
CURRENTLIMITATSTARTUP_INVALID
invalid currentLimitAtStartUp value
|
static double |
INPUTVOLTAGE_INVALID
invalid inputVoltage value
|
static double |
MEASUREDCURRENT_INVALID
invalid measuredCurrent value
|
static double |
MEASUREDVOLTAGE_INVALID
invalid measuredVoltage value
|
static int |
POWEROUTPUT_INVALID |
static int |
POWEROUTPUT_OFF
invalid powerOutput value
|
static int |
POWEROUTPUT_ON |
static int |
POWEROUTPUTATSTARTUP_INVALID |
static int |
POWEROUTPUTATSTARTUP_OFF
invalid powerOutputAtStartUp value
|
static int |
POWEROUTPUTATSTARTUP_ON |
static double |
VOLTAGELIMIT_INVALID
invalid voltageLimit value
|
static double |
VOLTAGELIMITATSTARTUP_INVALID
invalid voltageLimitAtStartUp value
|
static String |
VOLTAGETRANSITION_INVALID
invalid voltageTransition value
|
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, _yapi, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID| Modifier | Constructor and Description |
|---|---|
protected |
YPowerSupply(String func) |
protected |
YPowerSupply(YAPIContext ctx,
String func) |
| Modifier and Type | Method and Description |
|---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YPowerSupply |
FindPowerSupply(String func)
Retrieves a regulated power supply for a given identifier.
|
static YPowerSupply |
FindPowerSupplyInContext(YAPIContext yctx,
String func)
Retrieves a regulated power supply for a given identifier in a YAPI context.
|
static YPowerSupply |
FirstPowerSupply()
Starts the enumeration of regulated power supplies currently accessible.
|
static YPowerSupply |
FirstPowerSupplyInContext(YAPIContext yctx)
Starts the enumeration of regulated power supplies currently accessible.
|
String |
get_command() |
double |
get_currentLimit()
Returns the current limit, in mA.
|
double |
get_currentLimitAtStartUp()
Returns the selected current limit at device startup, in mA.
|
double |
get_inputVoltage()
Returns the measured input voltage, in V.
|
double |
get_measuredCurrent()
Returns the measured output current, in mA.
|
double |
get_measuredVoltage()
Returns the measured output voltage, in V.
|
int |
get_powerOutput()
Returns the power supply output switch state.
|
int |
get_powerOutputAtStartUp()
Returns the power supply output switch state.
|
double |
get_voltageLimit()
Returns the voltage limit, in V.
|
double |
get_voltageLimitAtStartUp()
Returns the selected voltage limit at device startup, in V.
|
String |
get_voltageTransition() |
double |
getCurrentLimit()
Returns the current limit, in mA.
|
double |
getCurrentLimitAtStartUp()
Returns the selected current limit at device startup, in mA.
|
double |
getInputVoltage()
Returns the measured input voltage, in V.
|
double |
getMeasuredCurrent()
Returns the measured output current, in mA.
|
double |
getMeasuredVoltage()
Returns the measured output voltage, in V.
|
int |
getPowerOutput()
Returns the power supply output switch state.
|
int |
getPowerOutputAtStartUp()
Returns the power supply output switch state.
|
double |
getVoltageLimit()
Returns the voltage limit, in V.
|
double |
getVoltageLimitAtStartUp()
Returns the selected voltage limit at device startup, in V.
|
YPowerSupply |
nextPowerSupply()
Continues the enumeration of regulated power supplies started using yFirstPowerSupply().
|
int |
registerValueCallback(YPowerSupply.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_command(String newval) |
int |
set_currentLimit(double newval)
Changes the current limit, in mA.
|
int |
set_currentLimitAtStartUp(double newval)
Changes the current limit at device start up.
|
int |
set_powerOutput(int newval)
Changes the power supply output switch state.
|
int |
set_powerOutputAtStartUp(int newval)
Changes the power supply output switch state at device start up.
|
int |
set_voltageLimit(double newval)
Changes the voltage limit, in V.
|
int |
set_voltageLimitAtStartUp(double newval)
Changes the voltage set point at device start up.
|
int |
set_voltageTransition(String newval) |
int |
setCurrentLimit(double newval)
Changes the current limit, in mA.
|
int |
setCurrentLimitAtStartUp(double newval)
Changes the current limit at device start up.
|
int |
setPowerOutput(int newval)
Changes the power supply output switch state.
|
int |
setPowerOutputAtStartUp(int newval)
Changes the power supply output switch state at device start up.
|
int |
setVoltageLimit(double newval)
Changes the voltage limit, in V.
|
int |
setVoltageLimitAtStartUp(double newval)
Changes the voltage set point at device start up.
|
int |
voltageMove(double V_target,
int ms_duration)
Performs a smooth transition of output voltage.
|
_AddToCache, _clearDataStreamCache, _decode_json_int, _decode_json_string, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _is_valid_pass, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, _uploadEx, clearCache, describe, errMessage, errorMessage, errorType, errType, FindFunction, FindFunctionInContext, FirstFunction, FirstFunctionInContext, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_serialNumber, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, isReadOnly, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userDatapublic static final double VOLTAGELIMIT_INVALID
public static final double CURRENTLIMIT_INVALID
public static final int POWEROUTPUT_OFF
public static final int POWEROUTPUT_ON
public static final int POWEROUTPUT_INVALID
public static final double MEASUREDVOLTAGE_INVALID
public static final double MEASUREDCURRENT_INVALID
public static final double INPUTVOLTAGE_INVALID
public static final String VOLTAGETRANSITION_INVALID
public static final double VOLTAGELIMITATSTARTUP_INVALID
public static final double CURRENTLIMITATSTARTUP_INVALID
public static final int POWEROUTPUTATSTARTUP_OFF
public static final int POWEROUTPUTATSTARTUP_ON
public static final int POWEROUTPUTATSTARTUP_INVALID
public static final String COMMAND_INVALID
protected double _voltageLimit
protected double _currentLimit
protected int _powerOutput
protected double _measuredVoltage
protected double _measuredCurrent
protected double _inputVoltage
protected String _voltageTransition
protected double _voltageLimitAtStartUp
protected double _currentLimitAtStartUp
protected int _powerOutputAtStartUp
protected String _command
protected YPowerSupply.UpdateCallback _valueCallbackPowerSupply
protected YPowerSupply(YAPIContext ctx, String func)
func - : functionidprotected YPowerSupply(String func)
func - : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val)
throws Exception
_parseAttr in class YFunctionExceptionpublic int set_voltageLimit(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the voltage limit, in VYAPI_Exception - on errorpublic int setVoltageLimit(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the voltage limit, in VYAPI_Exception - on errorpublic double get_voltageLimit()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getVoltageLimit()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_currentLimit(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the current limit, in mAYAPI_Exception - on errorpublic int setCurrentLimit(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the current limit, in mAYAPI_Exception - on errorpublic double get_currentLimit()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getCurrentLimit()
throws YAPI_Exception
YAPI_Exception - on errorpublic int get_powerOutput()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getPowerOutput()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_powerOutput(int newval)
throws YAPI_Exception
newval - : either YPowerSupply.POWEROUTPUT_OFF or YPowerSupply.POWEROUTPUT_ON, according to
the power supply output switch stateYAPI_Exception - on errorpublic int setPowerOutput(int newval)
throws YAPI_Exception
newval - : either YPowerSupply.POWEROUTPUT_OFF or YPowerSupply.POWEROUTPUT_ON, according to
the power supply output switch stateYAPI_Exception - on errorpublic double get_measuredVoltage()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getMeasuredVoltage()
throws YAPI_Exception
YAPI_Exception - on errorpublic double get_measuredCurrent()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getMeasuredCurrent()
throws YAPI_Exception
YAPI_Exception - on errorpublic double get_inputVoltage()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getInputVoltage()
throws YAPI_Exception
YAPI_Exception - on errorpublic String get_voltageTransition() throws YAPI_Exception
YAPI_Exceptionpublic int set_voltageTransition(String newval) throws YAPI_Exception
YAPI_Exceptionpublic int set_voltageLimitAtStartUp(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the voltage set point at device start upYAPI_Exception - on errorpublic int setVoltageLimitAtStartUp(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the voltage set point at device start upYAPI_Exception - on errorpublic double get_voltageLimitAtStartUp()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getVoltageLimitAtStartUp()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_currentLimitAtStartUp(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the current limit at device start upYAPI_Exception - on errorpublic int setCurrentLimitAtStartUp(double newval)
throws YAPI_Exception
newval - : a floating point number corresponding to the current limit at device start upYAPI_Exception - on errorpublic double get_currentLimitAtStartUp()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getCurrentLimitAtStartUp()
throws YAPI_Exception
YAPI_Exception - on errorpublic int get_powerOutputAtStartUp()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getPowerOutputAtStartUp()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_powerOutputAtStartUp(int newval)
throws YAPI_Exception
newval - : either YPowerSupply.POWEROUTPUTATSTARTUP_OFF or
YPowerSupply.POWEROUTPUTATSTARTUP_ON, according to the power supply output switch state at device start upYAPI_Exception - on errorpublic int setPowerOutputAtStartUp(int newval)
throws YAPI_Exception
newval - : either YPowerSupply.POWEROUTPUTATSTARTUP_OFF or
YPowerSupply.POWEROUTPUTATSTARTUP_ON, according to the power supply output switch state at device start upYAPI_Exception - on errorpublic String get_command() throws YAPI_Exception
YAPI_Exceptionpublic int set_command(String newval) throws YAPI_Exception
YAPI_Exceptionpublic static YPowerSupply FindPowerSupply(String func)
func - : a string that uniquely characterizes the regulated power supply, for instance
MyDevice.powerSupply.public static YPowerSupply FindPowerSupplyInContext(YAPIContext yctx, String func)
yctx - : a YAPI contextfunc - : a string that uniquely characterizes the regulated power supply, for instance
MyDevice.powerSupply.public int registerValueCallback(YPowerSupply.UpdateCallback callback)
callback - : the callback function to call, or a null pointer. The callback function should take two
arguments: the function object of which the value has changed, and the character string describing
the new advertised value.public int _invokeValueCallback(String value)
_invokeValueCallback in class YFunctionpublic int voltageMove(double V_target,
int ms_duration)
throws YAPI_Exception
V_target - : new output voltage value at the end of the transition
(floating-point number, representing the end voltage in V)ms_duration - : total duration of the transition, in millisecondsYAPI_Exceptionpublic YPowerSupply nextPowerSupply()
public static YPowerSupply FirstPowerSupply()
public static YPowerSupply FirstPowerSupplyInContext(YAPIContext yctx)
yctx - : a YAPI context.Copyright © 2026. All rights reserved.