Package xal.plugin.epics7
Class Epics7Channel
java.lang.Object
xal.ca.Channel
xal.plugin.epics7.Epics7Channel
- All Implemented Interfaces:
org.epics.pvaccess.client.ChannelRequester
,org.epics.pvdata.pv.Requester
- Direct Known Subclasses:
Epics7ServerChannel
This
Channel
implementation can connect to ChannelAccess or PV Access. If the PV signal starts with
'ca://', it will only connect to CA; if it starts with 'pva://', it will only connect to PVA; otherwise it tries to
connect to both and uses the protocol that replies first.- Author:
- Juan F. Esteban Müller <JuanF.EstebanMuller@ess.eu>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final double
static final double
static final String
protected static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class xal.ca.Channel
channelSystem, connectionFlag, connectionProxy, dblTmEvt, dblTmIO, messageCenter, strId
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMonitorValStatus
(IEventSinkValStatus listener, int intMaskFire) Setup a value-status monitor on this channeladdMonitorValTime
(IEventSinkValTime listener, int intMaskFire) Setup a value-status-timestamp monitor on this channeladdMonitorValue
(IEventSinkValue listener, int intMaskFire) Setup a value monitor on this channelvoid
channelCreated
(org.epics.pvdata.pv.Status status, org.epics.pvaccess.client.Channel chnl) void
channelStateChange
(org.epics.pvaccess.client.Channel chnl, org.epics.pvaccess.client.Channel.ConnectionState cs) boolean
connectAndWait
(double timeout) Request a new connection and wait for it no longer than the timeout.void
Terminate the network channel connection and clear all events associated with process variableint
Return size of value array associated with process variableClass<?>
get the Java class associated with the native type of this channelorg.epics.pvdata.pv.PVStructure
org.epics.pvdata.pv.PVStructure
String[]
Get the lower and upper alarm limit PVsvoid
getCallback
(String request, EventListener listener) void
getCallback
(String request, EventListener listener, boolean attemptConnection) protected org.epics.pvdata.pv.PVStructure
protected org.epics.pvdata.pv.PVStructure
String[]
Get the lower and upper drive limit PVsprotected org.epics.pvaccess.client.Channel
String[]
Get the lower and upper operation limit PVsReturn a rawChannelStatusRecord
representing the fetched record for the native type of this channel.protected ChannelStatusRecord
Get aChannelStatusRecord
representing the fetched record for the specified type.protected ChannelTimeRecord
Get aChannelTimeRecord
representing the fetched record for the specified type.protected ChannelRecord
Get aChannelRecord
representing the fetched record for the specified type.Return a rawChannelTimeRecord
representing the fetched record for the native type of this channel.protected void
getRawValueCallback
(IEventSinkValue listener) Handle a callback for getting the raw value for the channel.protected void
getRawValueCallback
(IEventSinkValue listener, boolean attemptConnection) Handle a callback for getting the raw value for the channel.Return a rawChannelRecord
representing the fetched record for the native type of this channel.void
getRawValueTimeCallback
(IEventSinkValTime listener, boolean attemptConnection) Submit a non-blocking Get request with callbackgetUnits()
Convenience method which returns the units for this channel.protected org.epics.pvdata.pv.PVStructure
String[]
Get the lower and upper warning limit PVsvoid
void
putRawValCallback
(byte[] newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(byte newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(double[] newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(double newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(float[] newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(float newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(int[] newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(int newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(long[] newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(long newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(short[] newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(short newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(String[] newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(String newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(PutListener listener, EventListener putListener) Convenience method which returns the lower alarm limit.Convenience method which returns the lower control limit.Convenience method which returns the lower display limit.Convenience method which returns the lower warning limit.Convenience method which returns the upper alarm limit.Convenience method which returns the upper control limit.Convenience method which returns the upper display limit.Convenience method which returns the upper warning limit.boolean
Determine if channel has read access to process variablevoid
Request that the channel be connected.boolean
Determine if channel has write access to process variableMethods inherited from class xal.ca.Channel
addConnectionListener, channelName, checkConnection, checkConnection, checkConnection, connectAndWait, flushIO, getArrayValue, getArrByte, getArrByteCallback, getArrDbl, getArrDblCallback, getArrFlt, getArrFltCallback, getArrInt, getArrIntCallback, getArrLong, getArrShort, getArrString, getEventTimeout, getId, getInstance, getInstance, getIoTimeout, getStatusRecord, getStringStatusRecord, getStringTimeRecord, getStringValueRecord, getTimeRecord, getValByte, getValByteCallback, getValDbl, getValDblCallback, getValEnum, getValFlt, getValFltCallback, getValInt, getValIntCallback, getValLong, getValShort, getValString, getValueCallback, getValueCallback, getValueRecord, getValueTimeCallback, getValueTransform, isConnected, isValid, lowerAlarmLimit, lowerControlLimit, lowerDisplayLimit, lowerWarningLimit, pendEvent, pendIO, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, removeConnectionListener, setChannelName, setDebugMode, setEventTimeout, setIoTimeout, setValid, upperAlarmLimit, upperControlLimit, upperDisplayLimit, upperWarningLimit
-
Field Details
-
C_DBL_DEF_TIME_IO
public static final double C_DBL_DEF_TIME_IO- See Also:
-
C_DBL_DEF_TIME_EVENT
public static final double C_DBL_DEF_TIME_EVENT- See Also:
-
C_S_DEF_PROTOCOL
- See Also:
-
VALUE_FIELD
- See Also:
-
ALARM_FIELD
- See Also:
-
DISPLAY_FIELD
- See Also:
-
VALUE_ALARM_FIELD
- See Also:
-
CONTROL_FIELD
- See Also:
-
TIMESTAMP_FIELD
- See Also:
-
VALUE_REQUEST
- See Also:
-
STATUS_REQUEST
- See Also:
-
TIME_REQUEST
- See Also:
-
CONNECTION_EXC
- See Also:
-
-
Constructor Details
-
Epics7Channel
-
-
Method Details
-
getNativeChannel
protected org.epics.pvaccess.client.Channel getNativeChannel() -
connectAndWait
public boolean connectAndWait(double timeout) Description copied from class:Channel
Request a new connection and wait for it no longer than the timeout.- Specified by:
connectAndWait
in classChannel
- Parameters:
timeout
- seconds to wait for a connection before giving up- Returns:
- true if the connection was made within the timeout and false if not
-
requestConnection
public void requestConnection()Description copied from class:Channel
Request that the channel be connected. Connections are made in the background so this method returns immediately upon making the request. The connection will be made in the future as soon as possible. A connection event will be sent to registered connection listeners when the connection has been established.- Specified by:
requestConnection
in classChannel
-
disconnect
public void disconnect()Description copied from class:Channel
Terminate the network channel connection and clear all events associated with process variable- Specified by:
disconnect
in classChannel
-
channelStateChange
public void channelStateChange(org.epics.pvaccess.client.Channel chnl, org.epics.pvaccess.client.Channel.ConnectionState cs) - Specified by:
channelStateChange
in interfaceorg.epics.pvaccess.client.ChannelRequester
-
channelCreated
public void channelCreated(org.epics.pvdata.pv.Status status, org.epics.pvaccess.client.Channel chnl) - Specified by:
channelCreated
in interfaceorg.epics.pvaccess.client.ChannelRequester
-
getRequesterName
- Specified by:
getRequesterName
in interfaceorg.epics.pvdata.pv.Requester
-
message
- Specified by:
message
in interfaceorg.epics.pvdata.pv.Requester
-
elementType
Description copied from class:Channel
get the Java class associated with the native type of this channel- Specified by:
elementType
in classChannel
- Returns:
- the native element type
-
elementCount
Description copied from class:Channel
Return size of value array associated with process variable- Specified by:
elementCount
in classChannel
- Returns:
- number of values in process variable
- Throws:
ConnectionException
- accordingly
-
readAccess
Description copied from class:Channel
Determine if channel has read access to process variable- Specified by:
readAccess
in classChannel
- Returns:
- true if channel has read access
- Throws:
ConnectionException
- channel not connected
-
writeAccess
Description copied from class:Channel
Determine if channel has write access to process variable- Specified by:
writeAccess
in classChannel
- Returns:
- true if channel has write access
- Throws:
ConnectionException
- channel not connected
-
getControl
- Throws:
GetException
-
getDisplay
- Throws:
GetException
-
getVAlueAlarm
- Throws:
GetException
-
getUnits
Description copied from class:Channel
Convenience method which returns the units for this channel.- Specified by:
getUnits
in classChannel
- Returns:
- the units
- Throws:
GetException
- accordingly
-
rawUpperDisplayLimit
Description copied from class:Channel
Convenience method which returns the upper display limit.- Specified by:
rawUpperDisplayLimit
in classChannel
- Returns:
- the raw upper display limit
- Throws:
GetException
- accordingly
-
rawLowerDisplayLimit
Description copied from class:Channel
Convenience method which returns the lower display limit.- Specified by:
rawLowerDisplayLimit
in classChannel
- Returns:
- the raw lower display limit
- Throws:
GetException
- accordingly
-
rawUpperAlarmLimit
Description copied from class:Channel
Convenience method which returns the upper alarm limit.- Specified by:
rawUpperAlarmLimit
in classChannel
- Returns:
- the raw upper alarm limit
- Throws:
GetException
- accordingly
-
rawLowerAlarmLimit
Description copied from class:Channel
Convenience method which returns the lower alarm limit.- Specified by:
rawLowerAlarmLimit
in classChannel
- Returns:
- the raw lower alarm limit
- Throws:
GetException
- accordingly
-
rawUpperWarningLimit
Description copied from class:Channel
Convenience method which returns the upper warning limit.- Specified by:
rawUpperWarningLimit
in classChannel
- Returns:
- the raw upper warning limit
- Throws:
GetException
- accordingly
-
rawLowerWarningLimit
Description copied from class:Channel
Convenience method which returns the lower warning limit.- Specified by:
rawLowerWarningLimit
in classChannel
- Returns:
- the raw lower warning limit
- Throws:
GetException
- accordingly
-
rawUpperControlLimit
Description copied from class:Channel
Convenience method which returns the upper control limit.- Specified by:
rawUpperControlLimit
in classChannel
- Returns:
- the raw upper control limit
- Throws:
GetException
- accordingly
-
rawLowerControlLimit
Description copied from class:Channel
Convenience method which returns the lower control limit.- Specified by:
rawLowerControlLimit
in classChannel
- Returns:
- the raw lower control limit
- Throws:
GetException
- accordingly
-
get
public org.epics.pvdata.pv.PVStructure get(String request, boolean attemptConnection) throws GetException - Throws:
GetException
-
get
- Throws:
GetException
-
getCallback
public void getCallback(String request, EventListener listener, boolean attemptConnection) throws GetException - Throws:
GetException
-
getCallback
- Throws:
GetException
-
getRawValueRecord
Description copied from class:Channel
Return a rawChannelRecord
representing the fetched record for the native type of this channel. This is a convenient way to get the value of the PV.- Specified by:
getRawValueRecord
in classChannel
- Returns:
- raw channel record
- Throws:
GetException
- accordingly
-
getRawValueCallback
Description copied from class:Channel
Handle a callback for getting the raw value for the channel.- Specified by:
getRawValueCallback
in classChannel
- Parameters:
listener
- The receiver of the callback.- Throws:
GetException
- accordingly
-
getRawValueCallback
protected void getRawValueCallback(IEventSinkValue listener, boolean attemptConnection) throws GetException Description copied from class:Channel
Handle a callback for getting the raw value for the channel.- Specified by:
getRawValueCallback
in classChannel
- Parameters:
listener
- The receiver of the callback.attemptConnection
- indicates whether or not to attempt a blocking connection if this channel is not connected- Throws:
GetException
- accordingly
-
getRawStringValueRecord
Description copied from class:Channel
Get aChannelRecord
representing the fetched record for the specified type.- Specified by:
getRawStringValueRecord
in classChannel
- Returns:
- the channel record
- Throws:
GetException
- accordingly
-
getRawStatusRecord
Description copied from class:Channel
Return a rawChannelStatusRecord
representing the fetched record for the native type of this channel. This is a convenient way to get the value of the PV along with status.- Specified by:
getRawStatusRecord
in classChannel
- Returns:
- raw channel record
- Throws:
GetException
- accordingly
-
getRawStringStatusRecord
Description copied from class:Channel
Get aChannelStatusRecord
representing the fetched record for the specified type.- Specified by:
getRawStringStatusRecord
in classChannel
- Returns:
- the channel record
- Throws:
GetException
- accordingly
-
getRawTimeRecord
Description copied from class:Channel
Return a rawChannelTimeRecord
representing the fetched record for the native type of this channel. This is a convenient way to get the value of the PV along with status and timestamp.- Specified by:
getRawTimeRecord
in classChannel
- Returns:
- raw channel record
- Throws:
GetException
- accordingly
-
getRawStringTimeRecord
Description copied from class:Channel
Get aChannelTimeRecord
representing the fetched record for the specified type.- Specified by:
getRawStringTimeRecord
in classChannel
- Returns:
- the channel record
- Throws:
GetException
- accordingly
-
getRawValueTimeCallback
public void getRawValueTimeCallback(IEventSinkValTime listener, boolean attemptConnection) throws GetException Description copied from class:Channel
Submit a non-blocking Get request with callback- Specified by:
getRawValueTimeCallback
in classChannel
- Parameters:
listener
- to receive callback upon completionattemptConnection
- true to attempt connection and false not to attempt connection- Throws:
GetException
- accordingly
-
addMonitorValTime
public Monitor addMonitorValTime(IEventSinkValTime listener, int intMaskFire) throws MonitorException Description copied from class:Channel
Setup a value-status-timestamp monitor on this channel- Specified by:
addMonitorValTime
in classChannel
- Parameters:
listener
- interface to data sinkintMaskFire
- code specifying when the monitor is fired or'ed combination of {Monitor.VALUE, Monitor.LOG, Monitor.ALARM}- Returns:
- A new monitor
- Throws:
MonitorException
- general monitor failure
-
addMonitorValStatus
public Monitor addMonitorValStatus(IEventSinkValStatus listener, int intMaskFire) throws MonitorException Description copied from class:Channel
Setup a value-status monitor on this channel- Specified by:
addMonitorValStatus
in classChannel
- Parameters:
listener
- interface to data sinkintMaskFire
- code specifying when the monitor is fired or'ed combination of {Monitor.VALUE, Monitor.LOG, Monitor.ALARM}- Returns:
- A new monitor
- Throws:
MonitorException
- general monitor failure
-
addMonitorValue
Description copied from class:Channel
Setup a value monitor on this channel- Specified by:
addMonitorValue
in classChannel
- Parameters:
listener
- interface to data sinkintMaskFire
- code specifying when the monitor is fired or'ed combination of {Monitor.VALUE, Monitor.LOG, Monitor.ALARM}- Returns:
- A new monitor
- Throws:
MonitorException
- general monitor failure
-
putRawValCallback
- Throws:
PutException
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Specified by:
putRawValCallback
in classChannel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
getOperationLimitPVs
Description copied from class:Channel
Get the lower and upper operation limit PVs- Specified by:
getOperationLimitPVs
in classChannel
- Returns:
- two element array of PVs with the lower and upper limit PVs
-
getWarningLimitPVs
Description copied from class:Channel
Get the lower and upper warning limit PVs- Specified by:
getWarningLimitPVs
in classChannel
- Returns:
- two element array of PVs with the lower and upper limit PVs
-
getAlarmLimitPVs
Description copied from class:Channel
Get the lower and upper alarm limit PVs- Specified by:
getAlarmLimitPVs
in classChannel
- Returns:
- two element array of PVs with the lower and upper limit PVs
-
getDriveLimitPVs
Description copied from class:Channel
Get the lower and upper drive limit PVs- Specified by:
getDriveLimitPVs
in classChannel
- Returns:
- two element array of PVs with the lower and upper limit PVs
-