Package gda.device

Interface DigitalIO

All Superinterfaces:
Configurable, Device, Findable, gda.observable.IObservable

public interface DigitalIO extends Device
An interface for a distributed Digital I/O class
  • Field Details

    • HIGH_STATE

      static final int HIGH_STATE
      high state is assumed to be TTL high of >= 2.2V
      See Also:
    • LOW_STATE

      static final int LOW_STATE
      Low state is assumed to be TTL of 0-0.8V.
      See Also:
  • Method Details

    • getState

      int getState(String channelName) throws DeviceException
      Get the current logic state for the specified channel
      Parameters:
      channelName - i/o channel name to read
      Returns:
      current TTL line state
      Throws:
      DeviceException
    • setState

      void setState(String channelName, int state) throws DeviceException
      Set the current logic state for the specified channel
      Parameters:
      channelName - i/o channel name to write to
      state - TTL line state : 0=low and any other value=high
      Throws:
      DeviceException
    • setNegativeEdgeSync

      void setNegativeEdgeSync(String channelName) throws DeviceException
      Carries out a negative edge sync operation by intialising the state to high (just in case it's low from a previous operation), then setting a low state. Finally a return is made to the resting high state after a delay period accessed by the methods getEdgeSyncDelayTime() and setEdgeSyncDelayTime() in msecs. Thus it's possible to use this also as a negative level sync.
      Parameters:
      channelName - i/o channel name to write to
      Throws:
      DeviceException
    • setPositiveEdgeSync

      void setPositiveEdgeSync(String channelName) throws DeviceException
      Carries out a positive edge sync operation by intialising the state to low (just in case it's high from a previous operation), then setting a high state. Finally a return is made to the resting low state after a delay period accessed by the methods getEdgeSyncDelayTime() and setEdgeSyncDelayTime() in msecs. Thus it's possible to use this also as a positive level sync.
      Parameters:
      channelName - i/o channel name to write to
      Throws:
      DeviceException
    • setNegative2LineSync

      void setNegative2LineSync(String inputChannelName, String outputChannelName) throws DeviceException
      Carries out a 2 line handshake with an external device which obeys the protocol rules. The handshake is safe as both devices wait for each other using a read input line and set a state on a write output line. Very useful for integrating decoupled subsystems. This device waits for the input line to go high indicating the external device is idle and can be triggered. Then the external device is triggered with a low output state. The input line then waits for a low state to show the external device has received the trigger and is busy. The input line then waits for a high state to show the external device has finished its actions and is idle again (i.e. back to the pre-trigger state again). A timeout can be specified by the methods get2LineSyncTimeout() and set2LineSyncTimeout() in msecs.
      Parameters:
      inputChannelName - i/o channel name to read input line state
      outputChannelName - i/o channel name to write output line state
      Throws:
      DeviceException
    • setPositive2LineSync

      void setPositive2LineSync(String inputChannelName, String outputChannelName) throws DeviceException
      Carries out a 2 line handshake with an external device which obeys the protocol rules. The handshake is safe as both devices wait for each other using a read input line and set a state on a write output line. Very useful for integrating decoupled subsystems. This device waits for the input line to go low indicating the external device is idle and can be triggered. Then the external device is triggered with a high output state. The input line then waits for a high state to show the external device has received the trigger and is busy. The input line then waits for a low state to show the external device has finished its actions and is idle again (i.e. back to the pre-trigger state again). A timeout can be specified by the methods get2LineSyncTimeout() and set2LineSyncTimeout() in msecs.
      Parameters:
      inputChannelName - i/o channel name to read input line state
      outputChannelName - i/o channel name to write output line state
      Throws:
      DeviceException
    • getTwoLineSyncTimeout

      int getTwoLineSyncTimeout() throws DeviceException
      Get the current timeout for 2 line sync operations
      Returns:
      current 2 line sync timeout in msecs
      Throws:
      DeviceException
    • setTwoLineSyncTimeout

      void setTwoLineSyncTimeout(int msecs) throws DeviceException
      Set the required timeout for 2 line sync operations
      Parameters:
      msecs - 2 line sync timeout in msecs
      Throws:
      DeviceException
    • getEdgeSyncDelayTime

      int getEdgeSyncDelayTime() throws DeviceException
      Get the current delay time after edge sync operations
      Returns:
      the current edge sync delay time in msecs
      Throws:
      DeviceException
    • setEdgeSyncDelayTime

      void setEdgeSyncDelayTime(int msecs) throws DeviceException
      Set the required delay after edge sync operations
      Parameters:
      msecs - 2 line sync timeout in msecs
      Throws:
      DeviceException