BakeoutController  0.1
A Controller for the Omicron vacuum chamber
Public Member Functions | List of all members
devices.TDKLambdaPowerSupply Class Reference
Inheritance diagram for devices.TDKLambdaPowerSupply:
Inheritance graph
[legend]
Collaboration diagram for devices.TDKLambdaPowerSupply:
Collaboration graph
[legend]

Public Member Functions

 TDKLambdaPowerSupply (String deviceName, PortCommunicator portCommunicator, int deviceAddress) throws IOException
 
String getName ()
 
int getDeviceAddress ()
 
Double getVoltage () throws IOException
 
void setVoltage (double newVoltage) throws IOException
 
void reset () throws IOException
 
Double getCurrent () throws IOException
 
void setCurrent (double newCurrent) throws IOException
 
void outputOff () throws IOException
 
void outputOn () throws IOException
 

Additional Inherited Members

- Public Attributes inherited from devices.PowerSupply
String GET_ADDRESS_COMMAND = "ADR %d\r"
 
String GET_VOLTAGE_COMMAND = "PV?\r"
 
String SET_VOLTAGE_COMMAND = "PV %.3f\r"
 
String GET_CURRENT_COMMAND = "PC?\r"
 
String SET_CURRENT_COMMAND = "PC %.3f\r"
 
String SET_OUTPUT_COMMAND = "OUT %s\r"
 
String RESET_COMMAND = "RST\r"
 
String OK_RESPONSE = "OK"
 
String OFF = "0"
 
String ON = "1"
 

Detailed Description

Contains methods for working with the power supply

Definition at line 11 of file TDKLambdaPowerSupply.java.

Constructor & Destructor Documentation

devices.TDKLambdaPowerSupply.TDKLambdaPowerSupply ( String  deviceName,
PortCommunicator  portCommunicator,
int  deviceAddress 
) throws IOException

Constructs an instance of the power supply, and places the device into a state where it's capable of accepting remote commands. For the TDK Lambda power supply, this means the "ADR" command must be sent to the device with its matching address. This command must return an "OK" response.

Parameters
deviceNameThe name of the device
portCommunicatorA tool capable of communicating with the device
deviceAddressAn integer representing the address of the device on the given port
Exceptions
IOExceptionIf the device cannot be initialized

Definition at line 31 of file TDKLambdaPowerSupply.java.

34  {
35  super(deviceName, portCommunicator);
36  this.deviceAddress = deviceAddress;
37  this.startDevice();
38  }

Member Function Documentation

Double devices.TDKLambdaPowerSupply.getCurrent ( ) throws IOException
Returns
The currently-set value of the current that the device is to output
Exceptions
IOExceptionif the current value cannot be retrieved from the device

Implements devices.PowerSupply.

Definition at line 88 of file TDKLambdaPowerSupply.java.

88  {
89  return this.writeWithDoubleResponse(GET_CURRENT_COMMAND);
90  }
int devices.TDKLambdaPowerSupply.getDeviceAddress ( )
Returns
The address of the device

Implements devices.PowerSupply.

Definition at line 50 of file TDKLambdaPowerSupply.java.

50  {
51  return this.deviceAddress;
52  }
String devices.TDKLambdaPowerSupply.getName ( )
Returns
The name of the device

Implements devices.NamedDevice.

Definition at line 43 of file TDKLambdaPowerSupply.java.

43  {
44  return deviceName;
45  }
Double devices.TDKLambdaPowerSupply.getVoltage ( ) throws IOException
Returns
The voltage that the device is currently set to output
Exceptions
IOExceptionif the command to get this value cannot be written

Implements devices.PowerSupply.

Definition at line 58 of file TDKLambdaPowerSupply.java.

58  {
59  return this.writeWithDoubleResponse(GET_VOLTAGE_COMMAND);
60  }
void devices.TDKLambdaPowerSupply.outputOff ( ) throws IOException

Turn off the device output

Exceptions
IOExceptionIf the command to turn the device off could not be sent

Implements devices.PowerSupply.

Definition at line 109 of file TDKLambdaPowerSupply.java.

109  {
110  String commandToWrite = String.format(
111  PowerSupply.SET_OUTPUT_COMMAND, PowerSupply.OFF
112  );
113 
114  this.writeWithOKResponse(commandToWrite);
115  }
void devices.TDKLambdaPowerSupply.outputOn ( ) throws IOException

Turn the device output on

Exceptions
IOExceptionIf the command to turn the power supply on could not be sent

Implements devices.PowerSupply.

Definition at line 122 of file TDKLambdaPowerSupply.java.

122  {
123  String command = String.format(
124  PowerSupply.SET_OUTPUT_COMMAND, PowerSupply.ON
125  );
126 
127  this.writeWithOKResponse(command);
128  }
void devices.TDKLambdaPowerSupply.reset ( ) throws IOException

Bring the device to a safe, known state.

Exceptions
IOExceptionIf this cannot be done

Implements devices.PowerSupply.

Definition at line 78 of file TDKLambdaPowerSupply.java.

78  {
79  this.writeWithOKResponse(RESET_COMMAND);
80  }
void devices.TDKLambdaPowerSupply.setCurrent ( double  newCurrent) throws IOException
Parameters
newCurrentThe current in Amperes, to set the device to
Exceptions
IOExceptionIf the command to set the current cannot be sent

Implements devices.PowerSupply.

Definition at line 96 of file TDKLambdaPowerSupply.java.

96  {
97  String commandToWrite = String.format(
98  PowerSupply.SET_CURRENT_COMMAND, newCurrent
99  );
100 
101  this.writeWithOKResponse(commandToWrite);
102  }
void devices.TDKLambdaPowerSupply.setVoltage ( double  newVoltage) throws IOException
Parameters
newVoltageThe voltage to which the device output is to be set
Exceptions
IOExceptionIf the command to set this voltage could not be sent to the device

Implements devices.PowerSupply.

Definition at line 67 of file TDKLambdaPowerSupply.java.

67  {
68  String commandToWrite = String.format(
69  PowerSupply.SET_VOLTAGE_COMMAND, newVoltage
70  );
71  this.writeWithOKResponse(commandToWrite);
72  }

The documentation for this class was generated from the following file:
Git Repo