public class CounterProcessVariable extends NumericProcessVariable implements Runnable
startValue incrementing by incrementValue every periodInMS milliseconds.
When counter value riches envValue counter is reset to startValue.
Implementation also triggers alarms (seting status and severity) regarding to set warning and alarm limits.| Modifier and Type | Field and Description |
|---|---|
protected int |
endValue
Counter end (stop) value.
|
protected int |
incrementValue
Increment value (counter stepping).
|
protected Number |
lowerAlarmValue
Lower alarm value.
|
protected Number |
lowerControlValue
Lower control value (= start value).
|
protected Number |
lowerDisplayValue
Lower display value (= start value).
|
protected Number |
lowerWarningValue
Lower warning value.
|
protected int |
periodInMS
Period between value increments.
|
protected Severity |
severity
Value status severity.
|
protected int |
startValue
Counter start value.
|
protected Status |
status
Value status.
|
protected TimeStamp |
timestamp
Timestamp of last value change.
|
protected Number |
upperAlarmValue
Upper alarm value.
|
protected Number |
upperControlValue
Upper control value (= end value).
|
protected Number |
upperDisplayValue
Upper display value (= end value).
|
protected Number |
upperWarningValue
Upper warning value.
|
protected int |
value
Counter value.
|
ackS, ackT, channelCount, eventCallback, interest, name| Constructor and Description |
|---|
CounterProcessVariable(String name,
ProcessVariableEventCallback eventCallback,
int startValue,
int endValue,
int incrementValue,
int periodInMS,
int lowerWarningValue,
int upperWarningValue,
int lowerAlarmValue,
int upperAlarmValue)
Construct a counter PV instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkForAlarms()
Checks for alarms (sets
status and severity). |
protected void |
fillInStatusAndTime(TIME timeDBR)
Fill-in status and time to DBR.
|
Number |
getLowerAlarmLimit()
Get lower alarm limit.
|
Number |
getLowerCtrlLimit()
Get lower control limit.
|
Number |
getLowerDispLimit()
Get lower display limit.
|
Number |
getLowerWarningLimit()
Get lower warning limit.
|
DBRType |
getType()
Return
DBRType.INT type as native type. |
String |
getUnits()
Get units.
|
Number |
getUpperAlarmLimit()
Get upper alarm limit.
|
Number |
getUpperCtrlLimit()
Get upper control limit.
|
Number |
getUpperDispLimit()
Get upper display limit.
|
Number |
getUpperWarningLimit()
Get upper warning limit.
|
protected void |
initialize()
Initialize PV.
|
protected CAStatus |
readValue(DBR value,
ProcessVariableReadCallback asyncReadCallback)
Read value.
|
void |
run()
Couting (external trigger) is done in this separate thread.
|
protected CAStatus |
writeValue(DBR value,
ProcessVariableWriteCallback asyncWriteCallback)
Write value.
|
fillInDBR, read, writecreateChannel, destroy, getAckS, getDimensionSize, getEnumLabels, getEventCallback, getMaxDimension, getName, interestDelete, interestRegister, isAckT, printInfo, printInfo, registerChannel, setAckS, setAckT, setEventCallback, unregisterChannelprotected int startValue
protected int endValue
protected int incrementValue
protected int periodInMS
protected Number lowerWarningValue
protected Number upperWarningValue
protected Number lowerAlarmValue
protected Number upperAlarmValue
protected Number lowerDisplayValue
protected Number upperDisplayValue
protected Number lowerControlValue
protected Number upperControlValue
protected int value
protected TimeStamp timestamp
protected Status status
protected Severity severity
public CounterProcessVariable(String name, ProcessVariableEventCallback eventCallback, int startValue, int endValue, int incrementValue, int periodInMS, int lowerWarningValue, int upperWarningValue, int lowerAlarmValue, int upperAlarmValue)
name - PV name.eventCallback - event callback, where to report value change events.startValue - counter start value, where to start counting.endValue - counter end value, where to stop counting.incrementValue - counter increment value, count steps.periodInMS - period in milliseconds between two increments.lowerWarningValue - lower warning limit value.upperWarningValue - upper warning limit value.lowerAlarmValue - lower alarm limit value.upperAlarmValue - upper alarm limit value.protected void initialize()
protected void checkForAlarms()
status and severity).public DBRType getType()
DBRType.INT type as native type.getType in class ProcessVariableProcessVariable.getType()public Number getLowerAlarmLimit()
NumericProcessVariablegetLowerAlarmLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getLowerAlarmLimit()public Number getLowerCtrlLimit()
NumericProcessVariablegetLowerCtrlLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getLowerCtrlLimit()public Number getLowerDispLimit()
NumericProcessVariablegetLowerDispLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getLowerDispLimit()public Number getLowerWarningLimit()
NumericProcessVariablegetLowerWarningLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getLowerWarningLimit()public String getUnits()
NumericProcessVariablegetUnits in class NumericProcessVariablenon-null.NumericProcessVariable.getUnits()public Number getUpperAlarmLimit()
NumericProcessVariablegetUpperAlarmLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getUpperAlarmLimit()public Number getUpperCtrlLimit()
NumericProcessVariablegetUpperCtrlLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getUpperCtrlLimit()public Number getUpperDispLimit()
NumericProcessVariablegetUpperDispLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getUpperDispLimit()public Number getUpperWarningLimit()
NumericProcessVariablegetUpperWarningLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getUpperWarningLimit()protected CAStatus readValue(DBR value, ProcessVariableReadCallback asyncReadCallback) throws CAException
com.cosylab.epics.caj.cas.util.NumericProcessVariable#read() method.readValue in class NumericProcessVariableCAExceptionNumericProcessVariable.readValue(gov.aps.jca.dbr.DBR, gov.aps.jca.cas.ProcessVariableReadCallback)protected void fillInStatusAndTime(TIME timeDBR)
timeDBR - DBR to fill-in.protected CAStatus writeValue(DBR value, ProcessVariableWriteCallback asyncWriteCallback) throws CAException
writeValue in class NumericProcessVariableCAExceptionNumericProcessVariable.writeValue(gov.aps.jca.dbr.DBR, gov.aps.jca.cas.ProcessVariableWriteCallback)public void run()
run in interface RunnableRunnable.run()Copyright © 2004-2020 EPICS. All Rights Reserved.