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

public class Epics7Channel extends Channel implements org.epics.pvaccess.client.ChannelRequester
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 Details

  • Constructor Details

  • 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 class Channel
      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 class Channel
    • 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 class Channel
    • channelStateChange

      public void channelStateChange(org.epics.pvaccess.client.Channel chnl, org.epics.pvaccess.client.Channel.ConnectionState cs)
      Specified by:
      channelStateChange in interface org.epics.pvaccess.client.ChannelRequester
    • channelCreated

      public void channelCreated(org.epics.pvdata.pv.Status status, org.epics.pvaccess.client.Channel chnl)
      Specified by:
      channelCreated in interface org.epics.pvaccess.client.ChannelRequester
    • getRequesterName

      public String getRequesterName()
      Specified by:
      getRequesterName in interface org.epics.pvdata.pv.Requester
    • message

      public void message(String message, org.epics.pvdata.pv.MessageType mt)
      Specified by:
      message in interface org.epics.pvdata.pv.Requester
    • elementType

      public Class<?> elementType()
      Description copied from class: Channel
      get the Java class associated with the native type of this channel
      Specified by:
      elementType in class Channel
      Returns:
      the native element type
    • elementCount

      public int elementCount() throws ConnectionException
      Description copied from class: Channel
      Return size of value array associated with process variable
      Specified by:
      elementCount in class Channel
      Returns:
      number of values in process variable
      Throws:
      ConnectionException - accordingly
    • readAccess

      public boolean readAccess() throws ConnectionException
      Description copied from class: Channel
      Determine if channel has read access to process variable
      Specified by:
      readAccess in class Channel
      Returns:
      true if channel has read access
      Throws:
      ConnectionException - channel not connected
    • writeAccess

      public boolean writeAccess() throws ConnectionException
      Description copied from class: Channel
      Determine if channel has write access to process variable
      Specified by:
      writeAccess in class Channel
      Returns:
      true if channel has write access
      Throws:
      ConnectionException - channel not connected
    • getControl

      protected org.epics.pvdata.pv.PVStructure getControl() throws GetException
      Throws:
      GetException
    • getDisplay

      protected org.epics.pvdata.pv.PVStructure getDisplay() throws GetException
      Throws:
      GetException
    • getVAlueAlarm

      protected org.epics.pvdata.pv.PVStructure getVAlueAlarm() throws GetException
      Throws:
      GetException
    • getUnits

      public String getUnits() throws GetException
      Description copied from class: Channel
      Convenience method which returns the units for this channel.
      Specified by:
      getUnits in class Channel
      Returns:
      the units
      Throws:
      GetException - accordingly
    • rawUpperDisplayLimit

      public Number rawUpperDisplayLimit() throws GetException
      Description copied from class: Channel
      Convenience method which returns the upper display limit.
      Specified by:
      rawUpperDisplayLimit in class Channel
      Returns:
      the raw upper display limit
      Throws:
      GetException - accordingly
    • rawLowerDisplayLimit

      public Number rawLowerDisplayLimit() throws GetException
      Description copied from class: Channel
      Convenience method which returns the lower display limit.
      Specified by:
      rawLowerDisplayLimit in class Channel
      Returns:
      the raw lower display limit
      Throws:
      GetException - accordingly
    • rawUpperAlarmLimit

      public Number rawUpperAlarmLimit() throws GetException
      Description copied from class: Channel
      Convenience method which returns the upper alarm limit.
      Specified by:
      rawUpperAlarmLimit in class Channel
      Returns:
      the raw upper alarm limit
      Throws:
      GetException - accordingly
    • rawLowerAlarmLimit

      public Number rawLowerAlarmLimit() throws GetException
      Description copied from class: Channel
      Convenience method which returns the lower alarm limit.
      Specified by:
      rawLowerAlarmLimit in class Channel
      Returns:
      the raw lower alarm limit
      Throws:
      GetException - accordingly
    • rawUpperWarningLimit

      public Number rawUpperWarningLimit() throws GetException
      Description copied from class: Channel
      Convenience method which returns the upper warning limit.
      Specified by:
      rawUpperWarningLimit in class Channel
      Returns:
      the raw upper warning limit
      Throws:
      GetException - accordingly
    • rawLowerWarningLimit

      public Number rawLowerWarningLimit() throws GetException
      Description copied from class: Channel
      Convenience method which returns the lower warning limit.
      Specified by:
      rawLowerWarningLimit in class Channel
      Returns:
      the raw lower warning limit
      Throws:
      GetException - accordingly
    • rawUpperControlLimit

      public Number rawUpperControlLimit() throws GetException
      Description copied from class: Channel
      Convenience method which returns the upper control limit.
      Specified by:
      rawUpperControlLimit in class Channel
      Returns:
      the raw upper control limit
      Throws:
      GetException - accordingly
    • rawLowerControlLimit

      public Number rawLowerControlLimit() throws GetException
      Description copied from class: Channel
      Convenience method which returns the lower control limit.
      Specified by:
      rawLowerControlLimit in class Channel
      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

      public org.epics.pvdata.pv.PVStructure get(String request) throws GetException
      Throws:
      GetException
    • getCallback

      public void getCallback(String request, EventListener listener, boolean attemptConnection) throws GetException
      Throws:
      GetException
    • getCallback

      public void getCallback(String request, EventListener listener) throws GetException
      Throws:
      GetException
    • getRawValueRecord

      public ChannelRecord getRawValueRecord() throws GetException
      Description copied from class: Channel
      Return a raw ChannelRecord 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 class Channel
      Returns:
      raw channel record
      Throws:
      GetException - accordingly
    • getRawValueCallback

      protected void getRawValueCallback(IEventSinkValue listener) throws GetException
      Description copied from class: Channel
      Handle a callback for getting the raw value for the channel.
      Specified by:
      getRawValueCallback in class Channel
      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 class Channel
      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

      protected ChannelRecord getRawStringValueRecord() throws GetException
      Description copied from class: Channel
      Get a ChannelRecord representing the fetched record for the specified type.
      Specified by:
      getRawStringValueRecord in class Channel
      Returns:
      the channel record
      Throws:
      GetException - accordingly
    • getRawStatusRecord

      public ChannelStatusRecord getRawStatusRecord() throws GetException
      Description copied from class: Channel
      Return a raw ChannelStatusRecord 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 class Channel
      Returns:
      raw channel record
      Throws:
      GetException - accordingly
    • getRawStringStatusRecord

      protected ChannelStatusRecord getRawStringStatusRecord() throws GetException
      Description copied from class: Channel
      Get a ChannelStatusRecord representing the fetched record for the specified type.
      Specified by:
      getRawStringStatusRecord in class Channel
      Returns:
      the channel record
      Throws:
      GetException - accordingly
    • getRawTimeRecord

      public ChannelTimeRecord getRawTimeRecord() throws GetException
      Description copied from class: Channel
      Return a raw ChannelTimeRecord 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 class Channel
      Returns:
      raw channel record
      Throws:
      GetException - accordingly
    • getRawStringTimeRecord

      protected ChannelTimeRecord getRawStringTimeRecord() throws GetException
      Description copied from class: Channel
      Get a ChannelTimeRecord representing the fetched record for the specified type.
      Specified by:
      getRawStringTimeRecord in class Channel
      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 class Channel
      Parameters:
      listener - to receive callback upon completion
      attemptConnection - 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 class Channel
      Parameters:
      listener - interface to data sink
      intMaskFire - 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 class Channel
      Parameters:
      listener - interface to data sink
      intMaskFire - 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

      public Monitor addMonitorValue(IEventSinkValue listener, int intMaskFire) throws MonitorException
      Description copied from class: Channel
      Setup a value monitor on this channel
      Specified by:
      addMonitorValue in class Channel
      Parameters:
      listener - interface to data sink
      intMaskFire - 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

      public void putRawValCallback(PutListener listener, EventListener putListener) throws PutException
      Throws:
      PutException
    • putRawValCallback

      public void putRawValCallback(String newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(byte newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(short newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(int newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(long newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(float newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(double newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(String[] newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(byte[] newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(short[] newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(int[] newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(long[] newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(float[] newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(double[] newVal, PutListener listener) throws PutException
      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 class Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • getOperationLimitPVs

      public String[] getOperationLimitPVs()
      Description copied from class: Channel
      Get the lower and upper operation limit PVs
      Specified by:
      getOperationLimitPVs in class Channel
      Returns:
      two element array of PVs with the lower and upper limit PVs
    • getWarningLimitPVs

      public String[] getWarningLimitPVs()
      Description copied from class: Channel
      Get the lower and upper warning limit PVs
      Specified by:
      getWarningLimitPVs in class Channel
      Returns:
      two element array of PVs with the lower and upper limit PVs
    • getAlarmLimitPVs

      public String[] getAlarmLimitPVs()
      Description copied from class: Channel
      Get the lower and upper alarm limit PVs
      Specified by:
      getAlarmLimitPVs in class Channel
      Returns:
      two element array of PVs with the lower and upper limit PVs
    • getDriveLimitPVs

      public String[] getDriveLimitPVs()
      Description copied from class: Channel
      Get the lower and upper drive limit PVs
      Specified by:
      getDriveLimitPVs in class Channel
      Returns:
      two element array of PVs with the lower and upper limit PVs