public class YWeighScale extends YSensor
Modifier and Type | Class and Description |
---|---|
static interface |
YWeighScale.TimedReportCallback
TimedReportCallback for WeighScale
|
static interface |
YWeighScale.UpdateCallback
Deprecated UpdateCallback for WeighScale
|
Modifier and Type | Field and Description |
---|---|
protected double |
_adaptRatio |
protected String |
_command |
protected double |
_compensation |
protected double |
_compTemperature |
protected int |
_excitation |
protected YWeighScale.TimedReportCallback |
_timedReportCallbackWeighScale |
protected YWeighScale.UpdateCallback |
_valueCallbackWeighScale |
protected double |
_zeroTracking |
static double |
ADAPTRATIO_INVALID
invalid adaptRatio value
|
static String |
COMMAND_INVALID
invalid command value
|
static double |
COMPENSATION_INVALID
invalid compensation value
|
static double |
COMPTEMPERATURE_INVALID
invalid compTemperature value
|
static int |
EXCITATION_AC |
static int |
EXCITATION_DC |
static int |
EXCITATION_INVALID |
static int |
EXCITATION_OFF
invalid excitation value
|
static double |
ZEROTRACKING_INVALID
invalid zeroTracking value
|
_calhdl, _calibrationParam, _calpar, _calraw, _calref, _caltyp, _currentRawValue, _currentValue, _decexp, _highestValue, _iresol, _isScal, _isScal32, _logFrequency, _lowestValue, _offset, _prevTimedReport, _reportFrequency, _resolution, _scale, _sensorState, _timedReportCallbackSensor, _unit, _valueCallbackSensor, CALIBRATIONPARAM_INVALID, CURRENTRAWVALUE_INVALID, CURRENTVALUE_INVALID, HIGHESTVALUE_INVALID, LOGFREQUENCY_INVALID, LOWESTVALUE_INVALID, REPORTFREQUENCY_INVALID, RESOLUTION_INVALID, SENSORSTATE_INVALID, UNIT_INVALID
_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 |
YWeighScale(String func) |
protected |
YWeighScale(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeTimedReportCallback(YMeasure value) |
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YWeighScale |
FindWeighScale(String func)
Retrieves a weighing scale sensor for a given identifier.
|
static YWeighScale |
FindWeighScaleInContext(YAPIContext yctx,
String func)
Retrieves a weighing scale sensor for a given identifier in a YAPI context.
|
static YWeighScale |
FirstWeighScale()
Starts the enumeration of weighing scale sensors currently accessible.
|
static YWeighScale |
FirstWeighScaleInContext(YAPIContext yctx)
Starts the enumeration of weighing scale sensors currently accessible.
|
double |
get_adaptRatio()
Returns the compensation temperature update rate, in percents.
|
String |
get_command() |
double |
get_compensation()
Returns the current current thermal compensation value.
|
double |
get_compTemperature()
Returns the current compensation temperature.
|
int |
get_excitation()
Returns the current load cell bridge excitation method.
|
double |
get_zeroTracking()
Returns the zero tracking threshold value.
|
double |
getAdaptRatio()
Returns the compensation temperature update rate, in percents.
|
double |
getCompensation()
Returns the current current thermal compensation value.
|
double |
getCompTemperature()
Returns the current compensation temperature.
|
int |
getExcitation()
Returns the current load cell bridge excitation method.
|
double |
getZeroTracking()
Returns the zero tracking threshold value.
|
int |
loadOffsetCompensationTable(ArrayList<Double> tempValues,
ArrayList<Double> compValues)
Retrieves the weight offset thermal compensation table previously configured using the
set_offsetCompensationTable function.
|
int |
loadSpanCompensationTable(ArrayList<Double> tempValues,
ArrayList<Double> compValues)
Retrieves the weight span thermal compensation table previously configured using the
set_spanCompensationTable function.
|
YWeighScale |
nextWeighScale()
Continues the enumeration of weighing scale sensors started using yFirstWeighScale().
|
int |
registerTimedReportCallback(YWeighScale.TimedReportCallback callback)
Registers the callback function that is invoked on every periodic timed notification.
|
int |
registerValueCallback(YWeighScale.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_adaptRatio(double newval)
Changes the compensation temperature update rate, in percents.
|
int |
set_command(String newval) |
int |
set_excitation(int newval)
Changes the current load cell bridge excitation method.
|
int |
set_offsetCompensationTable(ArrayList<Double> tempValues,
ArrayList<Double> compValues)
Records a weight offset thermal compensation table, in order to automatically correct the
measured weight based on the compensation temperature.
|
int |
set_spanCompensationTable(ArrayList<Double> tempValues,
ArrayList<Double> compValues)
Records a weight span thermal compensation table, in order to automatically correct the
measured weight based on the compensation temperature.
|
int |
set_zeroTracking(double newval)
Changes the compensation temperature update rate, in percents.
|
int |
setAdaptRatio(double newval)
Changes the compensation temperature update rate, in percents.
|
int |
setExcitation(int newval)
Changes the current load cell bridge excitation method.
|
int |
setupSpan(double currWeight,
double maxWeight)
Configures the load cell span parameters (stored in the corresponding genericSensor)
so that the current signal corresponds to the specified reference weight.
|
int |
setZeroTracking(double newval)
Changes the compensation temperature update rate, in percents.
|
int |
tare()
Adapts the load cell signal bias (stored in the corresponding genericSensor)
so that the current signal corresponds to a zero weight.
|
_applyCalibration, _decodeAvg, _decodeTimedReport, _decodeVal, _encodeCalibrationPoints, _parserHelper, calibrateFromPoints, FindSensor, FindSensorInContext, FirstSensor, FirstSensorInContext, get_calibrationParam, get_currentRawValue, get_currentValue, get_dataLogger, get_highestValue, get_logFrequency, get_lowestValue, get_recordedData, get_reportFrequency, get_resolution, get_sensorState, get_unit, getCurrentRawValue, getCurrentValue, getHighestValue, getLogFrequency, getLowestValue, getReportFrequency, getResolution, getSensorState, getUnit, isSensorReady, loadCalibrationPoints, nextSensor, registerTimedReportCallback, registerValueCallback, set_calibrationParam, set_highestValue, set_logFrequency, set_lowestValue, set_reportFrequency, set_resolution, setHighestValue, setLogFrequency, setLowestValue, setReportFrequency, setResolution, startDataLogger, stopDataLogger
_AddToCache, _clearDataStreamCache, _devRequest, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _json_get_array, _json_get_key, _json_get_string, _parse, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, 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_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userData
public static final int EXCITATION_OFF
public static final int EXCITATION_DC
public static final int EXCITATION_AC
public static final int EXCITATION_INVALID
public static final double ADAPTRATIO_INVALID
public static final double COMPTEMPERATURE_INVALID
public static final double COMPENSATION_INVALID
public static final double ZEROTRACKING_INVALID
public static final String COMMAND_INVALID
protected int _excitation
protected double _adaptRatio
protected double _compTemperature
protected double _compensation
protected double _zeroTracking
protected String _command
protected YWeighScale.UpdateCallback _valueCallbackWeighScale
protected YWeighScale.TimedReportCallback _timedReportCallbackWeighScale
protected YWeighScale(YAPIContext ctx, String func)
func
- : functionidprotected YWeighScale(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YSensor
Exception
public int get_excitation() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getExcitation() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_excitation(int newval) throws YAPI_Exception
newval
- : a value among YWeighScale.EXCITATION_OFF, YWeighScale.EXCITATION_DC and
YWeighScale.EXCITATION_AC corresponding to the current load cell bridge excitation methodYAPI_Exception
- on errorpublic int setExcitation(int newval) throws YAPI_Exception
newval
- : a value among Y_EXCITATION_OFF, Y_EXCITATION_DC and Y_EXCITATION_AC corresponding
to the current load cell bridge excitation methodYAPI_Exception
- on errorpublic int set_adaptRatio(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the compensation temperature update rate, in percentsYAPI_Exception
- on errorpublic int setAdaptRatio(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the compensation temperature update rate, in percentsYAPI_Exception
- on errorpublic double get_adaptRatio() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getAdaptRatio() throws YAPI_Exception
YAPI_Exception
- on errorpublic double get_compTemperature() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getCompTemperature() throws YAPI_Exception
YAPI_Exception
- on errorpublic double get_compensation() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getCompensation() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_zeroTracking(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the compensation temperature update rate, in percentsYAPI_Exception
- on errorpublic int setZeroTracking(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the compensation temperature update rate, in percentsYAPI_Exception
- on errorpublic double get_zeroTracking() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getZeroTracking() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_command() throws YAPI_Exception
YAPI_Exception
public int set_command(String newval) throws YAPI_Exception
YAPI_Exception
public static YWeighScale FindWeighScale(String func)
func
- : a string that uniquely characterizes the weighing scale sensorpublic static YWeighScale FindWeighScaleInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the weighing scale sensorpublic int registerValueCallback(YWeighScale.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 YSensor
public int registerTimedReportCallback(YWeighScale.TimedReportCallback 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 an YMeasure object describing
the new advertised value.public int _invokeTimedReportCallback(YMeasure value)
_invokeTimedReportCallback
in class YSensor
public int tare() throws YAPI_Exception
YAPI_Exception
- on errorpublic int setupSpan(double currWeight, double maxWeight) throws YAPI_Exception
currWeight
- : reference weight presently on the load cell.maxWeight
- : maximum weight to be expectect on the load cell.YAPI_Exception
- on errorpublic int set_offsetCompensationTable(ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, corresponding to all
temperatures for which an offset correction is specified.compValues
- : array of floating point numbers, corresponding to the offset correction
to apply for each of the temperature included in the first
argument, index by index.YAPI_Exception
- on errorpublic int loadOffsetCompensationTable(ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, that is filled by the function
with all temperatures for which an offset correction is specified.compValues
- : array of floating point numbers, that is filled by the function
with the offset correction applied for each of the temperature
included in the first argument, index by index.YAPI_Exception
- on errorpublic int set_spanCompensationTable(ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, corresponding to all
temperatures for which a span correction is specified.compValues
- : array of floating point numbers, corresponding to the span correction
(in percents) to apply for each of the temperature included in the first
argument, index by index.YAPI_Exception
- on errorpublic int loadSpanCompensationTable(ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, that is filled by the function
with all temperatures for which an span correction is specified.compValues
- : array of floating point numbers, that is filled by the function
with the span correction applied for each of the temperature
included in the first argument, index by index.YAPI_Exception
- on errorpublic YWeighScale nextWeighScale()
public static YWeighScale FirstWeighScale()
public static YWeighScale FirstWeighScaleInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2017. All rights reserved.