niswitch module¶
Installation¶
As a prerequisite to using the niswitch module, you must install the NI-SWITCH runtime on your system. Visit ni.com/downloads to download the driver runtime for your devices.
The nimi-python modules (i.e. for NI-SWITCH) can be installed with pip:
$ python -m pip install niswitch
Or easy_install from setuptools:
$ python -m easy_install niswitch
Usage¶
The following is a basic example of using the niswitch module to open a session to a Switch and connect channels.
import niswitch
with niswitch.Session("Dev1") as session:
session.connect(channel1='r0', channel2='c0')
API Reference¶
- Session
- Methods
- abort
- can_connect
- close
- commit
- connect
- connect_multiple
- disable
- disconnect
- disconnect_all
- disconnect_multiple
- get_channel_name
- get_path
- get_relay_count
- get_relay_name
- get_relay_position
- initiate
- lock
- relay_control
- reset
- reset_with_defaults
- route_scan_advanced_output
- route_trigger_input
- self_test
- send_software_trigger
- set_path
- unlock
- wait_for_debounce
- wait_for_scan_complete
- Properties
- analog_bus_sharing_enable
- bandwidth
- channel_count
- characteristic_impedance
- continuous_scan
- digital_filter_enable
- driver_setup
- handshaking_initiation
- instrument_firmware_revision
- instrument_manufacturer
- instrument_model
- io_resource_descriptor
- is_configuration_channel
- is_debounced
- is_scanning
- is_source_channel
- is_waiting_for_trig
- logical_name
- max_ac_voltage
- max_carry_ac_current
- max_carry_ac_power
- max_carry_dc_current
- max_carry_dc_power
- max_dc_voltage
- max_switching_ac_current
- max_switching_ac_power
- max_switching_dc_current
- max_switching_dc_power
- number_of_relays
- num_of_columns
- num_of_rows
- power_down_latching_relays_after_debounce
- scan_advanced_output
- scan_advanced_polarity
- scan_delay
- scan_list
- scan_mode
- serial_number
- settling_time
- simulate
- specific_driver_description
- specific_driver_revision
- specific_driver_vendor
- supported_instrument_models
- temperature
- trigger_input
- trigger_input_polarity
- wire_mode
- Repeated Capabilities
- Enums
- Exceptions and Warnings
- Examples
- gRPC Support