Prologix¤
Prologix
(Interface)
¤
Prologix(equipment: Equipment)
Use Prologix hardware to establish a connection.
For the GPIB-ETHERNET Controller, the format of the address
string is Prologix::HOST::1234::PAD[::SAD], where HOST is the hostname or IP address of the Prologix
hardware, 1234 is the ethernet port that is open on the Prologix hardware, PAD (Primary GPIB Address)
is an integer value between 0 and 30, and SAD (Secondary GPIB Address) is an integer value between
96 and 126 (SAD is optional). For example,
Prologix::192.168.1.110::1234::6Prologix::192.168.1.110::1234::6::96Prologix::prologix-00-21-69-01-31-04::1234::6
(typically, the hostname isprologix-<MAC Address>)
For the GPIB-USB Controller, the format of the address
string is Prologix::PORT::PAD[::SAD], where PORT is the name of the serial port of the Prologix
hardware, PAD (Primary GPIB Address) is an integer value between 0 and 30, and SAD (Secondary
GPIB Address) is an integer value between 96 and 126 (SAD is optional). For example,
Prologix::COM3::6Prologix::/dev/ttyUSB0::6::112
Alternatively, to clearly separate the Prologix hardware address from the GPIB address you may include
GPIB:: in the address, for example,
Prologix::192.168.1.110::1234::GPIB::6Prologix::COM3::GPIB::22::96
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
equipment
|
Equipment
|
An Equipment instance. |
required |
A Connection instance supports the following properties for using Prologix hardware, as well as the properties defined in Serial (for a GPIB-USB Controller) and in Socket (for a GPIB-ETHERNET Controller).
Connection Properties:
| Name | Type | Description |
|---|---|---|
eoi |
bool
|
Whether to assert the End or Identify (EOI) hardware line. Default: |
eos |
int
|
GPIB termination character(s) to append to the message that is sent
to the equipment. Default:
|
eot_char |
int | str
|
A user-specified character to append to the reply that the Prologix hardware
sends back to the computer when |
eot_enable |
bool
|
Enable or disable the appending of a user-specified character, |
escape_characters |
bool
|
Whether to escape the |
read_tmo_ms |
int
|
The inter-character timeout value, in milliseconds, to be used in the read
command and the serial_poll command, i.e., the delay since the last character was read. The
|
Important
The Prologix Connection Properties are the same for all equipment that are attached to the
Prologix hardware. If different equipment require different properties you must manage the
settings appropriately, such as by writing ++eoi 0 to disable the use of the End or
Identify line before reading from the equipment and then perhaps writing ++eoi 1
to re-enable it afterwards. Only the escape_characters property is associated with the
Prologix instance.
Source code in src/msl/equipment/interfaces/prologix.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 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 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
controller
property
¤
The connection to the Prologix Controller for this equipment.
The returned type depends on whether a GPIB-USB or a GPIB-ETHERNET Controller is used to communicate with the equipment.
Use this property if you want more direct access to the Prologix Controller.
escape_characters
property
writable
¤
escape_characters: bool
Whether to escape the \n (ASCII 10), \r (ASCII 13), ESC (ASCII 27) and + (ASCII 43)
characters before a write operation.
timeout
property
writable
¤
timeout: float | None
The timeout, in seconds, to use for the connection to the Prologix hardware.
This timeout value is not to be confused with the read_tmo_ms command that Prologix Controllers
accept. To set the inter-character delay, i.e., the delay since the last character was read or
for the serial_poll command, write the
++read_tmo_ms <time> message to the Controller (or define it in the
Connection properties).
clear
¤
clear() -> None
Send the Selected Device Clear (SDC) command.
Source code in src/msl/equipment/interfaces/prologix.py
248 249 250 251 252 | |
disconnect
¤
disconnect() -> None
Disconnect from the equipment.
Calling this method does not close the underlying Serial or Socket connection to the Prologix Controller since the connection to the Prologix Controller may still be required to send messages to other GPIB devices that are attached to the Controller.
Source code in src/msl/equipment/interfaces/prologix.py
265 266 267 268 269 270 271 272 273 274 275 | |
group_execute_trigger
¤
group_execute_trigger(*addresses: int) -> None
Send the Group Execute Trigger command to equipment at the specified addresses.
Up to 15 addresses may be specified. If no address is specified then the Group Execute Trigger command is issued to the currently-addressed equipment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
addresses
|
int
|
The primary (and optional secondary) GPIB addresses. If a secondary address is specified then it must follow its corresponding primary address, for example,
|
()
|
Source code in src/msl/equipment/interfaces/prologix.py
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | |
interface_clear
¤
interface_clear() -> None
Perform interface clear.
Resets the GPIB bus by asserting the interface clear (IFC) bus line for a duration of at least 150 microseconds.
Source code in src/msl/equipment/interfaces/prologix.py
317 318 319 320 321 322 323 | |
local
¤
local() -> None
Enables front panel operation of the device, GTL GPIB command.
Source code in src/msl/equipment/interfaces/prologix.py
325 326 327 328 329 | |
prologix_help
¤
Get the command-syntax help for the Prologix hardware.
Returns:
| Type | Description |
|---|---|
list[tuple[str, str]]
|
Source code in src/msl/equipment/interfaces/prologix.py
345 346 347 348 349 350 351 352 353 354 355 356 357 358 | |
query
¤
query(
message: bytes | str,
*,
delay: float = 0.0,
decode: Literal[True] = True,
dtype: None = None,
fmt: MessageFormat = ...,
size: int | None = ...
) -> str
query(
message: bytes | str,
*,
delay: float = 0.0,
decode: Literal[False] = False,
dtype: None = None,
fmt: MessageFormat = ...,
size: int | None = ...
) -> bytes
query(
message: bytes | str,
*,
delay: float = 0.0,
decode: bool = ...,
dtype: MessageDataType = ...,
fmt: MessageFormat = ...,
size: int | None = ...
) -> NumpyArray1D
query(
message: bytes | str,
*,
delay: float = 0.0,
decode: bool = True,
dtype: MessageDataType | None = None,
fmt: MessageFormat = None,
size: int | None = None
) -> bytes | str | NumpyArray1D
Convenience method for performing a write followed by a read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
bytes | str
|
The message to write to the equipment. |
required |
delay
|
float
|
Time delay, in seconds, to wait between the write and read operations. |
0.0
|
decode
|
bool
|
True
|
|
dtype
|
MessageDataType | None
|
The data type of the elements in the returned message. Can be any object that numpy
dtype supports. For messages that are of scalar type (i.e., a single number)
it is more efficient to not specify |
None
|
fmt
|
MessageFormat
|
The format that the returned message data is in. Ignored if |
None
|
size
|
int | None
|
The number of bytes to read. Ignored if the value is |
None
|
Returns:
| Type | Description |
|---|---|
bytes | str | NumpyArray1D
|
The message from the equipment. If |
Source code in src/msl/equipment/interfaces/prologix.py
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | |
read
¤
read(
*,
decode: Literal[True] = True,
dtype: None = None,
fmt: MessageFormat = ...,
size: int | None = ...
) -> str
read(
*,
decode: Literal[False] = False,
dtype: None = None,
fmt: MessageFormat = ...,
size: int | None = ...
) -> bytes
read(
*,
decode: bool = ...,
dtype: MessageDataType = ...,
fmt: MessageFormat = ...,
size: int | None = ...
) -> NumpyArray1D
read(
*,
decode: bool = True,
dtype: MessageDataType | None = None,
fmt: MessageFormat = None,
size: int | None = None
) -> bytes | str | NumpyArray1D
Read a message from the equipment.
See MessageBased.read() for more details about when this method returns.
See Also
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
decode
|
bool
|
True
|
|
dtype
|
MessageDataType | None
|
The data type of the elements in the returned message. Can be any object that numpy
dtype supports. For messages that are of scalar type (i.e., a single number)
it is more efficient to not specify |
None
|
fmt
|
MessageFormat
|
The format that the returned message data is in. Ignored if |
None
|
size
|
int | None
|
The number of bytes to read. Ignored if the value is |
None
|
Returns:
| Type | Description |
|---|---|
bytes | str | NumpyArray1D
|
Source code in src/msl/equipment/interfaces/prologix.py
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | |
remote_enable
¤
remote_enable(state: bool) -> None
Whether to enable or disable front panel operation of the device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
bool
|
If |
required |
Source code in src/msl/equipment/interfaces/prologix.py
528 529 530 531 532 533 534 535 536 537 538 539 | |
reset_controller
¤
reset_controller() -> None
Performs a power-on reset of the Prologix Controller.
It takes about five seconds for the Controller to reboot.
Source code in src/msl/equipment/interfaces/prologix.py
541 542 543 544 545 546 | |
serial_poll
¤
Read status byte / serial poll.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pad
|
int | None
|
The primary GPIB address to poll. If not specified, uses the primary address of the instantiated class. |
None
|
sad
|
int | None
|
The secondary GPIB address to poll. If not specified, uses the secondary address of the instantiated class. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
The status value. |
Source code in src/msl/equipment/interfaces/prologix.py
562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 | |
set_eot_char
¤
Set a user-specified character to append to the reply from the Prologix Controller back to the computer.
This character is appended only if eot_enable is True and EOI is detected.
See Also
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
char
|
bytes | str | int
|
Must be an ASCII value <256, e.g., |
required |
Source code in src/msl/equipment/interfaces/prologix.py
582 583 584 585 586 587 588 589 590 591 592 593 | |
set_eot_enable
¤
Enables or disables the appending of a user-specified character.
See Also
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enable
|
bool | int
|
Whether to enable or disable the appending of a user-specified character. |
required |
Source code in src/msl/equipment/interfaces/prologix.py
595 596 597 598 599 600 601 602 603 604 605 | |
set_plus_plus_read_char
¤
Set the character to send when the ++read eoi|<char> message is written in read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
char
|
bytes | str | int | None
|
If |
None
|
Source code in src/msl/equipment/interfaces/prologix.py
607 608 609 610 611 612 613 614 | |
trigger
¤
trigger() -> None
Trigger device.
Source code in src/msl/equipment/interfaces/prologix.py
632 633 634 635 | |
wait
¤
wait(
mask: int,
*,
delay: float = 0.05,
pad: int | None = None,
sad: int | None = None,
timeout: float | None = None
) -> int
Wait for an event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mask
|
int
|
Wait until one of the conditions specified in |
required |
delay
|
float
|
The number of seconds to wait between checking for an event. |
0.05
|
pad
|
int | None
|
The primary GPIB address to poll. If not specified, uses the primary address of the instantiated class. |
None
|
sad
|
int | None
|
The secondary GPIB address to poll. If not specified, uses the secondary address of the instantiated class. |
None
|
timeout
|
float | None
|
The maximum number of seconds to wait before raising TimeoutError
if an event has not occurred. A value of |
None
|
Returns:
| Type | Description |
|---|---|
int
|
The status value. |
Source code in src/msl/equipment/interfaces/prologix.py
637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 | |
wait_for_srq
¤
Wait for the SRQ interrupt line to be asserted.
This method will return when the Prologix Controller receives a service request from any device. If there are multiple devices connected to the Prologix Controller, you must determine which device asserted the service request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delay
|
float
|
The number of seconds to wait between checking if SRQ has been asserted. |
0.05
|
timeout
|
float | None
|
The maximum number of seconds to wait before raising TimeoutError
if the SRQ line is not asserted. A value of |
None
|
Returns:
| Type | Description |
|---|---|
int
|
The status value. |
Source code in src/msl/equipment/interfaces/prologix.py
678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 | |
write
¤
write(
message: bytes | str,
*,
data: Sequence1D | None = None,
dtype: MessageDataType = "<f",
fmt: MessageFormat = "ieee"
) -> int
Write a message to the equipment.
See Also
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
bytes | str
|
The message to write to the equipment. |
required |
data
|
Sequence1D | None
|
The data to append to |
None
|
dtype
|
MessageDataType
|
The data type to use to convert each element in |
'<f'
|
fmt
|
MessageFormat
|
The format to use to convert |
'ieee'
|
Returns:
| Type | Description |
|---|---|
int
|
The number of bytes written. |
Source code in src/msl/equipment/interfaces/prologix.py
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 | |