https://github.com/l-johnston/nirfsg
Python control of NI RF signal generators
https://github.com/l-johnston/nirfsg
ni-rfsg pxie-5654
Last synced: about 2 months ago
JSON representation
Python control of NI RF signal generators
- Host: GitHub
- URL: https://github.com/l-johnston/nirfsg
- Owner: l-johnston
- License: mit
- Created: 2020-12-21T14:28:09.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-29T12:56:07.000Z (about 3 years ago)
- Last Synced: 2025-03-26T11:03:49.027Z (2 months ago)
- Topics: ni-rfsg, pxie-5654
- Language: Python
- Homepage:
- Size: 34.2 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


# `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()
> 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() 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_5654In [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]: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 =
|
| onboard clock =
|
| pxi clk =
|
| pxi clk master =
|
| ref in 2 =
```