Class DummyEpicsLakeshore336

All Implemented Interfaces:
Device, Scannable, Configurable, Findable, gda.observable.IObservable

public class DummyEpicsLakeshore336 extends ScannableBase
A Dummy version of the class for controlling a Lakeshore 336 temperature controller through the EPICS interface.

The dummy version returns random temperatures between 0K and 500K, and random heating percentage.

Device online manual http://www.lakeshore.com/Documents/336_Manual.pdf

The class was originally written for use on i05 but is also used on i09

  • Constructor Details

    • DummyEpicsLakeshore336

      public DummyEpicsLakeshore336()
  • Method Details

    • getTolerance

      public double getTolerance()
    • setTolerance

      public void setTolerance(double tolerance)
    • isBusy

      public boolean isBusy() throws DeviceException
      Checks if the Lakeshore is still busy to allow blocking.

      If isBlocking() is false this will always return false
      If the heater for the currently active loop is off this will return false
      If the current demand has not yet reached the target demand this will return true
      If abs(controlled temperature - target temperature) > getTolerance() will return true

      Returns:
      true - if operation carried out by moveTo has not completed yet
      Throws:
      DeviceException
      See Also:
    • getPosition

      public Object[] getPosition() throws DeviceException
      Description copied from class: ScannableBase
      Returns the current position of the Scannable. Called by ConcurentScan at the end of the point. Reads an internal (hardware) position from rawGetPosition, converts this to an external (user) position and returns it.
      Specified by:
      getPosition in interface Scannable
      Overrides:
      getPosition in class ScannableBase
      Returns:
      Current position with an element for each input and extra field. null if their are no fields.
      Throws:
      DeviceException
    • asynchronousMoveTo

      public void asynchronousMoveTo(Object externalPosition) throws DeviceException
      Description copied from class: ScannableBase
      Trigger a move/operation and return immediately. Implementations of this method should be non-blocking to allow concurrent motion; the isBusy method will be used to determine when the move has completed. Converts the external (user) position to an internal position and passes this to rawAsynchronousMoveTo.
      Specified by:
      asynchronousMoveTo in interface Scannable
      Overrides:
      asynchronousMoveTo in class ScannableBase
      Parameters:
      externalPosition - Position to move to should have an element for each input field.
      Throws:
      DeviceException
    • getHeaterPercent

      public double getHeaterPercent() throws DeviceException
      Gets the current heater output percentage from the currently active output.
      Returns:
      The current heater output percentage
      Throws:
      DeviceException
    • getTemperature

      public double getTemperature(int channel) throws DeviceException
      Gets the current temperature from the specified channel.

      Channel is between 0 and 3 inclusive

      Parameters:
      channel - The channel to get
      Returns:
      The current temperature in K
      Throws:
      DeviceException
    • getControlledTemperature

      public double getControlledTemperature() throws DeviceException
      Gets the current temperature of the input used for the currently active output.
      Returns:
      The current temperature of the controlled input in K
      Throws:
      DeviceException
    • getInput

      public int getInput() throws DeviceException
      Gets the input channel selected for the currently active output

      0 = None
      1 = Input 1 = Channel 0
      2 = Input 2 = Channel 1
      3 = Input 3 = Channel 2
      4 = Input 4 = Channel 2

      Returns:
      The input selected for the currently active output
      Throws:
      DeviceException
    • setInput

      public void setInput(int input) throws DeviceException
      Sets the input channel selected for the currently active output

      0 = None
      1 = Input 1 = Channel 0
      2 = Input 2 = Channel 1
      3 = Input 3 = Channel 2
      4 = Input 4 = Channel 2

      Parameters:
      input - The input to use for the control
      Throws:
      DeviceException
    • setDemandTemperature

      public void setDemandTemperature(double demandTemperature) throws DeviceException
      Sets the demand temperature for the currently active output. If ramping is enabled then the actual demand temperature will move towards this at the ramping rate.
      Parameters:
      demandTemperature - The demanded temperature in K
      Throws:
      DeviceException
      See Also:
    • getCurrentDemandTemperature

      public double getCurrentDemandTemperature() throws DeviceException
      Gets the current demand temperature for the active output in K. If ramping is disabled this should be equal to the target demand temperature. If ramping is enabled this will follow the target demand temperature at the set rate.
      Returns:
      The current demand temperature from the readback value
      Throws:
      DeviceException
      See Also:
    • getTargetDemandTemperature

      public double getTargetDemandTemperature() throws DeviceException
      Gets the targeted demand temperature for the active output in K. If ramping is disabled this should be equal to the target demand temperature. If ramping is enabled this will follow the target demand temperature at the set rate.
      Returns:
      The target demand temperature set
      Throws:
      DeviceException
      See Also:
    • setManualOutput

      public void setManualOutput(double manualOutput) throws DeviceException
      Sets the manual output for the currently active output.
      Parameters:
      manualOutput - The requested manual output
      Throws:
      DeviceException
    • getManualOutput

      public double getManualOutput() throws DeviceException
      Gets the manual output for the currently active output.
      Returns:
      The current manual output
      Throws:
      DeviceException
    • setP

      public void setP(double demandP) throws DeviceException
      Sets the proportional term for the PID control, for the currently active output.
      Parameters:
      demandP -
      Throws:
      DeviceException
    • getP

      public double getP() throws DeviceException
      Gets the proportional term for the PID control, for the currently active output.
      Returns:
      Proportional term
      Throws:
      DeviceException
    • setI

      public void setI(double demandI) throws DeviceException
      Sets the integral term for the PID control, for the currently active output.
      Parameters:
      demandI -
      Throws:
      DeviceException
    • getI

      public double getI() throws DeviceException
      Gets the integral term for the PID control, for the currently active output.
      Returns:
      Integral term
      Throws:
      DeviceException
    • setD

      public void setD(double demandD) throws DeviceException
      Sets the derivative term for the PID control, for the currently active output.
      Parameters:
      demandD -
      Throws:
      DeviceException
    • getD

      public double getD() throws DeviceException
      Gets the derivative term for the PID control, for the currently active output.
      Returns:
      Derivative term
      Throws:
      DeviceException
    • setHeaterRange

      public void setHeaterRange(int heaterRange) throws DeviceException
      Sets the heater range for the currently active output.

      0=Off, 1=Low, 2=Med, 3=High

      Parameters:
      heaterRange - The demanded heater range
      Throws:
      DeviceException
    • getHeaterRange

      public int getHeaterRange() throws DeviceException
      Gets the heater range for the currently active output.

      0=Off, 1=Low, 2=Med, 3=High

      Returns:
      The heater range
      Throws:
      DeviceException
    • setRampRate

      public void setRampRate(double rampRate) throws DeviceException
      Sets the ramping rate in K/sec for the currently active output.
      Parameters:
      rampRate - The desired ramping rate in K/sec
      Throws:
      DeviceException
      See Also:
    • getRampRate

      public double getRampRate() throws DeviceException
      Get the ramping rate for the currently active output in K/sec.
      Returns:
      The ramping rate for the currently active output in K/sec
      Throws:
      DeviceException
    • setRampEnabled

      public void setRampEnabled(boolean rampEnabled) throws DeviceException
      Enables or disables ramping for the currently active output.
      Parameters:
      rampEnabled -
      Throws:
      DeviceException
      See Also:
    • isRampEnabled

      public boolean isRampEnabled() throws DeviceException
      Finds out if ramping is enabled on the current active output.
      Returns:
      The current ramping status
      Throws:
      DeviceException
    • enableRamping

      public void enableRamping() throws DeviceException
      Switches ramping on for the currently active output.
      Throws:
      DeviceException
      See Also:
    • disableRamping

      public void disableRamping() throws DeviceException
      Switches ramping off for the currently active output.
      Throws:
      DeviceException
      See Also:
    • enableBlocking

      public void enableBlocking()
      Switches blocking on. When the temperature is changed the device will be busy until the ramping finishes (if enabled) and the demand temperature is reached (within tolerance).
      See Also:
    • disableBlocking

      public void disableBlocking()
      Switches blocking off. isBusy() will always return false. This allows the temperature to be recorded at every point in the scan without waiting for a demand temperature to be reached, or to start a temperature ramp in a script and then perform other operations.
      See Also:
    • isBlocking

      public boolean isBlocking()
      Finds out if the Lakeshore is currently blocking.
      Returns:
      current blocking status
      See Also:
    • getActiveOutput

      public int getActiveOutput()
      Gets the output which is currently being controlled by GDA
      Returns:
      The currently active output
    • setActiveOutput

      public void setActiveOutput(int activeOutput) throws DeviceException
      Sets the output to be controlled by GDA between 1 and 4

      Switching active output does not switch off other outputs it just changes which output GDA is talking to.

      Parameters:
      activeOutput - The output to control
      Throws:
      DeviceException
    • outputOff

      public void outputOff() throws DeviceException
      Switches off the currently active output
      Throws:
      DeviceException
    • allOutputsOff

      public void allOutputsOff() throws DeviceException
      Switches off all the outputs
      Throws:
      DeviceException