Constants module

Provides user-friendly naming to values used in different functions.

class pyvisa.constants.AccessModes[source]
exclusive_lock = <AccessModes.exclusive_lock: 1>

Obtains a exclusive lock on the VISA resource.

no_lock = <AccessModes.no_lock: 0>

Does not obtain any lock on the VISA resource.

shared_lock = <AccessModes.shared_lock: 2>

Obtains a lock on the VISA resouce which may be shared between multiple VISA sessions.

class pyvisa.constants.StopBits[source]

The number of stop bits that indicate the end of a frame.

one = < 10>
one_and_a_half = <StopBits.one_and_a_half: 15>
two = <StopBits.two: 20>
class pyvisa.constants.Parity[source]

The parity types to use with every frame transmitted and received on a serial session.

even = <Parity.even: 2>
mark = <Parity.mark: 3>
none = <Parity.none: 0>
odd = <Parity.odd: 1>
space = < 4>
class pyvisa.constants.SerialTermination[source]

The available methods for terminating a serial transfer.

last_bit = <SerialTermination.last_bit: 1>

The transfer occurs with the last bit not set until the last character is sent.

none = <SerialTermination.none: 0>

The transfer terminates when all requested data is transferred or when an error occurs.

termination_break = <SerialTermination.termination_break: 3>

The write transmits a break after all the characters for the write are sent.

termination_char = <SerialTermination.termination_char: 2>

The transfer terminate by searching for “/” appending the termination character.

class pyvisa.constants.InterfaceType[source]

The hardware interface

asrl = <InterfaceType.asrl: 4>

Serial devices connected to either an RS-232 or RS-485 controller.

firewire = <InterfaceType.firewire: 9>

Firewire device.

gpib = <InterfaceType.gpib: 1>

GPIB Interface.

gpib_vxi = <InterfaceType.gpib_vxi: 3>

GPIB VXI (VME eXtensions for Instrumentation).

pxi = <InterfaceType.pxi: 5>

PXI device.

rio = < 8>

Rio device.

rsnrp = <InterfaceType.rsnrp: 33024>

Rohde and Schwarz Device via Passport

tcpip = <InterfaceType.tcpip: 6>

TCPIP device.

unknown = <InterfaceType.unknown: -1>
usb = <InterfaceType.usb: 7>

Universal Serial Bus (USB) hardware bus.

vxi = <InterfaceType.vxi: 2>

VXI (VME eXtensions for Instrumentation), VME, MXI (Multisystem eXtension Interface).

class pyvisa.constants.AddressState[source]
listenr = <AddressState.listenr: 2>
talker = <AddressState.talker: 1>
unaddressed = <AddressState.unaddressed: 0>
class pyvisa.constants.IOProtocol[source]
fdc = <IOProtocol.fdc: 2>

Fast data channel (FDC) protocol for VXI

hs488 = <IOProtocol.hs488: 3>

High speed 488 transfer for GPIB

normal = <IOProtocol.normal: 1>
protocol4882_strs = <IOProtocol.protocol4882_strs: 4>

488 style transfer for serial

usbtmc_vendor = <IOProtocol.usbtmc_vendor: 5>

Test measurement class vendor specific for USB

class pyvisa.constants.LineState[source]
asserted = <LineState.asserted: 1>
unasserted = <LineState.unasserted: 0>
unknown = <LineState.unknown: -1>
class pyvisa.constants.StatusCode[source]

Specifies the status codes that NI-VISA driver-level operations can return.

error_abort = <StatusCode.error_abort: -1073807312>

The operation was aborted.

error_allocation = <StatusCode.error_allocation: -1073807300>

Insufficient system resources to perform necessary memory allocation.

error_attribute_read_only = <StatusCode.error_attribute_read_only: -1073807329>

The specified attribute is read-only.

error_bus_error = <StatusCode.error_bus_error: -1073807304>

Bus error occurred during transfer.

error_closing_failed = <StatusCode.error_closing_failed: -1073807338>

Unable to deallocate the previously allocated data structures corresponding to this session or object reference.

error_connection_lost = <StatusCode.error_connection_lost: -1073807194>

The connection for the specified session has been lost.

error_file_access = <StatusCode.error_file_access: -1073807199>

An error occurred while trying to open the specified file. Possible causes include an invalid path or lack of access rights.

error_file_i_o = <StatusCode.error_file_i_o: -1073807198>

An error occurred while performing I/O on the specified file.

error_handler_not_installed = <StatusCode.error_handler_not_installed: -1073807320>

A handler is not currently installed for the specified event.

error_in_progress = <StatusCode.error_in_progress: -1073807303>

Unable to queue the asynchronous operation because there is already an operation in progress.

error_input_protocol_violation = <StatusCode.error_input_protocol_violation: -1073807305>

Device reported an input protocol error during transfer.

error_interface_number_not_configured = <StatusCode.error_interface_number_not_configured: -1073807195>

The interface type is valid but the specified interface number is not configured.

error_interrupt_pending = <StatusCode.error_interrupt_pending: -1073807256>

An interrupt is still pending from a previous call.

error_invalid_access_key = <StatusCode.error_invalid_access_key: -1073807327>

The access key to the resource associated with this session is invalid.

error_invalid_access_mode = <StatusCode.error_invalid_access_mode: -1073807341>

Invalid access mode.

error_invalid_address_space = <StatusCode.error_invalid_address_space: -1073807282>

Invalid address space specified.

error_invalid_context = <StatusCode.error_invalid_context: -1073807318>

Specified event context is invalid.

error_invalid_degree = <StatusCode.error_invalid_degree: -1073807333>

Specified degree is invalid.

error_invalid_event = <StatusCode.error_invalid_event: -1073807322>

Specified event type is not supported by the resource.

error_invalid_expression = <StatusCode.error_invalid_expression: -1073807344>

Invalid expression specified for search.

error_invalid_format = <StatusCode.error_invalid_format: -1073807297>

A format specifier in the format string is invalid.

error_invalid_handler_reference = <StatusCode.error_invalid_handler_reference: -1073807319>

The specified handler reference is invalid.

error_invalid_job_i_d = <StatusCode.error_invalid_job_i_d: -1073807332>

Specified job identifier is invalid.

error_invalid_length = <StatusCode.error_invalid_length: -1073807229>

Invalid length specified.

error_invalid_line = <StatusCode.error_invalid_line: -1073807200>

The value specified by the line parameter is invalid.

error_invalid_lock_type = <StatusCode.error_invalid_lock_type: -1073807328>

The specified type of lock is not supported by this resource.

error_invalid_mask = <StatusCode.error_invalid_mask: -1073807299>

Invalid buffer mask specified.

error_invalid_mechanism = <StatusCode.error_invalid_mechanism: -1073807321>

Invalid mechanism specified.

error_invalid_mode = <StatusCode.error_invalid_mode: -1073807215>

The specified mode is invalid.

error_invalid_object = <StatusCode.error_invalid_object: -1073807346>

The specified session or object reference is invalid.

error_invalid_offset = <StatusCode.error_invalid_offset: -1073807279>

Invalid offset specified.

error_invalid_parameter = <StatusCode.error_invalid_parameter: -1073807240>

The value of an unknown parameter is invalid.

error_invalid_protocol = <StatusCode.error_invalid_protocol: -1073807239>

The protocol specified is invalid.

error_invalid_resource_name = <StatusCode.error_invalid_resource_name: -1073807342>

Invalid resource reference specified. Parsing error.

error_invalid_setup = <StatusCode.error_invalid_setup: -1073807302>

Unable to start operation because setup is invalid due to inconsistent state of properties.

error_invalid_size = <StatusCode.error_invalid_size: -1073807237>

Invalid size of window specified.

error_invalid_width = <StatusCode.error_invalid_width: -1073807278>

Invalid source or destination width specified.

error_io = <StatusCode.error_io: -1073807298>

Could not perform operation because of I/O error.

error_library_not_found = <StatusCode.error_library_not_found: -1073807202>

A code library required by VISA could not be located or loaded.

error_line_in_use = <StatusCode.error_line_in_use: -1073807294>

The specified trigger line is currently in use.

error_machine_not_available = <StatusCode.error_machine_not_available: -1073807193>

The remote machine does not exist or is not accepting any connections.

error_memory_not_shared = <StatusCode.error_memory_not_shared: -1073807203>

The device does not export any memory.

error_no_listeners = <StatusCode.error_no_listeners: -1073807265>

No listeners condition is detected (both NRFD and NDAC are deasserted).

error_no_permission = <StatusCode.error_no_permission: -1073807192>

Access to the remote machine is denied.

error_nonimplemented_operation = <StatusCode.error_nonimplemented_operation: -1073807231>

The specified operation is unimplemented.

error_nonsupported_attribute = <StatusCode.error_nonsupported_attribute: -1073807331>

The specified attribute is not defined or supported by the referenced session, event, or find list.

error_nonsupported_attribute_state = <StatusCode.error_nonsupported_attribute_state: -1073807330>

The specified state of the attribute is not valid or is not supported as defined by the session, event, or find list.

error_nonsupported_format = <StatusCode.error_nonsupported_format: -1073807295>

A format specifier in the format string is not supported.

error_nonsupported_interrupt = <StatusCode.error_nonsupported_interrupt: -1073807201>

The interface cannot generate an interrupt on the requested level or with the requested statusID value.

error_nonsupported_line = <StatusCode.error_nonsupported_line: -1073807197>

The specified trigger source line (trigSrc) or destination line (trigDest) is not supported by this VISA implementation, or the combination of lines is not a valid mapping.

error_nonsupported_mechanism = <StatusCode.error_nonsupported_mechanism: -1073807196>

The specified mechanism is not supported for the specified event type.

error_nonsupported_mode = <StatusCode.error_nonsupported_mode: -1073807290>

The specified mode is not supported by this VISA implementation.

error_nonsupported_offset = <StatusCode.error_nonsupported_offset_alignment: -1073807276>

Specified offset is not accessible from this hardware.

error_nonsupported_offset_alignment = <StatusCode.error_nonsupported_offset_alignment: -1073807276>

The specified offset is not properly aligned for the access width of the operation.

error_nonsupported_operation = <StatusCode.error_nonsupported_operation: -1073807257>

The session or object reference does not support this operation.

error_nonsupported_varying_widths = <StatusCode.error_nonsupported_varying_widths: -1073807275>

Cannot support source and destination widths that are different.

error_nonsupported_width = <StatusCode.error_nonsupported_width: -1073807242>

Specified width is not supported by this hardware.

error_not_cic = <StatusCode.error_not_cic: -1073807264>

The interface associated with this session is not currently the Controller-in-Charge.

error_not_enabled = <StatusCode.error_not_enabled: -1073807313>

The session must be enabled for events of the specified type in order to receive them.

error_not_system_controller = <StatusCode.error_not_system_controller: -1073807263>

The interface associated with this session is not the system controller.

error_output_protocol_violation = <StatusCode.error_output_protocol_violation: -1073807306>

Device reported an output protocol error during transfer.

error_queue_error = <StatusCode.error_queue_error: -1073807301>

Unable to queue asynchronous operation.

error_queue_overflow = <StatusCode.error_queue_overflow: -1073807315>

The event queue for the specified type has overflowed, usually due to not closing previous events.

error_raw_read_protocol_violation = <StatusCode.error_raw_read_protocol_violation: -1073807307>

Violation of raw read protocol occurred during transfer.

error_raw_write_protocol_violation = <StatusCode.error_raw_write_protocol_violation: -1073807308>

Violation of raw write protocol occurred during transfer.

error_resource_busy = <StatusCode.error_resource_busy: -1073807246>

The resource is valid, but VISA cannot currently access it.

error_resource_locked = <StatusCode.error_resource_locked: -1073807345>

Specified type of lock cannot be obtained or specified operation cannot be performed because the resource is locked.

error_resource_not_found = <StatusCode.error_resource_not_found: -1073807343>

Insufficient location information, or the device or resource is not present in the system.

error_response_pending = <StatusCode.error_response_pending: -1073807271>

A previous response is still pending, causing a multiple query error.

error_serial_framing = <StatusCode.error_serial_framing: -1073807253>

A framing error occurred during transfer.

error_serial_overrun = <StatusCode.error_serial_overrun: -1073807252>

An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived.

error_serial_parity = <StatusCode.error_serial_parity: -1073807254>

A parity error occurred during transfer.

error_session_not_locked = <StatusCode.error_session_not_locked: -1073807204>

The current session did not have any lock on the resource.

error_srq_not_occurred = <StatusCode.error_srq_not_occurred: -1073807286>

Service request has not been received for the session.

error_system_error = <StatusCode.error_system_error: -1073807360>

Unknown system error.

error_timeout = <StatusCode.error_timeout: -1073807339>

Timeout expired before operation completed.

error_trigger_not_mapped = <StatusCode.error_trigger_not_mapped: -1073807250>

The path from the trigger source line (trigSrc) to the destination line (trigDest) is not currently mapped.

error_user_buffer = <StatusCode.error_user_buffer: -1073807247>

A specified user buffer is not valid or cannot be accessed for the required size.

error_window_already_mapped = <StatusCode.error_window_already_mapped: -1073807232>

The specified session currently contains a mapped window.

error_window_not_mapped = <StatusCode.error_window_not_mapped: -1073807273>

The specified session is currently unmapped.

success = <StatusCode.success: 0>

Operation completed successfully.

success_device_not_present = <StatusCode.success_device_not_present: 1073676413>

Session opened successfully, but the device at the specified address is not responding.

success_event_already_disabled = <StatusCode.success_event_already_disabled: 1073676291>

Specified event is already disabled for at least one of the specified mechanisms.

success_event_already_enabled = <StatusCode.success_event_already_enabled: 1073676290>

Specified event is already enabled for at least one of the specified mechanisms.

success_max_count_read = <StatusCode.success_max_count_read: 1073676294>

The number of bytes read is equal to the input count.

success_nested_exclusive = <StatusCode.success_nested_exclusive: 1073676442>

Operation completed successfully, and this session has nested exclusive locks.

success_nested_shared = <StatusCode.success_nested_shared: 1073676441>

Operation completed successfully, and this session has nested shared locks.

success_no_more_handler_calls_in_chain = <StatusCode.success_no_more_handler_calls_in_chain: 1073676440>

Event handled successfully. Do not invoke any other handlers on this session for this event.

success_queue_already_empty = <StatusCode.success_queue_already_empty: 1073676292>

Operation completed successfully, but the queue was already empty.

success_queue_not_empty = <StatusCode.success_queue_not_empty: 1073676416>

Wait terminated successfully on receipt of an event notification. There is still at least one more event occurrence of the requested type(s) available for this session.

success_syncronous = <StatusCode.success_syncronous: 1073676443>

Asynchronous operation request was performed synchronously.

success_termination_character_read = <StatusCode.success_termination_character_read: 1073676293>

The specified termination character was read.

success_trigger_already_mapped = <StatusCode.success_trigger_already_mapped: 1073676414>

The path from the trigger source line (trigSrc) to the destination line (trigDest) is already mapped.

warning_configuration_not_loaded = <StatusCode.warning_configuration_not_loaded: 1073676407>

The specified configuration either does not exist or could not be loaded. The VISA-specified defaults are used.

warning_ext_function_not_implemented = <StatusCode.warning_ext_function_not_implemented: 1073676457>

The operation succeeded, but a lower level driver did not implement the extended functionality.

warning_nonsupported_attribute_state = <StatusCode.warning_nonsupported_attribute_state: 1073676420>

Although the specified state of the attribute is valid, it is not supported by this resource implementation.

warning_nonsupported_buffer = <StatusCode.warning_nonsupported_buffer: 1073676424>

The specified buffer is not supported.

warning_null_object = <StatusCode.warning_null_object: 1073676418>

The specified object reference is uninitialized.

warning_queue_overflow = <StatusCode.warning_queue_overflow: 1073676300>

VISA received more event information of the specified type than the configured queue size could hold.

warning_unknown_status = <StatusCode.warning_unknown_status: 1073676421>

The status code passed to the operation could not be interpreted.