Skip to content

PR4000B¤

PR4000B (Serial) ¤

PR4000B(equipment: Equipment)

              flowchart LR
              msl.equipment_resources.mks.pr4000b.PR4000B[PR4000B]
              msl.equipment.interfaces.serial.Serial[Serial]
              msl.equipment.interfaces.message_based.MessageBased[MessageBased]
              msl.equipment.schema.Interface[Interface]

                              msl.equipment.interfaces.serial.Serial --> msl.equipment_resources.mks.pr4000b.PR4000B
                                msl.equipment.interfaces.message_based.MessageBased --> msl.equipment.interfaces.serial.Serial
                                msl.equipment.schema.Interface --> msl.equipment.interfaces.message_based.MessageBased
                




              click msl.equipment_resources.mks.pr4000b.PR4000B href "" "msl.equipment_resources.mks.pr4000b.PR4000B"
              click msl.equipment.interfaces.serial.Serial href "" "msl.equipment.interfaces.serial.Serial"
              click msl.equipment.interfaces.message_based.MessageBased href "" "msl.equipment.interfaces.message_based.MessageBased"
              click msl.equipment.schema.Interface href "" "msl.equipment.schema.Interface"
            

Flow and Pressure controller, PR4000B, from MKS Instruments.

The default settings for the RS232 connection are:

  • Baud rate: 9600
  • Parity: ODD
  • Data bits: 7
  • Stop bits: 1
  • 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.

Regular-expression patterns that are used to select this Resource when connect() is called.

manufacturer=r"^MKS"
model=r"PR4000B"
flags=IGNORECASE

Parameters:

Name Type Description Default
equipment Equipment

An Equipment instance..

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
def __init__(self, equipment: Equipment) -> None:
    """Flow and Pressure controller, PR4000B, from [MKS](https://www.mks.com/) Instruments.

    The default settings for the RS232 connection are:

    * Baud rate: 9600
    * Parity: ODD
    * Data bits: 7
    * Stop bits: 1
    * 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.

    Regular-expression patterns that are used to select this Resource when
    [connect()][msl.equipment.schema.Equipment.connect] is called.
    ```python
    manufacturer=r"^MKS"
    model=r"PR4000B"
    flags=IGNORECASE
    ```

    Args:
        equipment: An [Equipment][] instance..
    """
    assert equipment.connection is not None  # noqa: S101
    equipment.connection.properties.setdefault("data_bits", DataBits.SEVEN)
    super().__init__(equipment)
    self.read_termination: bytes = b"\r"
    self.write_termination: bytes = b"\r"

auto_zero ¤

auto_zero(channel: Literal[1, 2]) -> int

Auto zero a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
int

The offset.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
177
178
179
180
181
182
183
184
185
186
187
def auto_zero(self, channel: Literal[1, 2]) -> int:
    """Auto zero a channel.

    Args:
        channel: The channel number.

    Returns:
        The offset.
    """
    self._check_channel(channel)
    return int(self.query(f"AZ{channel}"))

default ¤

default(mode: Literal['pressure', 'p', 'flow', 'f']) -> None

Reset to the default configuration.

Parameters:

Name Type Description Default
mode Literal['pressure', 'p', 'flow', 'f']

The mode to reset.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
189
190
191
192
193
194
195
196
197
198
199
200
def default(self, mode: Literal["pressure", "p", "flow", "f"]) -> None:
    """Reset to the default configuration.

    Args:
        mode: The mode to reset.
    """
    upper = mode.upper()
    if upper not in {"P", "F", "PRESSURE", "FLOW"}:
        msg = f"Invalid default mode {mode!r}, must one of: pressure, flow, p or f"
        raise ValueError(msg)

    _ = self._check(f"DF,{upper[0]}")

display_4 ¤

display_4(*, enable: bool) -> None

Whether to enable or disable display 4.

Parameters:

Name Type Description Default
enable bool

Whether to enable or disable display 4.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
240
241
242
243
244
245
246
247
def display_4(self, *, enable: bool) -> None:
    """Whether to enable or disable display 4.

    Args:
        enable: Whether to enable or disable display 4.
    """
    state = "ON" if enable else "OFF"
    _ = self._check(f"DP4,{state}")

display_enable ¤

display_enable(display: Literal[1, 2, 3, 4], *, enable: bool) -> None

Turn a display on or off.

Parameters:

Name Type Description Default
display Literal[1, 2, 3, 4]

The display number.

required
enable bool

Whether to turn the display on (True) or off (False).

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
202
203
204
205
206
207
208
209
210
211
212
213
214
def display_enable(self, display: Literal[1, 2, 3, 4], *, enable: bool) -> None:
    """Turn a display on or off.

    Args:
        display: The display number.
        enable: Whether to turn the display on (`True`) or off (`False`).
    """
    if display not in {1, 2, 3, 4}:
        msg = f"Invalid display number {display}, must be 1, 2, 3 or 4"
        raise ValueError(msg)

    state = "ON" if enable else "OFF"
    _ = self._check(f"DP{display},{state}")

display_setup ¤

display_setup(
    display: Literal[1, 2, 3, 4],
    line: Literal[1, 2],
    channel: Literal[1, 2],
    tag: int | str | Tag,
) -> None

Configure a display.

Parameters:

Name Type Description Default
display Literal[1, 2, 3, 4]

The display number.

required
line Literal[1, 2]

The line number.

required
channel Literal[1, 2]

The channel number.

required
tag int | str | Tag

The tag to use. Can be a Tag member name or value. For example, Tag.PR, 4, or "PR" are equivalent.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
def display_setup(
    self, display: Literal[1, 2, 3, 4], line: Literal[1, 2], channel: Literal[1, 2], tag: int | str | Tag
) -> None:
    """Configure a display.

    Args:
        display: The display number.
        line: The line number.
        channel: The channel number.
        tag: The tag to use. Can be a [Tag][msl.equipment_resources.mks.pr4000b.Tag] member name or value.
            For example, `Tag.PR`, `4`, or `"PR"` are equivalent.
    """
    if display not in {1, 2, 3, 4}:
        msg = f"Invalid display number {display}, must be 1, 2, 3 or 4"
        raise ValueError(msg)

    if line not in {1, 2}:
        msg = f"Invalid line number {line}, must be 1 or 2"
        raise ValueError(msg)

    self._check_channel(channel)
    tag = to_enum(tag, Tag, to_upper=True)
    _ = self._check(f"DP{display},{line},{tag},{channel}")

external_input ¤

external_input(channel: Literal[1, 2]) -> float

Return the external input of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
float

The external input.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
249
250
251
252
253
254
255
256
257
258
259
def external_input(self, channel: Literal[1, 2]) -> float:
    """Return the external input of a channel.

    Args:
        channel: The channel number.

    Returns:
        The external input.
    """
    self._check_channel(channel)
    return float(self.query(f"EX{channel}"))

get_access_channel ¤

get_access_channel(channel: Literal[1, 2]) -> tuple[float, bool]

Get the setpoint and the state of the valve of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
tuple[float, bool]

The setpoint value and whether the valve is on (True) or off (False).

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
261
262
263
264
265
266
267
268
269
270
271
272
def get_access_channel(self, channel: Literal[1, 2]) -> tuple[float, bool]:
    """Get the setpoint and the state of the valve of a channel.

    Args:
        channel: The channel number.

    Returns:
        The setpoint value and whether the valve is on (`True`) or off (`False`).
    """
    self._check_channel(channel)
    a, b = self.query(f"?AC{channel}").rstrip().split(",")
    return float(a), b == "ON"

get_actual_value ¤

get_actual_value(channel: Literal[1, 2]) -> float

Get the actual value of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
float

The value.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
274
275
276
277
278
279
280
281
282
283
284
def get_actual_value(self, channel: Literal[1, 2]) -> float:
    """Get the actual value of a channel.

    Args:
        channel: The channel number.

    Returns:
        The value.
    """
    self._check_channel(channel)
    return float(self.query(f"AV{channel}"))

get_address ¤

get_address() -> int

Get the address.

Returns:

Type Description
int

The address.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
286
287
288
289
290
291
292
def get_address(self) -> int:
    """Get the address.

    Returns:
        The address.
    """
    return int(self.query("?AD"))

get_dead_band ¤

get_dead_band(channel: Literal[1, 2]) -> float

Get the dead band of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
float

The dead band.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
294
295
296
297
298
299
300
301
302
303
304
def get_dead_band(self, channel: Literal[1, 2]) -> float:
    """Get the dead band of a channel.

    Args:
        channel: The channel number.

    Returns:
        The dead band.
    """
    self._check_channel(channel)
    return float(self.query(f"?DB{channel}"))

get_dialog ¤

get_dialog() -> int

Get the current dialog index that is displayed.

Returns:

Type Description
int

The dialog index.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
306
307
308
309
310
311
312
def get_dialog(self) -> int:
    """Get the current dialog index that is displayed.

    Returns:
        The dialog index.
    """
    return int(self.query("?DG"))

get_display_text ¤

get_display_text() -> str

Get the display text.

Returns:

Type Description
str

The display text.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
314
315
316
317
318
319
320
def get_display_text(self) -> str:
    """Get the display text.

    Returns:
        The display text.
    """
    return self.query("?DT").rstrip()

get_external_input_range ¤

get_external_input_range(channel: Literal[1, 2]) -> int

Get the external input range of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
int

The external input range.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
322
323
324
325
326
327
328
329
330
331
332
def get_external_input_range(self, channel: Literal[1, 2]) -> int:
    """Get the external input range of a channel.

    Args:
        channel: The channel number.

    Returns:
        The external input range.
    """
    self._check_channel(channel)
    return int(self.query(f"?EI{channel}"))

get_external_output_range ¤

get_external_output_range(channel: Literal[1, 2]) -> int

Get the external output range of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
int

The external output range.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
334
335
336
337
338
339
340
341
342
343
344
def get_external_output_range(self, channel: Literal[1, 2]) -> int:
    """Get the external output range of a channel.

    Args:
        channel: The channel number.

    Returns:
        The external output range.
    """
    self._check_channel(channel)
    return int(self.query(f"?EO{channel}"))

get_formula_relay ¤

get_formula_relay(channel: Literal[1, 2]) -> str

Get the relay formula of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
str

The formula.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
346
347
348
349
350
351
352
353
354
355
356
def get_formula_relay(self, channel: Literal[1, 2]) -> str:
    """Get the relay formula of a channel.

    Args:
        channel: The channel number.

    Returns:
        The formula.
    """
    self._check_channel(channel)
    return self.query(f"?FR{channel}").strip()

get_formula_temporary ¤

get_formula_temporary(channel: Literal[1, 2]) -> str

Get the temporary formula of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
str

The formula.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
358
359
360
361
362
363
364
365
366
367
368
def get_formula_temporary(self, channel: Literal[1, 2]) -> str:
    """Get the temporary formula of a channel.

    Args:
        channel: The channel number.

    Returns:
        The formula.
    """
    self._check_channel(channel)
    return self.query(f"?FT{channel}").strip()

get_gain ¤

get_gain(channel: Literal[1, 2]) -> float

Get the gain of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
float

The gain.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
370
371
372
373
374
375
376
377
378
379
380
def get_gain(self, channel: Literal[1, 2]) -> float:
    """Get the gain of a channel.

    Args:
        channel: The channel number.

    Returns:
        The gain.
    """
    self._check_channel(channel)
    return float(self.query(f"?GN{channel}"))

get_input_range ¤

get_input_range(channel: Literal[1, 2]) -> int

Get the input range of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
int

The input range.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
382
383
384
385
386
387
388
389
390
391
392
def get_input_range(self, channel: Literal[1, 2]) -> int:
    """Get the input range of a channel.

    Args:
        channel: The channel number.

    Returns:
        The input range.
    """
    self._check_channel(channel)
    return int(self.query(f"?IN{channel}"))

get_interface_mode ¤

get_interface_mode() -> int

Get the interface mode.

Returns:

Type Description
int

The interface mode.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
394
395
396
397
398
399
400
def get_interface_mode(self) -> int:
    """Get the interface mode.

    Returns:
        The interface mode.
    """
    return int(self.query("?IM"))

get_limit_mode ¤

get_limit_mode(channel: Literal[1, 2]) -> LimitMode

Get the limit mode of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
LimitMode

The limit mode.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
402
403
404
405
406
407
408
409
410
411
412
413
def get_limit_mode(self, channel: Literal[1, 2]) -> LimitMode:
    """Get the limit mode of a channel.

    Args:
        channel: The channel number.

    Returns:
        The limit mode.
    """
    self._check_channel(channel)
    mode = int(self.query(f"?LM{channel}"))
    return LimitMode(mode)

get_linearization_point ¤

get_linearization_point(
    channel: Literal[1, 2], point: int
) -> tuple[float, float]

Get the point in the linearization table of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
point int

The point in the table [0, 10].

required

Returns:

Type Description
tuple[float, float]

The (x, y) point.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
def get_linearization_point(self, channel: Literal[1, 2], point: int) -> tuple[float, float]:
    """Get the point in the linearization table of a channel.

    Args:
        channel: The channel number.
        point: The point in the table [0, 10].

    Returns:
        The `(x, y)` point.
    """
    self._check_channel(channel)
    if point < 0 or point > MAX_POINT:
        msg = f"Invalid point {point}, must be between [0, 10]"
        raise ValueError(msg)
    a, b = self.query(f"?LN{channel},{point}").split(",")
    return float(a), float(b)

get_linearization_size ¤

get_linearization_size(channel: Literal[1, 2]) -> int

Get the size of the linearization table of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
int

The size of the table.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
432
433
434
435
436
437
438
439
440
441
442
def get_linearization_size(self, channel: Literal[1, 2]) -> int:
    """Get the size of the linearization table of a channel.

    Args:
        channel: The channel number.

    Returns:
        The size of the table.
    """
    self._check_channel(channel)
    return int(self.query(f"?LS{channel}"))

get_lower_limit ¤

get_lower_limit(channel: Literal[1, 2]) -> float

Get the lower limit of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
float

The lower limit.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
444
445
446
447
448
449
450
451
452
453
454
def get_lower_limit(self, channel: Literal[1, 2]) -> float:
    """Get the lower limit of a channel.

    Args:
        channel: The channel number.

    Returns:
        The lower limit.
    """
    self._check_channel(channel)
    return float(self.query(f"?LL{channel}"))

get_offset ¤

get_offset(channel: Literal[1, 2]) -> int

Get the offset of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
int

The offset.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
456
457
458
459
460
461
462
463
464
465
466
def get_offset(self, channel: Literal[1, 2]) -> int:
    """Get the offset of a channel.

    Args:
        channel: The channel number.

    Returns:
        The offset.
    """
    self._check_channel(channel)
    return int(self.query(f"?OF{channel}"))

get_output_range ¤

get_output_range(channel: Literal[1, 2]) -> int

Get the output range of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
int

The output range.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
468
469
470
471
472
473
474
475
476
477
478
def get_output_range(self, channel: Literal[1, 2]) -> int:
    """Get the output range of a channel.

    Args:
        channel: The channel number.

    Returns:
        The output range.
    """
    self._check_channel(channel)
    return int(self.query(f"?OT{channel}"))

get_range ¤

get_range(channel: Literal[1, 2]) -> tuple[float, int, str]

Get the range and unit of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
tuple[float, int, str]

The range, unit index and unit name.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
480
481
482
483
484
485
486
487
488
489
490
491
492
def get_range(self, channel: Literal[1, 2]) -> tuple[float, int, str]:
    """Get the range and unit of a channel.

    Args:
        channel: The channel number.

    Returns:
        The range, unit index and unit name.
    """
    self._check_channel(channel)
    a, b = self.query(f"?RG{channel}").split(",")
    unit = int(b)
    return float(a), unit, UNIT[unit]

get_relays ¤

get_relays(channel: Literal[1, 2]) -> bool

Get the relay state of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
bool

Whether the relay is enabled or disabled.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
494
495
496
497
498
499
500
501
502
503
504
def get_relays(self, channel: Literal[1, 2]) -> bool:
    """Get the relay state of a channel.

    Args:
        channel: The channel number.

    Returns:
        Whether the relay is enabled or disabled.
    """
    self._check_channel(channel)
    return self.query(f"?RL{channel}").rstrip() == "ON"

get_remote_mode ¤

get_remote_mode() -> bool

Get the remote operation mode.

Returns:

Type Description
bool

Whether the remote operation mode is enabled (True) or disabled (False).

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
506
507
508
509
510
511
512
def get_remote_mode(self) -> bool:
    """Get the remote operation mode.

    Returns:
        Whether the remote operation mode is enabled (`True`) or disabled (`False`).
    """
    return self.query("?RT").rstrip() == "ON"

get_resolution ¤

get_resolution() -> bool

Get whether 16-bit resolution is enabled.

Returns:

Type Description
bool

Whether 16-bit resolution is enabled (True) or disabled (False).

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
514
515
516
517
518
519
520
def get_resolution(self) -> bool:
    """Get whether 16-bit resolution is enabled.

    Returns:
        Whether 16-bit resolution is enabled (`True`) or disabled (`False`).
    """
    return self.query("?RS").rstrip() == "ON"

get_rtd_offset ¤

get_rtd_offset(channel: Literal[1, 2]) -> int

Get the RTD offset of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
int

The offset.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
522
523
524
525
526
527
528
529
530
531
532
def get_rtd_offset(self, channel: Literal[1, 2]) -> int:
    """Get the RTD offset of a channel.

    Args:
        channel: The channel number.

    Returns:
        The offset.
    """
    self._check_channel(channel)
    return int(self.query(f"?RO{channel}"))

get_scale ¤

get_scale(channel: Literal[1, 2]) -> float

Get the scale of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
float

The scale.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
534
535
536
537
538
539
540
541
542
543
def get_scale(self, channel: Literal[1, 2]) -> float:
    """Get the scale of a channel.

    Args:
        channel: The channel number.

    Returns:
        The scale.
    """
    return float(self.query(f"?SC{channel}"))

get_setpoint ¤

get_setpoint(channel: Literal[1, 2]) -> float

Get the setpoint of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
float

The setpoint.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
545
546
547
548
549
550
551
552
553
554
555
def get_setpoint(self, channel: Literal[1, 2]) -> float:
    """Get the setpoint of a channel.

    Args:
        channel: The channel number.

    Returns:
        The setpoint.
    """
    self._check_channel(channel)
    return float(self.query(f"?SP{channel}"))

get_signal_mode ¤

get_signal_mode(channel: Literal[1, 2]) -> SignalMode

Get the signal mode of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
SignalMode

The signal mode.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
557
558
559
560
561
562
563
564
565
566
567
568
def get_signal_mode(self, channel: Literal[1, 2]) -> SignalMode:
    """Get the signal mode of a channel.

    Args:
        channel: The channel number.

    Returns:
        The signal mode.
    """
    self._check_channel(channel)
    mode = int(self.query(f"?SM{channel}"))
    return SignalMode(mode)

get_upper_limit ¤

get_upper_limit(channel: Literal[1, 2]) -> float

Get the upper limit of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
float

The upper limit.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
570
571
572
573
574
575
576
577
578
579
580
def get_upper_limit(self, channel: Literal[1, 2]) -> float:
    """Get the upper limit of a channel.

    Args:
        channel: The channel number.

    Returns:
        The upper limit.
    """
    self._check_channel(channel)
    return float(self.query(f"?UL{channel}"))

get_valve ¤

get_valve(channel: Literal[1, 2]) -> bool

Get the state of the valve of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required

Returns:

Type Description
bool

Whether the valve is enabled (True) or disabled (False).

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
582
583
584
585
586
587
588
589
590
591
592
def get_valve(self, channel: Literal[1, 2]) -> bool:
    """Get the state of the valve of a channel.

    Args:
        channel: The channel number.

    Returns:
        Whether the valve is enabled (`True`) or disabled (`False`).
    """
    self._check_channel(channel)
    return self.query(f"?VL{channel}").rstrip() == "ON"

identity ¤

identity() -> str

Returns the identity.

Returns:

Type Description
str

The identity. For example, PR42vvrrsssss, where vv is the version, rr is the release and sssss is the serial number.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
594
595
596
597
598
599
600
601
def identity(self) -> str:
    """Returns the identity.

    Returns:
        The identity. For example, `PR42vvrrsssss`, where `vv` is the version,
            `rr` is the release and `sssss` is the serial number.
    """
    return self.query("?ID").rstrip()

lock ¤

lock() -> None

Lock setup.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
603
604
605
def lock(self) -> None:
    """Lock setup."""
    _ = self._check("#1")

request_key ¤

request_key() -> tuple[int, int]

Requests most recent key that was pressed.

Returns:

Type Description
tuple[int, int]

The key that was most recently pressed and the number of key presses that occurred since the last time this method was called.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
607
608
609
610
611
612
613
614
615
def request_key(self) -> tuple[int, int]:
    """Requests most recent key that was pressed.

    Returns:
        The key that was most recently pressed and the number of key presses
            that occurred since the last time this method was called.
    """
    a, b = self.query("?KY").split(",")
    return int(a), int(b)

reset_status ¤

reset_status() -> None

Send the reset/status command.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
617
618
619
def reset_status(self) -> None:
    """Send the reset/status command."""
    _ = self._check("RE")

set_access_channel ¤

set_access_channel(
    channel: Literal[1, 2], setpoint: float, *, enable: bool
) -> float

Set the setpoint and the state of the valve for a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
setpoint float

The setpoint value.

required
enable bool

Whether to enable (True) or disable (False) the valve.

required

Returns:

Type Description
float

The actual setpoint value.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
621
622
623
624
625
626
627
628
629
630
631
632
633
634
def set_access_channel(self, channel: Literal[1, 2], setpoint: float, *, enable: bool) -> float:
    """Set the setpoint and the state of the valve for a channel.

    Args:
        channel: The channel number.
        setpoint: The setpoint value.
        enable: Whether to enable (`True`) or disable (`False`) the valve.

    Returns:
        The actual setpoint value.
    """
    self._check_channel(channel)
    state = "ON" if enable else "OFF"
    return float(self._check(f"AC{channel},{setpoint},{state}"))

set_actual_value ¤

set_actual_value(channel: Literal[1, 2], setpoint: float) -> float

Set the actual value of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
setpoint float

The setpoint.

required

Returns:

Type Description
float

The actual value.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
636
637
638
639
640
641
642
643
644
645
646
647
def set_actual_value(self, channel: Literal[1, 2], setpoint: float) -> float:
    """Set the actual value of a channel.

    Args:
        channel: The channel number.
        setpoint: The setpoint.

    Returns:
        The actual value.
    """
    self._check_channel(channel)
    return float(self.query(f"AV{channel},{setpoint}"))

set_address ¤

set_address(address: int) -> None

Set the address.

Parameters:

Name Type Description Default
address int

The address [0, 31].

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
649
650
651
652
653
654
655
656
657
658
659
def set_address(self, address: int) -> None:
    """Set the address.

    Args:
        address: The address [0, 31].
    """
    if address < 0 or address > 31:  # noqa: PLR2004
        msg = f"Invalid address {address}, must be between [0, 31]"
        raise ValueError(msg)

    _ = self._check(f"AD,{address}")

set_dead_band ¤

set_dead_band(channel: Literal[1, 2], band: float) -> None

Set the dead band of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
band float

The dead band (0.0% to 9.9% of full scale).

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
661
662
663
664
665
666
667
668
669
def set_dead_band(self, channel: Literal[1, 2], band: float) -> None:
    """Set the dead band of a channel.

    Args:
        channel: The channel number.
        band: The dead band (0.0% to 9.9% of full scale).
    """
    self._check_channel(channel)
    _ = self._check(f"DB{channel},{band}")

set_dialog ¤

set_dialog(index: int) -> None

Set the display dialog.

Parameters:

Name Type Description Default
index int

The dialog index [0, 29]. See Appendix D of the manual for more information.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
671
672
673
674
675
676
677
678
679
680
def set_dialog(self, index: int) -> None:
    """Set the display dialog.

    Args:
        index: The dialog index [0, 29]. See Appendix D of the manual for more information.
    """
    if index < 0 or index > 29:  # noqa: PLR2004
        msg = f"Invalid dialog index {index}, must be in the range [0, 29]"
        raise ValueError(msg)
    _ = self._check(f"DG,{index}")

set_display_text ¤

set_display_text(text: str, *, clear: bool = True) -> None

Set the display text.

To view the text on the display you must call set_dialog with the index equal to 3.

Parameters:

Name Type Description Default
text str

The text to display. Maximum 32 characters.

required
clear bool

Whether to clear the current display text before setting the new text.

True
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
def set_display_text(self, text: str, *, clear: bool = True) -> None:
    """Set the display text.

    To view the text on the display you must call
    [set_dialog][msl.equipment_resources.mks.pr4000b.PR4000B.set_dialog]
    with the index equal to 3.

    Args:
        text: The text to display. Maximum 32 characters.
        clear: Whether to clear the current display text before setting the new text.
    """
    if len(text) > 32:  # noqa: PLR2004
        msg = f"The display text must be <= 32 characters, got {text!r}"
        raise ValueError(msg)
    if clear:
        _ = self._check("!DT")
    _ = self._check(f"DT,{text}")

set_external_input_range ¤

set_external_input_range(channel: Literal[1, 2], range: int) -> None

Set the external input range of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
range int

The external input range [1, 10] in Volts.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
700
701
702
703
704
705
706
707
708
709
710
711
def set_external_input_range(self, channel: Literal[1, 2], range: int) -> None:  # noqa: A002
    """Set the external input range of a channel.

    Args:
        channel: The channel number.
        range: The external input range [1, 10] in Volts.
    """
    self._check_channel(channel)
    if range < 1 or range > MAX_RANGE:
        msg = f"Invalid external input range {range}"
        raise ValueError(msg)
    _ = self._check(f"EI{channel},{range}")

set_external_output_range ¤

set_external_output_range(channel: Literal[1, 2], range: int) -> None

Set the external output range of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
range int

The external output range [1, 10] in Volts.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
713
714
715
716
717
718
719
720
721
722
723
724
def set_external_output_range(self, channel: Literal[1, 2], range: int) -> None:  # noqa: A002
    """Set the external output range of a channel.

    Args:
        channel: The channel number.
        range: The external output range [1, 10] in Volts.
    """
    self._check_channel(channel)
    if range < 1 or range > MAX_RANGE:
        msg = f"Invalid external output range {range}"
        raise ValueError(msg)
    _ = self._check(f"EO{channel},{range}")

set_formula_relay ¤

set_formula_relay(channel: Literal[1, 2], formula: str) -> None

Set the relay formula of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
formula str

The relay formula.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
726
727
728
729
730
731
732
733
734
def set_formula_relay(self, channel: Literal[1, 2], formula: str) -> None:
    """Set the relay formula of a channel.

    Args:
        channel: The channel number.
        formula: The relay formula.
    """
    self._check_channel(channel)
    _ = self._check(f"FR{channel},{formula}")

set_formula_temporary ¤

set_formula_temporary(channel: Literal[1, 2], formula: str) -> None

Set the temporary formula of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
formula str

The temporary formula.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
736
737
738
739
740
741
742
743
744
def set_formula_temporary(self, channel: Literal[1, 2], formula: str) -> None:
    """Set the temporary formula of a channel.

    Args:
        channel: The channel number.
        formula: The temporary formula.
    """
    self._check_channel(channel)
    _ = self._check(f"FT{channel},{formula}")

set_gain ¤

set_gain(channel: Literal[1, 2], gain: float) -> None

Set the gain of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
gain float

The gain [0.001, 2.000].

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
746
747
748
749
750
751
752
753
754
def set_gain(self, channel: Literal[1, 2], gain: float) -> None:
    """Set the gain of a channel.

    Args:
        channel: The channel number.
        gain: The gain [0.001, 2.000].
    """
    self._check_channel(channel)
    _ = self._check(f"GN{channel},{gain}")

set_input_range ¤

set_input_range(channel: Literal[1, 2], range: int) -> None

Set the input range of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
range int

The input range [1, 10] in Volts.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
756
757
758
759
760
761
762
763
764
765
766
767
def set_input_range(self, channel: Literal[1, 2], range: int) -> None:  # noqa: A002
    """Set the input range of a channel.

    Args:
        channel: The channel number.
        range: The input range [1, 10] in Volts.
    """
    self._check_channel(channel)
    if range < 1 or range > MAX_RANGE:
        msg = f"Invalid input range {range}"
        raise ValueError(msg)
    _ = self._check(f"IN{channel},{range}")

set_interface_mode ¤

set_interface_mode(mode: int) -> None

Set the interface mode.

Parameters:

Name Type Description Default
mode int

The interface mode.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
769
770
771
772
773
774
775
def set_interface_mode(self, mode: int) -> None:
    """Set the interface mode.

    Args:
        mode: The interface mode.
    """
    _ = self._check(f"IM,{mode}")

set_limit_mode ¤

set_limit_mode(channel: Literal[1, 2], mode: int | str | LimitMode) -> None

Set the limit mode of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
mode int | str | LimitMode

The limit mode. Can be a LimitMode member name or value. For example, LimitMode.BAND, 2, or "BAND" are equivalent.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
777
778
779
780
781
782
783
784
785
786
787
def set_limit_mode(self, channel: Literal[1, 2], mode: int | str | LimitMode) -> None:
    """Set the limit mode of a channel.

    Args:
        channel: The channel number.
        mode: The limit mode. Can be a [LimitMode][msl.equipment_resources.mks.pr4000b.LimitMode]
            member name or value. For example, `LimitMode.BAND`, `2`, or `"BAND"` are equivalent.
    """
    self._check_channel(channel)
    lm = to_enum(mode, LimitMode, to_upper=True)
    _ = self._check(f"LM{channel},{lm}")

set_linearization_point ¤

set_linearization_point(
    channel: Literal[1, 2], point: int, x: float, y: float
) -> None

Set a point in the linearization table of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
point int

The point in the table [0, 10].

required
x float

The x value [-5% to 100% of full scale].

required
y float

The y value [-5% to 100% of full scale].

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
789
790
791
792
793
794
795
796
797
798
799
800
801
802
def set_linearization_point(self, channel: Literal[1, 2], point: int, x: float, y: float) -> None:
    """Set a point in the linearization table of a channel.

    Args:
        channel: The channel number.
        point: The point in the table [0, 10].
        x: The x value [-5% to 100% of full scale].
        y: The y value [-5% to 100% of full scale].
    """
    self._check_channel(channel)
    if point < 0 or point > MAX_POINT:
        msg = f"Invalid point {point}"
        raise ValueError(msg)
    _ = self._check(f"LN{channel},{point},{x},{y}")

set_linearization_size ¤

set_linearization_size(channel: Literal[1, 2], size: int) -> None

Set the size of the linearization table of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
size int

The size of the table.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
804
805
806
807
808
809
810
811
812
813
814
815
def set_linearization_size(self, channel: Literal[1, 2], size: int) -> None:
    """Set the size of the linearization table of a channel.

    Args:
        channel: The channel number.
        size: The size of the table.
    """
    self._check_channel(channel)
    if size < 0 or size > MAX_SIZE:
        msg = f"Invalid size {size}"
        raise ValueError(msg)
    _ = self._check(f"LS{channel},{size}")

set_lower_limit ¤

set_lower_limit(channel: Literal[1, 2], limit: float) -> None

Set the lower limit of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
limit float

The lower limit [-5% to 110% of full scale].

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
817
818
819
820
821
822
823
824
825
def set_lower_limit(self, channel: Literal[1, 2], limit: float) -> None:
    """Set the lower limit of a channel.

    Args:
        channel: The channel number.
        limit: The lower limit [-5% to 110% of full scale].
    """
    self._check_channel(channel)
    _ = self._check(f"LL{channel},{limit}")

set_offset ¤

set_offset(channel: Literal[1, 2], offset: int) -> None

Set the offset of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
offset int

The offset [-250, 250].

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
827
828
829
830
831
832
833
834
835
836
837
838
def set_offset(self, channel: Literal[1, 2], offset: int) -> None:
    """Set the offset of a channel.

    Args:
        channel: The channel number.
        offset: The offset [-250, 250].
    """
    self._check_channel(channel)
    if offset < -MAX_OFFSET or offset > MAX_OFFSET:
        msg = f"Invalid offset {offset}, must be between [-{MAX_OFFSET}, {MAX_OFFSET}]"
        raise ValueError(msg)
    _ = self._check(f"OF{channel},{offset}")

set_output_range ¤

set_output_range(channel: Literal[1, 2], range: int) -> None

Set the output range of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
range int

The output range [1, 10] in Volts.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
840
841
842
843
844
845
846
847
848
849
850
851
def set_output_range(self, channel: Literal[1, 2], range: int) -> None:  # noqa: A002
    """Set the output range of a channel.

    Args:
        channel: The channel number.
        range: The output range [1, 10] in Volts.
    """
    self._check_channel(channel)
    if range < 1 or range > MAX_RANGE:
        msg = f"Invalid output range {range}"
        raise ValueError(msg)
    _ = self._check(f"OT{channel},{range}")

set_range ¤

set_range(channel: Literal[1, 2], range: float, unit: int | str) -> None

Set the range and unit of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
range float

The range value.

required
unit int | str

The unit as either an index number [0, 20] or a name (e.g., 7 or "kPa"). See UNIT for the supported unit values.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
def set_range(self, channel: Literal[1, 2], range: float, unit: int | str) -> None:  # noqa: A002
    """Set the range and unit of a channel.

    Args:
        channel: The channel number.
        range: The range value.
        unit: The unit as either an index number [0, 20] or a name (e.g., `7` or `"kPa"`).
            See [UNIT][msl.equipment_resources.mks.pr4000b.UNIT] for the supported unit values.
    """
    self._check_channel(channel)
    index = -1
    if isinstance(unit, str):
        lower = unit.lower()
        for i, v in enumerate(UNIT.values()):
            if v.lower() == lower:
                index = i
                break
    elif unit in UNIT:
        index = unit

    if index == -1:
        msg = f"Invalid unit {unit!r}"
        raise ValueError(msg)

    _ = self._check(f"RG{channel},{range},{index}")

set_relays ¤

set_relays(channel: Literal[1, 2], *, enable: bool) -> None

Set the relay state of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
enable bool

Whether to enable or disable the relay.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
879
880
881
882
883
884
885
886
887
888
def set_relays(self, channel: Literal[1, 2], *, enable: bool) -> None:
    """Set the relay state of a channel.

    Args:
        channel: The channel number.
        enable: Whether to enable or disable the relay.
    """
    self._check_channel(channel)
    state = "ON" if enable else "OFF"
    _ = self._check(f"RL{channel},{state}")

set_remote_mode ¤

set_remote_mode(*, enable: bool) -> None

Set the remote operation mode to be enable or disabled.

Parameters:

Name Type Description Default
enable bool

Whether to enable or disable remote operation.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
890
891
892
893
894
895
896
897
def set_remote_mode(self, *, enable: bool) -> None:
    """Set the remote operation mode to be enable or disabled.

    Args:
        enable: Whether to enable or disable remote operation.
    """
    mode = "ON" if enable else "OFF"
    _ = self._check(f"RT,{mode}")

set_resolution ¤

set_resolution(*, enable: bool) -> None

Set the 16-bit resolution to be enabled or disabled.

Parameters:

Name Type Description Default
enable bool

Whether to enable or disable 16-bit resolution.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
899
900
901
902
903
904
905
906
def set_resolution(self, *, enable: bool) -> None:
    """Set the 16-bit resolution to be enabled or disabled.

    Args:
        enable: Whether to enable or disable 16-bit resolution.
    """
    state = "ON" if enable else "OFF"
    _ = self._check(f"RS,{state}")

set_rtd_offset ¤

set_rtd_offset(channel: Literal[1, 2], offset: int) -> None

Set the RTD offset of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
offset int

The RTD offset [-250, 250].

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
908
909
910
911
912
913
914
915
916
917
918
919
def set_rtd_offset(self, channel: Literal[1, 2], offset: int) -> None:
    """Set the RTD offset of a channel.

    Args:
        channel: The channel number.
        offset: The RTD offset [-250, 250].
    """
    self._check_channel(channel)
    if offset < -MAX_OFFSET or offset > MAX_OFFSET:
        msg = f"Invalid RTD offset {offset}, must be between [-{MAX_OFFSET}, {MAX_OFFSET}]"
        raise ValueError(msg)
    _ = self._check(f"RO{channel},{offset}")

set_scale ¤

set_scale(channel: Literal[1, 2], scale: float) -> None

Set the scale of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
scale float

The scale.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
921
922
923
924
925
926
927
928
929
def set_scale(self, channel: Literal[1, 2], scale: float) -> None:
    """Set the scale of a channel.

    Args:
        channel: The channel number.
        scale: The scale.
    """
    self._check_channel(channel)
    _ = self._check(f"SC{channel},{scale}")

set_setpoint ¤

set_setpoint(channel: Literal[1, 2], setpoint: float) -> None

Set the setpoint of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
setpoint float

The setpoint.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
931
932
933
934
935
936
937
938
939
def set_setpoint(self, channel: Literal[1, 2], setpoint: float) -> None:
    """Set the setpoint of a channel.

    Args:
        channel: The channel number.
        setpoint: The setpoint.
    """
    self._check_channel(channel)
    _ = self._check(f"SP{channel},{setpoint}")

set_signal_mode ¤

set_signal_mode(channel: Literal[1, 2], mode: SignalMode) -> None

Set the range and unit of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
mode SignalMode

The signal mode. Can be a SignalMode member name or value. For example, SignalMode.OFF, 1, or "OFF" are equivalent.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
941
942
943
944
945
946
947
948
949
950
951
def set_signal_mode(self, channel: Literal[1, 2], mode: SignalMode) -> None:
    """Set the range and unit of a channel.

    Args:
        channel: The channel number.
        mode: The signal mode. Can be a [SignalMode][msl.equipment_resources.mks.pr4000b.SignalMode]
            member name or value. For example, `SignalMode.OFF`, `1`, or `"OFF"` are equivalent.
    """
    self._check_channel(channel)
    sm = to_enum(mode, SignalMode, to_upper=True)
    _ = self._check(f"SM{channel},{sm}")

set_tweak_control ¤

set_tweak_control(*, enable: bool) -> None

Set tweak control.

Parameters:

Name Type Description Default
enable bool

Whether to switch tweak control on or off.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
953
954
955
956
957
958
959
def set_tweak_control(self, *, enable: bool) -> None:
    """Set tweak control.

    Args:
        enable: Whether to switch tweak control on or off.
    """
    _ = self._check("$1" if enable else "$0")

set_upper_limit ¤

set_upper_limit(channel: Literal[1, 2], limit: float) -> None

Set the upper limit of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
limit float

The upper limit [-5% to 110% of full scale].

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
961
962
963
964
965
966
967
968
969
def set_upper_limit(self, channel: Literal[1, 2], limit: float) -> None:
    """Set the upper limit of a channel.

    Args:
        channel: The channel number.
        limit: The upper limit [-5% to 110% of full scale].
    """
    self._check_channel(channel)
    _ = self._check(f"UL{channel},{limit}")

set_valve ¤

set_valve(channel: Literal[1, 2], *, enable: bool) -> None

Set the state of the valve of a channel.

Parameters:

Name Type Description Default
channel Literal[1, 2]

The channel number.

required
enable bool

Whether to enable or disable the valve state.

required
Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
def set_valve(self, channel: Literal[1, 2], *, enable: bool) -> None:
    """Set the state of the valve of a channel.

    Args:
        channel: The channel number.
        enable: Whether to enable or disable the valve state.
    """
    if channel == 0:  # pyright: ignore[reportUnnecessaryComparison]
        msg = (  # pyright: ignore[reportUnreachable]
            "The manual indicates that you can specify channel=0 "
            "to set both valves simultaneously, but that does not work"
        )
        raise ValueError(msg)

    self._check_channel(channel)
    state = "ON" if enable else "OFF"
    _ = self._check(f"VL{channel},{state}")

status ¤

status() -> int

Request status bits.

Returns:

Type Description
int

The status value.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
989
990
991
992
993
994
995
def status(self) -> int:
    """Request status bits.

    Returns:
        The status value.
    """
    return int(self.query("ST"))

unlock ¤

unlock() -> None

Unlock setup.

Source code in packages/resources/src/msl/equipment_resources/mks/pr4000b.py
997
998
999
def unlock(self) -> None:
    """Unlock setup."""
    _ = self._check("#0")

Flow and Pressure controller, PR4000B, from MKS Instruments.

UNIT module-attribute ¤

UNIT = {
    0: "ubar",
    1: "mbar",
    2: "bar",
    3: "mTorr",
    4: "Torr",
    5: "kTorr",
    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",
}

Mapping from an index value to a unit name.

LimitMode (IntEnum) ¤

Limit mode type.

Attributes:

Name Type Description
SLEEP int

0

LIMIT int

1

BAND int

2

MLIMIT int

3

MBAND int

4

SignalMode (IntEnum) ¤

Signal mode type.

Determines the source of the setpoint which shall be applied to the respective channel.

Attributes:

Name Type Description
METER int

0

OFF int

1

INDEPENDENT int

2

EXTERNAL int

3

SLAVE int

4

RTD int

5

Tag (IntEnum) ¤

Display tag types.

Attributes:

Name Type Description
SP int

0

VA int

1

CH int

2

FL int

3

PR int

4

EX int

5