BakeoutController-Basic  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 (PortCommunicator portCommunicator, int deviceAddress) throws IOException
 
int getDeviceAddress ()
 
Double getVoltage () throws IOException
 
Double getMeasuredVoltage () 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"
 
String GET_MEASURED_VOLTAGE_COMMAND = "MV?\r"
 

Detailed Description

Contains methods for working with the power supply

Definition at line 15 of file TDKLambdaPowerSupply.java.

Constructor & Destructor Documentation

devices.TDKLambdaPowerSupply.TDKLambdaPowerSupply ( 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
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 49 of file TDKLambdaPowerSupply.java.

52  {
53  super(portCommunicator);
54  this.deviceAddress = deviceAddress;
55  this.startDevice();
56  }

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 107 of file TDKLambdaPowerSupply.java.

107  {
108  return this.writeWithDoubleResponse(GET_CURRENT_COMMAND);
109  }
int devices.TDKLambdaPowerSupply.getDeviceAddress ( )
Returns
The address of the device

Implements devices.PowerSupply.

Definition at line 61 of file TDKLambdaPowerSupply.java.

61  {
62  return this.deviceAddress;
63  }
Double devices.TDKLambdaPowerSupply.getMeasuredVoltage ( ) throws IOException
Returns
The currently-measured voltage going out of the power supply
Exceptions
IOExceptionIf the command cannot be written

Implements devices.PowerSupply.

Definition at line 77 of file TDKLambdaPowerSupply.java.

77  {
78  return this.writeWithDoubleResponse(GET_MEASURED_VOLTAGE_COMMAND);
79  }
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 69 of file TDKLambdaPowerSupply.java.

69  {
70  return this.writeWithDoubleResponse(GET_VOLTAGE_COMMAND);
71  }
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 128 of file TDKLambdaPowerSupply.java.

128  {
129  String commandToWrite = String.format(
130  PowerSupply.SET_OUTPUT_COMMAND, PowerSupply.OFF
131  );
132 
133  this.writeWithOKResponse(commandToWrite);
134  }
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 141 of file TDKLambdaPowerSupply.java.

141  {
142  String command = String.format(
143  PowerSupply.SET_OUTPUT_COMMAND, PowerSupply.ON
144  );
145 
146  this.writeWithOKResponse(command);
147  }
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 97 of file TDKLambdaPowerSupply.java.

97  {
98  this.writeWithOKResponse(RESET_COMMAND);
99  }
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 115 of file TDKLambdaPowerSupply.java.

115  {
116  String commandToWrite = String.format(
117  PowerSupply.SET_CURRENT_COMMAND, newCurrent
118  );
119 
120  this.writeWithOKResponse(commandToWrite);
121  }
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 86 of file TDKLambdaPowerSupply.java.

86  {
87  String commandToWrite = String.format(
88  PowerSupply.SET_VOLTAGE_COMMAND, newVoltage
89  );
90  this.writeWithOKResponse(commandToWrite);
91  }

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