public class YCurrentLoopOutput extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YCurrentLoopOutput.TimedReportCallback
TimedReportCallback for CurrentLoopOutput
|
static interface |
YCurrentLoopOutput.UpdateCallback
Deprecated UpdateCallback for CurrentLoopOutput
|
Modifier and Type | Field and Description |
---|---|
protected double |
_current |
protected double |
_currentAtStartUp |
protected String |
_currentTransition |
protected int |
_loopPower |
protected YCurrentLoopOutput.UpdateCallback |
_valueCallbackCurrentLoopOutput |
static double |
CURRENT_INVALID
invalid current value
|
static double |
CURRENTATSTARTUP_INVALID
invalid currentAtStartUp value
|
static String |
CURRENTTRANSITION_INVALID
invalid currentTransition value
|
static int |
LOOPPOWER_INVALID |
static int |
LOOPPOWER_LOWPWR |
static int |
LOOPPOWER_NOPWR
invalid loopPower value
|
static int |
LOOPPOWER_POWEROK |
_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 |
YCurrentLoopOutput(String func) |
protected |
YCurrentLoopOutput(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
int |
currentMove(double mA_target,
int ms_duration)
Performs a smooth transition of current flowing in the loop.
|
static YCurrentLoopOutput |
FindCurrentLoopOutput(String func)
Retrieves a 4-20mA output for a given identifier.
|
static YCurrentLoopOutput |
FindCurrentLoopOutputInContext(YAPIContext yctx,
String func)
Retrieves a 4-20mA output for a given identifier in a YAPI context.
|
static YCurrentLoopOutput |
FirstCurrentLoopOutput()
Starts the enumeration of 4-20mA outputs currently accessible.
|
static YCurrentLoopOutput |
FirstCurrentLoopOutputInContext(YAPIContext yctx)
Starts the enumeration of 4-20mA outputs currently accessible.
|
double |
get_current()
Returns the loop current set point in mA.
|
double |
get_currentAtStartUp()
Returns the current in the loop at device startup, in mA.
|
String |
get_currentTransition() |
int |
get_loopPower()
Returns the loop powerstate.
|
double |
getCurrent()
Returns the loop current set point in mA.
|
double |
getCurrentAtStartUp()
Returns the current in the loop at device startup, in mA.
|
int |
getLoopPower()
Returns the loop powerstate.
|
YCurrentLoopOutput |
nextCurrentLoopOutput()
Continues the enumeration of 4-20mA outputs started using yFirstCurrentLoopOutput().
|
int |
registerValueCallback(YCurrentLoopOutput.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_current(double newval)
Changes the current loop, the valid range is from 3 to 21mA.
|
int |
set_currentAtStartUp(double newval)
Changes the loop current at device start up.
|
int |
set_currentTransition(String newval) |
int |
setCurrent(double newval)
Changes the current loop, the valid range is from 3 to 21mA.
|
int |
setCurrentAtStartUp(double newval)
Changes the loop current at device start up.
|
_AddToCache, _clearDataStreamCache, _devRequest, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _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, userData
public static final double CURRENT_INVALID
public static final String CURRENTTRANSITION_INVALID
public static final double CURRENTATSTARTUP_INVALID
public static final int LOOPPOWER_NOPWR
public static final int LOOPPOWER_LOWPWR
public static final int LOOPPOWER_POWEROK
public static final int LOOPPOWER_INVALID
protected double _current
protected String _currentTransition
protected double _currentAtStartUp
protected int _loopPower
protected YCurrentLoopOutput.UpdateCallback _valueCallbackCurrentLoopOutput
protected YCurrentLoopOutput(YAPIContext ctx, String func)
func
- : functionidprotected YCurrentLoopOutput(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YFunction
Exception
public int set_current(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the current loop, the valid range is from 3 to 21mAYAPI_Exception
- on errorpublic int setCurrent(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the current loop, the valid range is from 3 to 21mAYAPI_Exception
- on errorpublic double get_current() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getCurrent() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_currentTransition() throws YAPI_Exception
YAPI_Exception
public int set_currentTransition(String newval) throws YAPI_Exception
YAPI_Exception
public int set_currentAtStartUp(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the loop current at device start upYAPI_Exception
- on errorpublic int setCurrentAtStartUp(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the loop current at device start upYAPI_Exception
- on errorpublic double get_currentAtStartUp() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getCurrentAtStartUp() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_loopPower() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getLoopPower() throws YAPI_Exception
YAPI_Exception
- on errorpublic static YCurrentLoopOutput FindCurrentLoopOutput(String func)
func
- : a string that uniquely characterizes the 4-20mA outputpublic static YCurrentLoopOutput FindCurrentLoopOutputInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the 4-20mA outputpublic int registerValueCallback(YCurrentLoopOutput.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 YFunction
public int currentMove(double mA_target, int ms_duration) throws YAPI_Exception
mA_target
- : new current value at the end of the transition
(floating-point number, representing the end current in mA)ms_duration
- : total duration of the transition, in millisecondsYAPI_Exception
public YCurrentLoopOutput nextCurrentLoopOutput()
public static YCurrentLoopOutput FirstCurrentLoopOutput()
public static YCurrentLoopOutput FirstCurrentLoopOutputInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2019. All rights reserved.