Python control of NI RF Signal Generators using NI-RFSG
Project description
nirfsg
Python control of NI RF Signal Generators using NI-RFSG
Installation
> pip install nirfsg
Or, after cloning repo:
> pip install .
Documentation
Currently supported models:
- PXIe-5654
> from nirfsg import PXIe_5654
> sig_gen = PXIe_5654(<resource>)
> sig_gen.rf_frequency = 2e6 # Hz
> sig_gen.rf_power = 0 # dBm
> sig_gen.initiate()
...
> sig_gen.close()
As a context manager:
> with PXIe_5654(<resource>) as sig_gen:
sig_gen.rf_frequency = 20e9 # Hz
sig_gen.rf_power = 13 # dBm
sig_gen.initiate()
# do some measurements
Context manager will close the session at exit, which will stop generation.
To discover available methods and attributes use tab-completion, dir() and help():
In [1]: from nirfsg import PXIe_5654
In [2]: sg = PXIe_5654("PXI1Slot7")
In [3]: dir(sg)
Out[3]:
['abort',
'amplitude_settling',
'automatic_thermal_correction',
'check_status',
'clock',
'close',
'configurationlist',
'configure_rf',
'device_temperature',
'events',
'external_cal',
'fast_tuning',
'frequency_settling',
'frequency_settling_units',
'generation_mode',
'initiate',
'instrument_model',
'modulation',
'module_revision',
'output_enabled',
'pulse_modulation_enabled',
'pulse_modulation_mode',
'rf_frequency',
'rf_power',
'serial_number',
'triggers',
'wait_until_settled']
In [4]: dir(sg.clock)
Out[4]: ['reference_clock_output_terminal', 'reference_clock_source']
In [5]: sg.clock.reference_clock_source
Out[5]: <reference_clock_source.onboard clock: 'OnboardClock'>
In [6]: help(type(sg.clock.reference_clock_source))
Help on class reference_clock_source in module nirfsg.attributemonger:
class reference_clock_source(enum.Enum)
| reference_clock_source(value, names=None, *, module=None, qualname=None, type=None, start=1)
|
| An enumeration.
|
| Method resolution order:
| reference_clock_source
| enum.Enum
| builtins.object
|
| Data and other attributes defined here:
|
| none = <reference_clock_source.none: 'None'>
|
| onboard clock = <reference_clock_source.onboard clock: 'OnboardClock'>
|
| pxi clk = <reference_clock_source.pxi clk: 'PXI_CLK'>
|
| pxi clk master = <reference_clock_source.pxi clk master: 'PXI_ClkMaste...
|
| ref in = <reference_clock_source.ref in: 'RefIn'>
|
| ref in 2 = <reference_clock_source.ref in 2: 'RefIn2'>
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nirfsg-0.1.6.tar.gz
(17.9 kB
view details)
Built Distribution
nirfsg-0.1.6-py3-none-any.whl
(18.8 kB
view details)
File details
Details for the file nirfsg-0.1.6.tar.gz
.
File metadata
- Download URL: nirfsg-0.1.6.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75c9de85318eacfe6fe770b6222f957c0a7b5d8f3ab19e0fd9186d58d744758b |
|
MD5 | a75578dbbf4d63d73cbf6a5609bca59a |
|
BLAKE2b-256 | 5bf29d5802a341ac6a68f2e7e24fb65d2bed883c184f02b0c1fd750291e047c1 |
File details
Details for the file nirfsg-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: nirfsg-0.1.6-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb84c46101d188c179bdf484e58a21e10846d693ba99646eb61f912a72965e3c |
|
MD5 | a26615a6ce57fb817e01385ec8613302 |
|
BLAKE2b-256 | c22e87746ec9ca16bb2991e0e9828c67df614f72c8f1e9b6571ae3cce127cda4 |