Bases: ConnectionSerial
Flow and Pressure controller, PR4000B, from MKS Instruments.
The default settings for the RS232 connection are:
Baud rate = 9600
Data bits = 7
Stop bits = 1
Parity = ODD
Flow control = None
The baud rate and parity can be changed on the controller. The data bits,
stop bits, and flow control cannot be changed. A null modem (cross over)
cable is required when using a USB to RS232 converter. RS485 support is
not implemented.
Do not instantiate this class directly. Use the connect()
method to connect to the equipment.
- Parameters:
record (EquipmentRecord
) – A record from an Equipment-Register Database.
-
ERROR_CODES = {'#E001': 'Communication Error', '#E002': 'ADC Overflow or Underflow', '#E003': 'Range Error, Setpoint < 0 or out of range', '#E010': 'Syntax Error', '#E020': 'Failed to execute command', '#W001': 'Offset > 250 mV'}
-
UNITS = {0: 'ubar', 1: 'mbar', 2: 'bar', 3: 'mTor', 4: 'Torr', 5: 'KTor', 6: 'Pa', 7: 'kPa', 8: 'mH2O', 9: 'cH2O', 10: 'PSI', 11: 'N/qm', 12: 'SCCM', 13: 'SLM', 14: 'SCM', 15: 'SCFH', 16: 'SCFM', 17: 'mA', 18: 'V', 19: '%', 20: 'C'}
-
SIGNAL_MODES = {0: 'METER', 1: 'OFF', 2: 'INDEP', 3: 'EXTRN', 4: 'SLAVE', 5: 'RTD'}
-
LIMIT_MODES = {0: 'SLEEP', 1: 'LIMIT', 2: 'BAND', 3: 'MLIMIT', 4: 'MBAND'}
-
TAGS = {0: 'SP', 1: 'VA', 2: 'CH', 3: 'FL', 4: 'PR', 5: 'EX'}
-
auto_zero(channel)[source]
Auto zero a channel
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
int
– The offset.
-
default(mode)[source]
Reset to the default configuration.
- Parameters:
mode (str
) – The mode to reset. One of Pressure
, Flow
, P
or F
(case insensitive).
-
displays_enable(display, enable)[source]
Turn a display on or off.
- Parameters:
display (int
) – The display number [1, 4].
enable (bool
) – Whether to turn the display on, True
, or off, False
.
-
displays_setup(display, line, tag, channel)[source]
Configure a display.
- Parameters:
display (int
) – The display number [1, 4].
line (int
) – The line number, 1 or 2.
tag (int
or str
) – The tag to use (0=SP, 1=VA, 2=CH, 3=FL, 4=PR, 5=EX). For example,
setting tag to 4 or 'PR'
are equivalent.
channel (int
) – The channel, either 1 or 2.
-
display_4(enable)[source]
Whether to enable or disable display 4.
- Parameters:
enable (bool
) – Whether to enable or disable display 4.
-
external_input(channel)[source]
Return the external input of a channel
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
float
– The external input.
-
get_access_channel(channel)[source]
Get the setpoint and the state of the valve of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
-
-
get_actual_value(channel)[source]
Get the actual value of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
float
– The value.
-
get_address()[source]
Get the address.
- Returns:
int
– The address.
-
get_dead_band(channel)[source]
Get the dead band of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
float
– The dead band.
-
get_dialog()[source]
Get the current dialog index that is displayed.
- Returns:
int
– The dialog index.
-
get_display_text()[source]
Get the display text.
- Returns:
str
– The display text.
-
get_external_input_range(channel)[source]
Get the external input range of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
int
– The external input range.
-
get_external_output_range(channel)[source]
Get the external output range of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
int
– The external output range.
-
get_formula_relay(channel)[source]
Get the relay formula of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
str
– The formula.
-
get_formula_temporary(channel)[source]
Get the temporary formula of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
str
– The formula.
-
get_gain(channel)[source]
Get the gain of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
float
– The gain.
-
get_input_range(channel)[source]
Get the input range of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
int
– The input range.
-
get_interface_mode()[source]
Get the interface mode.
- Returns:
int
– The interface mode.
-
get_limit_mode(channel)[source]
Get the limit mode of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
-
-
get_linearization_point(channel, point)[source]
Get the point in the linearization table of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
point (int
) – The point in the table [0, 10].
- Returns:
-
-
get_linearization_size(channel)[source]
Get the size of the linearization table of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
int
– The size of the table.
-
get_lower_limit(channel)[source]
Get the lower limit of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
float
– The lower limit.
-
get_offset(channel)[source]
Get the offset of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
int
– The offset.
-
get_output_range(channel)[source]
Get the output range of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
int
– The output range.
-
get_range(channel)[source]
Get the range and unit of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
float
– The range.
int
– The unit index.
str
– The unit name.
-
get_relays(channel)[source]
Get the relay state of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
bool
– Whether the relay is enabled or disabled.
-
get_remote_mode()[source]
Get the remote operation mode.
- Returns:
bool
– Whether the remote operation mode is enabled, True
,
or disabled, False
.
-
get_resolution()[source]
Get whether 16-bit resolution is enabled.
- Returns:
bool
– Whether 16-bit resolution is enabled, True
, or disabled, False
.
-
get_rtd_offset(channel)[source]
Get the RTD offset of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
int
– The offset.
-
get_scale(channel)[source]
Get the scale of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
float
– The scale.
-
get_setpoint(channel)[source]
Get the setpoint of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
float
– The setpoint.
-
get_signal_mode(channel)[source]
Get the signal mode of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
-
-
get_upper_limit(channel)[source]
Get the upper limit of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
float
– The upper limit.
-
get_valves(channel)[source]
Get the state of the valve of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
- Returns:
bool
– Whether the valve is enabled or disabled.
-
identity()[source]
Returns the identity.
- Returns:
str
– The identity (e.g., PR42vvrrsssss
, where vv is the version,
rr is the release and sssss is the serial number).
-
lock()[source]
Lock setup.
-
request_key()[source]
Requests most recent key that was pressed.
- Returns:
-
-
reset_status()[source]
Send the reset/status command.
-
set_access_channel(channel, setpoint, valve)[source]
Set the setpoint and the state of the valve for a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
setpoint (float
) – The setpoint value.
valve (bool
) – Whether to enable or disable the valve.
- Returns:
float
– The actual setpoint value.
-
set_actual_value(channel, setpoint)[source]
Set the actual value of a particular channel.
- Parameters:
-
- Returns:
float
– The actual value.
-
set_address(address)[source]
Set the address.
- Parameters:
address (int
) – The address [0, 31].
-
set_dead_band(channel, band)[source]
Set the dead band of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
band (float
) – The dead band [0.0% to 9.9% of full scale].
-
set_dialog(index)[source]
Set the display dialog.
- Parameters:
index (int
) – The dialog index (between 0 and 29 inclusive). See Appendix D
of the manual for more information.
-
set_display_text(text, clear=True)[source]
Set the display text.
To view the text on the display you must call set_dialog()
with the index equal to 3.
- Parameters:
text (str
) – The text to display. Maximum 32 characters.
clear (bool
, optional) – Whether to clear the current display text before setting the new text.
-
set_external_input_range(channel, range)[source]
Set the external input range of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
range (int
) – The external input range [1, 10] in Volts.
-
set_external_output_range(channel, range)[source]
Set the external output range of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
range (int
) – The external output range [1, 10] in Volts.
-
set_formula_relay(channel, formula)[source]
Set the relay formula of a particular channel.
- Parameters:
-
-
set_formula_temporary(channel, formula)[source]
Set the temporary formula of a particular channel.
- Parameters:
-
-
set_gain(channel, gain)[source]
Set the gain of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
gain (float
) – The gain [0.001, 2.000].
-
set_input_range(channel, range)[source]
Set the input range of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
range (int
) – The input range [1, 10] in Volts.
-
set_interface_mode(mode)[source]
Set the interface mode.
- Parameters:
mode (int
) – The interface mode.
-
set_limit_mode(channel, mode)[source]
Set the limit mode of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
mode (int
or str
) – The limit mode as either an index number [0, 4] or a name (e.g., SLEEP
).
-
set_linearization_point(channel, point, x, y)[source]
Set a point in the linearization table of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
point (int
) – The point in the table [0, 10].
x (float
) – The x value [-5% to 100% of full scale].
y (float
) – The y value [-5% to 100% of full scale].
-
set_linearization_size(channel, size)[source]
Set the size of the linearization table of a particular channel.
- Parameters:
-
-
set_lower_limit(channel, limit)[source]
Set the lower limit of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
limit (float
) – The lower limit [-5% to 110% of full scale].
-
set_offset(channel, offset)[source]
Set the offset of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
offset (int
) – The offset [-250, 250].
-
set_output_range(channel, range)[source]
Set the output range of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
range (int
) – The output range [1, 10] in Volts.
-
set_range(channel, range, unit)[source]
Set the range and unit of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
range (float
) – The range value.
unit (int
or str
) – The unit as either an index number [0, 20] or a name (e.g., kPa
).
-
set_relays(channel, enable)[source]
Set the relay state of a channel.
- Parameters:
-
-
set_remote_mode(enable)[source]
Set the remote operation mode to be enable or disabled.
- Parameters:
enable (bool
) – Whether to enable or disable remote operation.
-
set_resolution(enable)[source]
Set the 16-bit resolution to be enable or disabled.
- Parameters:
enable (bool
) – Whether to enable or disable 16-bit resolution.
-
set_rtd_offset(channel, offset)[source]
Set the RTD offset of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
offset (int
) – The RTD offset [-250, 250].
-
set_scale(channel, scale)[source]
Set the scale of a particular channel.
- Parameters:
-
-
set_setpoint(channel, setpoint)[source]
Set the setpoint of a particular channel.
- Parameters:
-
-
set_signal_mode(channel, mode)[source]
Set the range and unit of a channel.
- Parameters:
-
-
set_tweak_control(enable)[source]
Set tweak control.
- Parameters:
enable (bool
) – Whether to switch tweak control on or off.
-
set_upper_limit(channel, limit)[source]
Set the upper limit of a particular channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
limit (float
) – The upper limit [-5% to 110% of full scale].
-
set_valves(channel, enable)[source]
Set the state of the valve of a channel.
- Parameters:
channel (int
) – The channel, either 1 or 2.
-
status()[source]
Request status bits.
- Returns:
-
-
unlock()[source]
Unlock setup.