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 String |
_command |
protected double |
_compensation |
protected double |
_compTempAvg |
protected double |
_compTempChg |
protected int |
_excitation |
protected double |
_tempAvgAdaptRatio |
protected double |
_tempChgAdaptRatio |
protected YWeighScale.TimedReportCallback |
_timedReportCallbackWeighScale |
protected YWeighScale.UpdateCallback |
_valueCallbackWeighScale |
protected double |
_zeroTracking |
static String |
COMMAND_INVALID
invalid command value
|
static double |
COMPENSATION_INVALID
invalid compensation value
|
static double |
COMPTEMPAVG_INVALID
invalid compTempAvg value
|
static double |
COMPTEMPCHG_INVALID
invalid compTempChg value
|
static int |
EXCITATION_AC |
static int |
EXCITATION_DC |
static int |
EXCITATION_INVALID |
static int |
EXCITATION_OFF
invalid excitation value
|
static double |
TEMPAVGADAPTRATIO_INVALID
invalid tempAvgAdaptRatio value
|
static double |
TEMPCHGADAPTRATIO_INVALID
invalid tempChgAdaptRatio value
|
static double |
ZEROTRACKING_INVALID
invalid zeroTracking value
|
_advMode, _calhdl, _calibrationParam, _calpar, _calraw, _calref, _caltyp, _currentRawValue, _currentValue, _decexp, _highestValue, _iresol, _logFrequency, _lowestValue, _offset, _prevTimedReport, _reportFrequency, _resolution, _scale, _sensorState, _timedReportCallbackSensor, _unit, _valueCallbackSensor, ADVMODE_IMMEDIATE, ADVMODE_INVALID, ADVMODE_PERIOD_AVG, ADVMODE_PERIOD_MAX, ADVMODE_PERIOD_MIN, 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.
|
String |
get_command() |
double |
get_compensation()
Returns the current current thermal compensation value.
|
double |
get_compTempAvg()
Returns the current averaged temperature, used for thermal compensation.
|
double |
get_compTempChg()
Returns the current temperature variation, used for thermal compensation.
|
int |
get_excitation()
Returns the current load cell bridge excitation method.
|
double |
get_tempAvgAdaptRatio()
Returns the averaged temperature update rate, in per mille.
|
double |
get_tempChgAdaptRatio()
Returns the temperature change update rate, in per mille.
|
double |
get_zeroTracking()
Returns the zero tracking threshold value.
|
double |
getCompensation()
Returns the current current thermal compensation value.
|
double |
getCompTempAvg()
Returns the current averaged temperature, used for thermal compensation.
|
double |
getCompTempChg()
Returns the current temperature variation, used for thermal compensation.
|
int |
getExcitation()
Returns the current load cell bridge excitation method.
|
double |
getTempAvgAdaptRatio()
Returns the averaged temperature update rate, in per mille.
|
double |
getTempChgAdaptRatio()
Returns the temperature change update rate, in per mille.
|
double |
getZeroTracking()
Returns the zero tracking threshold value.
|
int |
loadCompensationTable(int tableIndex,
ArrayList<Double> tempValues,
ArrayList<Double> compValues) |
int |
loadOffsetAvgCompensationTable(ArrayList<Double> tempValues,
ArrayList<Double> compValues)
Retrieves the weight offset thermal compensation table previously configured using the
set_offsetAvgCompensationTable function.
|
int |
loadOffsetChgCompensationTable(ArrayList<Double> tempValues,
ArrayList<Double> compValues)
Retrieves the weight offset thermal compensation table previously configured using the
set_offsetChgCompensationTable function.
|
int |
loadSpanAvgCompensationTable(ArrayList<Double> tempValues,
ArrayList<Double> compValues)
Retrieves the weight span thermal compensation table previously configured using the
set_spanAvgCompensationTable function.
|
int |
loadSpanChgCompensationTable(ArrayList<Double> tempValues,
ArrayList<Double> compValues)
Retrieves the weight span thermal compensation table previously configured using the
set_spanChgCompensationTable 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_command(String newval) |
int |
set_excitation(int newval)
Changes the current load cell bridge excitation method.
|
int |
set_offsetAvgCompensationTable(ArrayList<Double> tempValues,
ArrayList<Double> compValues)
Records a weight offset thermal compensation table, in order to automatically correct the
measured weight based on the averaged compensation temperature.
|
int |
set_offsetChgCompensationTable(ArrayList<Double> tempValues,
ArrayList<Double> compValues)
Records a weight offset thermal compensation table, in order to automatically correct the
measured weight based on the variation of temperature.
|
int |
set_spanAvgCompensationTable(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_spanChgCompensationTable(ArrayList<Double> tempValues,
ArrayList<Double> compValues)
Records a weight span thermal compensation table, in order to automatically correct the
measured weight based on the variation of temperature.
|
int |
set_tempAvgAdaptRatio(double newval)
Changes the averaged temperature update rate, in per mille.
|
int |
set_tempChgAdaptRatio(double newval)
Changes the temperature change update rate, in per mille.
|
int |
set_unit(String newval)
Changes the measuring unit for the weight.
|
int |
set_zeroTracking(double newval)
Changes the zero tracking threshold value.
|
int |
setCompensationTable(int tableIndex,
ArrayList<Double> tempValues,
ArrayList<Double> compValues) |
int |
setExcitation(int newval)
Changes the current load cell bridge excitation method.
|
int |
setTempAvgAdaptRatio(double newval)
Changes the averaged temperature update rate, in per mille.
|
int |
setTempChgAdaptRatio(double newval)
Changes the temperature change update rate, in per mille.
|
int |
setUnit(String newval)
Changes the measuring unit for the weight.
|
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 zero tracking threshold value.
|
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_advMode, get_calibrationParam, get_currentRawValue, get_currentValue, get_dataLogger, get_highestValue, get_logFrequency, get_lowestValue, get_recordedData, get_reportFrequency, get_resolution, get_sensorState, get_unit, getAdvMode, getCurrentRawValue, getCurrentValue, getHighestValue, getLogFrequency, getLowestValue, getReportFrequency, getResolution, getSensorState, getUnit, isSensorReady, loadCalibrationPoints, nextSensor, registerTimedReportCallback, registerValueCallback, set_advMode, set_calibrationParam, set_highestValue, set_logFrequency, set_lowestValue, set_reportFrequency, set_resolution, setAdvMode, setHighestValue, setLogFrequency, setLowestValue, setReportFrequency, setResolution, startDataLogger, stopDataLogger
_AddToCache, _clearDataStreamCache, _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, _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 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 TEMPAVGADAPTRATIO_INVALID
public static final double TEMPCHGADAPTRATIO_INVALID
public static final double COMPTEMPAVG_INVALID
public static final double COMPTEMPCHG_INVALID
public static final double COMPENSATION_INVALID
public static final double ZEROTRACKING_INVALID
public static final String COMMAND_INVALID
protected int _excitation
protected double _tempAvgAdaptRatio
protected double _tempChgAdaptRatio
protected double _compTempAvg
protected double _compTempChg
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 set_unit(String newval) throws YAPI_Exception
newval
- : a string corresponding to the measuring unit for the weightYAPI_Exception
- on errorpublic int setUnit(String newval) throws YAPI_Exception
newval
- : a string corresponding to the measuring unit for the weightYAPI_Exception
- on errorpublic 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_tempAvgAdaptRatio(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the averaged temperature update rate, in per milleYAPI_Exception
- on errorpublic int setTempAvgAdaptRatio(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the averaged temperature update rate, in per milleYAPI_Exception
- on errorpublic double get_tempAvgAdaptRatio() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getTempAvgAdaptRatio() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_tempChgAdaptRatio(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the temperature change update rate, in per milleYAPI_Exception
- on errorpublic int setTempChgAdaptRatio(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the temperature change update rate, in per milleYAPI_Exception
- on errorpublic double get_tempChgAdaptRatio() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getTempChgAdaptRatio() throws YAPI_Exception
YAPI_Exception
- on errorpublic double get_compTempAvg() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getCompTempAvg() throws YAPI_Exception
YAPI_Exception
- on errorpublic double get_compTempChg() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getCompTempChg() 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 zero tracking threshold valueYAPI_Exception
- on errorpublic int setZeroTracking(double newval) throws YAPI_Exception
newval
- : a floating point number corresponding to the zero tracking threshold valueYAPI_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 sensor, for instance
YWBRIDG1.weighScale1.public static YWeighScale FindWeighScaleInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the weighing scale sensor, for instance
YWBRIDG1.weighScale1.public 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 expected on the load cell.YAPI_Exception
- on errorpublic int setCompensationTable(int tableIndex, ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
YAPI_Exception
public int loadCompensationTable(int tableIndex, ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
YAPI_Exception
public int set_offsetAvgCompensationTable(ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, corresponding to all averaged
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 loadOffsetAvgCompensationTable(ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, that is filled by the function
with all averaged 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_offsetChgCompensationTable(ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, corresponding to temperature
variations 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 variation included in the first
argument, index by index.YAPI_Exception
- on errorpublic int loadOffsetChgCompensationTable(ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, that is filled by the function
with all temperature variations 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
variation included in the first argument, index by index.YAPI_Exception
- on errorpublic int set_spanAvgCompensationTable(ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, corresponding to all averaged
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 loadSpanAvgCompensationTable(ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, that is filled by the function
with all averaged 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 int set_spanChgCompensationTable(ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, corresponding to all variations of
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 variation included
in the first argument, index by index.YAPI_Exception
- on errorpublic int loadSpanChgCompensationTable(ArrayList<Double> tempValues, ArrayList<Double> compValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, that is filled by the function
with all variation of temperature 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 variation of 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 © 2020. All rights reserved.