nirfmxvna 26.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nirfmxvna/__init__.py +106 -0
- nirfmxvna/attributes.py +2234 -0
- nirfmxvna/enums.py +1048 -0
- nirfmxvna/errors.py +96 -0
- nirfmxvna/examples/nirfmxvna_calibration_with_calset_save_two_port.py +186 -0
- nirfmxvna/examples/nirfmxvna_pulsed_s_params.py +174 -0
- nirfmxvna/examples/nirfmxvna_s_params_corrected_with_calset_load_two_port_grpc.py +234 -0
- nirfmxvna/examples/nirfmxvna_waves.py +174 -0
- nirfmxvna/grpc_session_options.py +64 -0
- nirfmxvna/internal/_custom_types.py +13 -0
- nirfmxvna/internal/_grpc_stub_interpreter.py +1757 -0
- nirfmxvna/internal/_helper.py +387 -0
- nirfmxvna/internal/_library.py +3790 -0
- nirfmxvna/internal/_library_interpreter.py +3011 -0
- nirfmxvna/internal/_library_singleton.py +53 -0
- nirfmxvna/internal/nidevice_pb2.py +37 -0
- nirfmxvna/internal/nidevice_pb2_grpc.py +3 -0
- nirfmxvna/internal/nirfmxvna_pb2.py +1094 -0
- nirfmxvna/internal/nirfmxvna_pb2_grpc.py +9990 -0
- nirfmxvna/internal/session_pb2.py +33 -0
- nirfmxvna/internal/session_pb2_grpc.py +3 -0
- nirfmxvna/iq.py +31 -0
- nirfmxvna/iq_configuration.py +290 -0
- nirfmxvna/iq_results.py +108 -0
- nirfmxvna/marker.py +31 -0
- nirfmxvna/marker_configuration.py +429 -0
- nirfmxvna/marker_results.py +168 -0
- nirfmxvna/s_params.py +31 -0
- nirfmxvna/s_params_configuration.py +1656 -0
- nirfmxvna/s_params_results.py +244 -0
- nirfmxvna/vna.py +12920 -0
- nirfmxvna/waves.py +31 -0
- nirfmxvna/waves_configuration.py +1255 -0
- nirfmxvna/waves_results.py +235 -0
- nirfmxvna-26.3.0.dist-info/METADATA +228 -0
- nirfmxvna-26.3.0.dist-info/RECORD +38 -0
- nirfmxvna-26.3.0.dist-info/WHEEL +4 -0
- nirfmxvna-26.3.0.dist-info/licenses/LICENSE +30 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"""Provides methods to fetch and read the Waves measurement results."""
|
|
2
|
+
|
|
3
|
+
import functools
|
|
4
|
+
|
|
5
|
+
import nirfmxvna.attributes as attributes
|
|
6
|
+
import nirfmxvna.enums as enums
|
|
7
|
+
import nirfmxvna.errors as errors
|
|
8
|
+
import nirfmxvna.internal._helper as _helper
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _raise_if_disposed(f):
|
|
12
|
+
"""From https://stackoverflow.com/questions/5929107/decorators-with-parameters."""
|
|
13
|
+
|
|
14
|
+
@functools.wraps(f)
|
|
15
|
+
def aux(*xs, **kws):
|
|
16
|
+
meas_obj = xs[0] # parameter 0 is 'self' which is the measurement object
|
|
17
|
+
if meas_obj._signal_obj.is_disposed:
|
|
18
|
+
raise Exception("Cannot access a disposed Vna signal configuration")
|
|
19
|
+
return f(*xs, **kws)
|
|
20
|
+
|
|
21
|
+
return aux
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class WavesResults(object):
|
|
25
|
+
"""Provides methods to fetch and read the Waves measurement results."""
|
|
26
|
+
|
|
27
|
+
def __init__(self, signal_obj):
|
|
28
|
+
"""Provides methods to fetch and read the Waves measurement results."""
|
|
29
|
+
self._signal_obj = signal_obj
|
|
30
|
+
self._session_function_lock = signal_obj._session_function_lock
|
|
31
|
+
self._interpreter = signal_obj._interpreter
|
|
32
|
+
|
|
33
|
+
@_raise_if_disposed
|
|
34
|
+
def get_correction_state(self, selector_string):
|
|
35
|
+
r"""Gets the error correction state of the VNA Waves measurement.
|
|
36
|
+
|
|
37
|
+
Use "wave<*n*>" as the selector string to read this attribute.
|
|
38
|
+
|
|
39
|
+
+-----------------------+---------------------------------------------------------------------------------------------------------------------+
|
|
40
|
+
| Name (Value) | Description |
|
|
41
|
+
+=======================+=====================================================================================================================+
|
|
42
|
+
| None (0) | Error correction is not applied. |
|
|
43
|
+
+-----------------------+---------------------------------------------------------------------------------------------------------------------+
|
|
44
|
+
| Corrected (1) | Error correction is applied without interpolation using the error terms from the calset. |
|
|
45
|
+
+-----------------------+---------------------------------------------------------------------------------------------------------------------+
|
|
46
|
+
| Interpolated (2) | Error correction is applied with error terms for at least one sweep point interpolated from the calset error terms. |
|
|
47
|
+
+-----------------------+---------------------------------------------------------------------------------------------------------------------+
|
|
48
|
+
| Settings Modified (3) | Settings during the measurment differ from those used during calibration. |
|
|
49
|
+
+-----------------------+---------------------------------------------------------------------------------------------------------------------+
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
selector_string (string):
|
|
53
|
+
Pass an empty string.
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
Tuple (attr_val, error_code):
|
|
57
|
+
|
|
58
|
+
attr_val (enums.WavesCorrectionState):
|
|
59
|
+
Returns the error correction state of the VNA Waves measurement.
|
|
60
|
+
|
|
61
|
+
error_code (int):
|
|
62
|
+
Returns the status code of this method. The status code either indicates success or describes a warning condition.
|
|
63
|
+
"""
|
|
64
|
+
try:
|
|
65
|
+
self._session_function_lock.enter_read_lock()
|
|
66
|
+
updated_selector_string = _helper.validate_and_update_selector_string(
|
|
67
|
+
selector_string, self._signal_obj
|
|
68
|
+
)
|
|
69
|
+
attr_val, error_code = self._interpreter.get_attribute_i32(
|
|
70
|
+
updated_selector_string, attributes.AttributeID.WAVES_RESULTS_CORRECTION_STATE.value
|
|
71
|
+
)
|
|
72
|
+
attr_val = enums.WavesCorrectionState(attr_val)
|
|
73
|
+
except (KeyError, ValueError):
|
|
74
|
+
raise errors.DriverTooNewError() # type: ignore
|
|
75
|
+
finally:
|
|
76
|
+
self._session_function_lock.exit_read_lock()
|
|
77
|
+
|
|
78
|
+
return attr_val, error_code
|
|
79
|
+
|
|
80
|
+
@_raise_if_disposed
|
|
81
|
+
def get_correction_level(self, selector_string):
|
|
82
|
+
r"""Gets the level of error correction applied to the specified wave measurement.
|
|
83
|
+
|
|
84
|
+
Use "wave<*n*>" as the selector string to read this attribute.
|
|
85
|
+
|
|
86
|
+
+--------------+------------------------------------------------------+
|
|
87
|
+
| Name (value) | Description |
|
|
88
|
+
+==============+======================================================+
|
|
89
|
+
| Uncorrected | Correction is not applied to the configured wave. |
|
|
90
|
+
+--------------+------------------------------------------------------+
|
|
91
|
+
| Wave | 1-Port correction is applied to the configured Wave. |
|
|
92
|
+
+--------------+------------------------------------------------------+
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
selector_string (string):
|
|
96
|
+
Pass an empty string.
|
|
97
|
+
|
|
98
|
+
Returns:
|
|
99
|
+
Tuple (attr_val, error_code):
|
|
100
|
+
|
|
101
|
+
attr_val (string):
|
|
102
|
+
Returns the level of error correction applied to the specified wave measurement.
|
|
103
|
+
|
|
104
|
+
error_code (int):
|
|
105
|
+
Returns the status code of this method. The status code either indicates success or describes a warning condition.
|
|
106
|
+
"""
|
|
107
|
+
try:
|
|
108
|
+
self._session_function_lock.enter_read_lock()
|
|
109
|
+
updated_selector_string = _helper.validate_and_update_selector_string(
|
|
110
|
+
selector_string, self._signal_obj
|
|
111
|
+
)
|
|
112
|
+
attr_val, error_code = self._interpreter.get_attribute_string(
|
|
113
|
+
updated_selector_string, attributes.AttributeID.WAVES_RESULTS_CORRECTION_LEVEL.value
|
|
114
|
+
)
|
|
115
|
+
finally:
|
|
116
|
+
self._session_function_lock.exit_read_lock()
|
|
117
|
+
|
|
118
|
+
return attr_val, error_code
|
|
119
|
+
|
|
120
|
+
@_raise_if_disposed
|
|
121
|
+
def fetch_x_data(self, selector_string, timeout):
|
|
122
|
+
r"""Fetches an array of frequency values when you perform wave measurement with
|
|
123
|
+
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute set to **List** or **Linear** or **Segment**. It
|
|
124
|
+
fetches an array of time values when you perform wave measurement with
|
|
125
|
+
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute set to **CW Time**.
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
selector_string (string):
|
|
129
|
+
This parameter specifies a selector string comprising of result name.
|
|
130
|
+
|
|
131
|
+
Example:
|
|
132
|
+
|
|
133
|
+
""
|
|
134
|
+
|
|
135
|
+
"result::r1"
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
timeout (float):
|
|
139
|
+
This parameter specifies the timeout, in seconds, for fetching the specified measurement. Set this value to an
|
|
140
|
+
appropriate time, longer than expected for fetching the measurement.A value of -1 specifies that the method waits until
|
|
141
|
+
the measurement is complete. The default value is 10.
|
|
142
|
+
|
|
143
|
+
Returns:
|
|
144
|
+
Tuple (x, error_code):
|
|
145
|
+
|
|
146
|
+
x (float):
|
|
147
|
+
This parameter returns X-Axis Data.
|
|
148
|
+
|
|
149
|
+
error_code (int):
|
|
150
|
+
Returns the status code of this method. The status code either indicates success or describes a warning condition.
|
|
151
|
+
"""
|
|
152
|
+
try:
|
|
153
|
+
self._session_function_lock.enter_read_lock()
|
|
154
|
+
_helper.validate_not_none(selector_string, "selector_string")
|
|
155
|
+
updated_selector_string = _helper.validate_and_update_selector_string(
|
|
156
|
+
selector_string, self._signal_obj
|
|
157
|
+
)
|
|
158
|
+
x, error_code = self._interpreter.waves_fetch_x_data(updated_selector_string, timeout)
|
|
159
|
+
finally:
|
|
160
|
+
self._session_function_lock.exit_read_lock()
|
|
161
|
+
|
|
162
|
+
return x, error_code
|
|
163
|
+
|
|
164
|
+
@_raise_if_disposed
|
|
165
|
+
def fetch_y_data(self, selector_string, timeout):
|
|
166
|
+
r"""Fetches the wave data for all :py:attr:`~nirfmxvna.attributes.AttributeID.WAVES_FORMAT` types.
|
|
167
|
+
|
|
168
|
+
Use "wave<*n*>" as the selector string to read results from this method.
|
|
169
|
+
|
|
170
|
+
For different :py:attr:`~nirfmxvna.attributes.AttributeID.WAVES_FORMAT`, the data is returned as follows:
|
|
171
|
+
|
|
172
|
+
+----------------------+-----------------------------------------------------------------+----------------------------------------------------------------------+
|
|
173
|
+
| Waves Format | Y1 | Y2 |
|
|
174
|
+
+======================+=================================================================+======================================================================+
|
|
175
|
+
| Magnitude (0) | Magnitude of the wave data | Empty array |
|
|
176
|
+
+----------------------+-----------------------------------------------------------------+----------------------------------------------------------------------+
|
|
177
|
+
| Phase (1) | Phase of the wave data | Empty array |
|
|
178
|
+
+----------------------+-----------------------------------------------------------------+----------------------------------------------------------------------+
|
|
179
|
+
| Complex (2) | Real part of the complex wave data | Imaginary part of the complex wave data |
|
|
180
|
+
+----------------------+-----------------------------------------------------------------+----------------------------------------------------------------------+
|
|
181
|
+
| SWR (3) | Standing wave ratio computed from the wave data | Empty array |
|
|
182
|
+
+----------------------+-----------------------------------------------------------------+----------------------------------------------------------------------+
|
|
183
|
+
| Smith Impedance (4) | Real part of the complex impedance computed from the wave data | Imaginary part of the complex impedance computed from the wave data |
|
|
184
|
+
+----------------------+-----------------------------------------------------------------+----------------------------------------------------------------------+
|
|
185
|
+
| Smith Admittance (5) | Real part of the complex admittance computed from the wave data | Imaginary part of the complex admittance computed from the wave data |
|
|
186
|
+
+----------------------+-----------------------------------------------------------------+----------------------------------------------------------------------+
|
|
187
|
+
| Polar (6) | Magnitude of the wave data | Phase of the wave data |
|
|
188
|
+
+----------------------+-----------------------------------------------------------------+----------------------------------------------------------------------+
|
|
189
|
+
| Group Delay (7) | Group delay computed from the wave data | Empty array |
|
|
190
|
+
+----------------------+-----------------------------------------------------------------+----------------------------------------------------------------------+
|
|
191
|
+
|
|
192
|
+
Args:
|
|
193
|
+
selector_string (string):
|
|
194
|
+
This parameter specifies a selector string comprising of result name, and S-Parameter number.
|
|
195
|
+
|
|
196
|
+
Example:
|
|
197
|
+
|
|
198
|
+
"sparam0"
|
|
199
|
+
|
|
200
|
+
"result::r1/sparam0"
|
|
201
|
+
|
|
202
|
+
You can use the :py:meth:`build_s_parameter_string` method to build the selector string.
|
|
203
|
+
|
|
204
|
+
timeout (float):
|
|
205
|
+
This parameter specifies the timeout, in seconds, for fetching the specified measurement. Set this value to an
|
|
206
|
+
appropriate time, longer than expected for fetching the measurement.A value of -1 specifies that the method waits until
|
|
207
|
+
the measurement is complete. The default value is 10.
|
|
208
|
+
|
|
209
|
+
Returns:
|
|
210
|
+
Tuple (y1, y2, error_code):
|
|
211
|
+
|
|
212
|
+
y1 (float):
|
|
213
|
+
This parameter returns Y1 data array. You can refer to the method description for interpreting Y data based on
|
|
214
|
+
:py:attr:`~nirfmxvna.attributes.AttributeID.WAVES_FORMAT` type.
|
|
215
|
+
|
|
216
|
+
y2 (float):
|
|
217
|
+
This parameter returns Y2 data array. You can refer to the method description for interpreting Y data based on
|
|
218
|
+
:py:attr:`~nirfmxvna.attributes.AttributeID.WAVES_FORMAT` type.
|
|
219
|
+
|
|
220
|
+
error_code (int):
|
|
221
|
+
Returns the status code of this method. The status code either indicates success or describes a warning condition.
|
|
222
|
+
"""
|
|
223
|
+
try:
|
|
224
|
+
self._session_function_lock.enter_read_lock()
|
|
225
|
+
_helper.validate_not_none(selector_string, "selector_string")
|
|
226
|
+
updated_selector_string = _helper.validate_and_update_selector_string(
|
|
227
|
+
selector_string, self._signal_obj
|
|
228
|
+
)
|
|
229
|
+
y1, y2, error_code = self._interpreter.waves_fetch_y_data(
|
|
230
|
+
updated_selector_string, timeout
|
|
231
|
+
)
|
|
232
|
+
finally:
|
|
233
|
+
self._session_function_lock.exit_read_lock()
|
|
234
|
+
|
|
235
|
+
return y1, y2, error_code
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nirfmxvna
|
|
3
|
+
Version: 26.3.0
|
|
4
|
+
Summary: Python APIs for interacting with RFmx VNA Product
|
|
5
|
+
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: rfmx,nirfmx,nirfmxvna
|
|
8
|
+
Author: NI
|
|
9
|
+
Author-email: opensource@ni.com
|
|
10
|
+
Maintainer: Thangam V
|
|
11
|
+
Maintainer-email: thangam.v@emerson.com
|
|
12
|
+
Requires-Python: >=3.9,<4.0
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Manufacturing
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
26
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
27
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
28
|
+
Classifier: Topic :: Scientific/Engineering :: Instrument Drivers
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: fasteners (>=0.19)
|
|
31
|
+
Requires-Dist: grpcio (>=1.49.0,<2.0)
|
|
32
|
+
Requires-Dist: hightime (>=0.2.2)
|
|
33
|
+
Requires-Dist: nirfmxinstr (==26.3.0)
|
|
34
|
+
Requires-Dist: numpy (>=1.22) ; python_version >= "3.9" and python_version < "3.12" and implementation_name != "pypy"
|
|
35
|
+
Requires-Dist: numpy (>=1.26) ; implementation_name != "pypy" and python_version == "3.12"
|
|
36
|
+
Requires-Dist: numpy (>=2.1) ; implementation_name == "pypy" and python_version == "3.10"
|
|
37
|
+
Requires-Dist: numpy (>=2.1) ; python_version >= "3.13" and python_version < "4.0" and implementation_name != "pypy"
|
|
38
|
+
Requires-Dist: numpy (>=2.3) ; python_version >= "3.11" and python_version < "4.0" and implementation_name == "pypy"
|
|
39
|
+
Requires-Dist: protobuf (>=4.21)
|
|
40
|
+
Project-URL: Documentation, https://nirfmx-python-nirfmxvna.readthedocs-hosted.com/
|
|
41
|
+
Project-URL: Repository, https://github.com/ni/nirfmx-python
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
| **Info** | Contains Python APIs for interacting with RFmx VNA Product. |
|
|
45
|
+
| :------------ | :-------------------------------------------------------------- |
|
|
46
|
+
| **Author** | National Instruments |
|
|
47
|
+
|
|
48
|
+
# Table of Contents
|
|
49
|
+
|
|
50
|
+
- [Table of Contents](#table-of-contents)
|
|
51
|
+
- [About](#about)
|
|
52
|
+
- [Documentation](#documentation)
|
|
53
|
+
- [Operating System Support](#operating-system-support)
|
|
54
|
+
- [Installation](#installation)
|
|
55
|
+
- [License](#license)
|
|
56
|
+
- [Support and Feedback](#support-and-feedback)
|
|
57
|
+
- [Example](#example)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# About
|
|
61
|
+
|
|
62
|
+
The **nirfmx-python** repository generates Python bindings (Application Programming Interface)
|
|
63
|
+
for interacting with the RFmx Products.
|
|
64
|
+
|
|
65
|
+
**nirfmx-python** follows [Python Software Foundation](https://devguide.python.org/#status-of-python-branches)
|
|
66
|
+
support policy for different versions.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## RFmx Instr Python API Status
|
|
70
|
+
|
|
71
|
+
| Item | Details |
|
|
72
|
+
|------------------------------|-------------------------------|
|
|
73
|
+
| **Driver Version Tested** | [2026 Q2](http://www.ni.com/downloads/) |
|
|
74
|
+
| **Supported Python Versions**| Python 3.9+ (64-bit) |
|
|
75
|
+
| **Documentation** | [RFmx Instr Docs](https://nirfmx-python-nirfmxinstr.readthedocs-hosted.com/en/latest/) |
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## RFmx VNA Python API Status
|
|
79
|
+
|
|
80
|
+
| Item | Details |
|
|
81
|
+
|------------------------------|-------------------------------|
|
|
82
|
+
| **Driver Version Tested** | [2026 Q2](http://www.ni.com/downloads/) |
|
|
83
|
+
| **Supported Python Versions**| Python 3.9+ (64-bit) |
|
|
84
|
+
| **Documentation** | [RFmx VNA Docs](https://nirfmx-python-nirfmxvna.readthedocs-hosted.com/en/latest/) |
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## Documentation
|
|
88
|
+
|
|
89
|
+
You can find the latest API documentation for the **nirfmx-python** package
|
|
90
|
+
on [Read the Docs](https://nirfmx-python-nirfmxinstr.readthedocs-hosted.com/en/latest/)
|
|
91
|
+
|
|
92
|
+
Refer to the [RFmx User Manual](https://www.ni.com/docs/en-US/bundle/rfmx/page/user-manual-welcome.html)
|
|
93
|
+
for an overview of RFmx, system requirements, troubleshooting, key concepts, etc.
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
## Operating System Support
|
|
97
|
+
|
|
98
|
+
**nirfmx-python** supports Windows systems where the supported drivers are
|
|
99
|
+
installed. Refer to [NI Hardware and Operating System Compatibility](https://www.ni.com/r/hw-support) for
|
|
100
|
+
which versions of the driver support your hardware on a given operating system.
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
## Installation
|
|
104
|
+
|
|
105
|
+
You can use [pip](http://pypi.python.org/pypi/pip) to download [nirfmxvna](https://pypi.org/project/nirfmxvna/) and install it.
|
|
106
|
+
|
|
107
|
+
$ python -m pip install nirfmxvna
|
|
108
|
+
|
|
109
|
+
## Upgrade
|
|
110
|
+
|
|
111
|
+
You can use [pip](http://pypi.python.org/pypi/pip) to upgrade [nirfmxvna](https://pypi.org/project/nirfmxvna/) package using following command:
|
|
112
|
+
|
|
113
|
+
$ python -m pip install nirfmxvna --upgrade
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
This project is licensed under the MIT License. While the source code is not publicly released,
|
|
119
|
+
the license permits binary distribution with attribution.
|
|
120
|
+
|
|
121
|
+
**Note:** This Python driver depends on several third-party components that are subject to separate
|
|
122
|
+
commercial licenses. Users are responsible for ensuring they have the appropriate rights and licenses
|
|
123
|
+
to use those dependencies in their environments.
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
# gRPC Features
|
|
127
|
+
|
|
128
|
+
For driver APIs that support it, passing a GrpcSessionOptions instance as a parameter to nirfmxinstr.Session.__init__() is subject to the NI General Purpose EULA.
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
# SSL/TLS Support
|
|
132
|
+
|
|
133
|
+
The server supports both server-side TLS and mutual TLS. Security configuration is accomplished by setting the `server_cert`, `server_key` and `root_cert` values in the server's configuration file. The server expects the certificate files specified in the configuration file to exist in a `certs` folder that is located in the same directory as the configuration file being used by the server. For more detailed information on SSL/TLS support refer to the [Server Security Support wiki page](https://github.com/ni/grpc-device/wiki/Server-Security-Support).
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
## Support and Feedback
|
|
137
|
+
|
|
138
|
+
For support with Python API, hardware, the driver runtime or any other questions,
|
|
139
|
+
please visit [NI Community Forums](https://forums.ni.com/).
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
## RFmxVNA Example
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
import nirfmxinstr
|
|
146
|
+
import nirfmxvna
|
|
147
|
+
import numpy
|
|
148
|
+
|
|
149
|
+
instr_session = None
|
|
150
|
+
vna_signal = None
|
|
151
|
+
|
|
152
|
+
try:
|
|
153
|
+
# Create a new RFmx Session
|
|
154
|
+
instr_session = nirfmxinstr.Session(resource_name, option_string)
|
|
155
|
+
|
|
156
|
+
# Get VNA signal configuration
|
|
157
|
+
vna_signal = instr_session.get_vna_signal_configuration()
|
|
158
|
+
|
|
159
|
+
instr_session.configure_frequency_reference(
|
|
160
|
+
"", frequency_reference_source, frequency_reference_frequency
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
vna_signal.set_sweep_type("", sweep_type)
|
|
164
|
+
vna_signal.set_start_frequency("", start_frequency)
|
|
165
|
+
vna_signal.set_stop_frequency("", stop_frequency)
|
|
166
|
+
vna_signal.set_number_of_points("", frequency_points)
|
|
167
|
+
vna_signal.set_if_bandwidth("", if_bandwidth)
|
|
168
|
+
|
|
169
|
+
port_selector_string = nirfmxvna.Vna.build_port_string("", "port1")
|
|
170
|
+
vna_signal.set_power_level(port_selector_string, port1_power_level)
|
|
171
|
+
vna_signal.set_test_receiver_attenuation(
|
|
172
|
+
port_selector_string, port1_test_receiver_attenuation
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
port_selector_string = nirfmxvna.Vna.build_port_string("", "port2")
|
|
176
|
+
vna_signal.set_power_level(port_selector_string, port2_power_level)
|
|
177
|
+
vna_signal.set_test_receiver_attenuation(
|
|
178
|
+
port_selector_string, port2_test_receiver_attenuation
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
vna_signal.set_averaging_enabled("", averaging_enabled)
|
|
182
|
+
vna_signal.set_averaging_count("", averaging_count)
|
|
183
|
+
|
|
184
|
+
vna_signal.select_measurements("", measurement, enable_all_traces)
|
|
185
|
+
|
|
186
|
+
vna_signal.waves.configuration.set_number_of_waves("", number_of_waves)
|
|
187
|
+
|
|
188
|
+
for i in range(number_of_waves):
|
|
189
|
+
wave_selector_string = nirfmxvna.Vna.build_wave_string("", i)
|
|
190
|
+
vna_signal.waves.configuration.configure_wave(wave_selector_string, waves[i])
|
|
191
|
+
vna_signal.waves.configuration.set_format(wave_selector_string, waves_formats[i])
|
|
192
|
+
|
|
193
|
+
vna_signal.waves.configuration.set_magnitude_units("", magnitude_units)
|
|
194
|
+
vna_signal.waves.configuration.set_phase_trace_type("", phase_trace_type)
|
|
195
|
+
|
|
196
|
+
vna_signal.initiate("", "")
|
|
197
|
+
|
|
198
|
+
# Retrieve results
|
|
199
|
+
number_of_waves_result, error_code = vna_signal.waves.configuration.get_number_of_waves("")
|
|
200
|
+
|
|
201
|
+
waves_x_data_result = numpy.empty(0, dtype=numpy.float64)
|
|
202
|
+
waves_x_data_result = vna_signal.waves.results.fetch_x_data("", timeout)
|
|
203
|
+
|
|
204
|
+
waves_y1_data_result = []
|
|
205
|
+
waves_y2_data_result = []
|
|
206
|
+
|
|
207
|
+
for i in range(number_of_waves_result):
|
|
208
|
+
wave_selector_string = nirfmxvna.Vna.build_wave_string("", i)
|
|
209
|
+
|
|
210
|
+
y1_data, y2_data, error_code = vna_signal.waves.results.fetch_y_data(
|
|
211
|
+
wave_selector_string, timeout
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
waves_y1_data_result.append(y1_data)
|
|
215
|
+
waves_y2_data_result.append(y2_data)
|
|
216
|
+
|
|
217
|
+
except Exception as e:
|
|
218
|
+
print(f"Error occurred: {e}")
|
|
219
|
+
sys.exit(1)
|
|
220
|
+
|
|
221
|
+
finally:
|
|
222
|
+
if vna_signal is not None:
|
|
223
|
+
vna_signal.dispose()
|
|
224
|
+
vna_signal = None
|
|
225
|
+
if instr_session is not None:
|
|
226
|
+
instr_session.close()
|
|
227
|
+
instr_session = None
|
|
228
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
nirfmxvna/__init__.py,sha256=p7G2HkD_D35ly11Cx9tPiL89fXb42HCHrlAkZySCPdU,3716
|
|
2
|
+
nirfmxvna/attributes.py,sha256=vVW-XCSl_F21xRtfSHXLJIZTyn36CFhVaxclJHZU_Vw,163385
|
|
3
|
+
nirfmxvna/enums.py,sha256=wcKtv2fPNNQJ1cr_AEnBmxPY0gmvN7bKG5gWk0E3zqs,39335
|
|
4
|
+
nirfmxvna/errors.py,sha256=S1e0dzek3sKb8IfIgjHpoig4uWE-O9qvpKQlVlu7JrA,3774
|
|
5
|
+
nirfmxvna/examples/nirfmxvna_calibration_with_calset_save_two_port.py,sha256=SzJrUiUfsEHb-tV6ukvYmWABRVJMg97w9bls9JkJcno,6522
|
|
6
|
+
nirfmxvna/examples/nirfmxvna_pulsed_s_params.py,sha256=KRRdgSXZ5_L7RLDVEDi5cQuKeFM-5ZEdpl3xMi_xKCU,5854
|
|
7
|
+
nirfmxvna/examples/nirfmxvna_s_params_corrected_with_calset_load_two_port_grpc.py,sha256=ALMi4pqEUOaq5aFv9J7dD7RjVy0C4MXfAynB4piHOKE,8041
|
|
8
|
+
nirfmxvna/examples/nirfmxvna_waves.py,sha256=2JlIOcpuzTze78NlChDgUPy9pmPiJwh2zhGe8GtDW-M,5525
|
|
9
|
+
nirfmxvna/grpc_session_options.py,sha256=pGmDFtqVHaeQ7O4H2p8RRB0mPgj0rCLQ4kYkMHF9jRw,2888
|
|
10
|
+
nirfmxvna/internal/_custom_types.py,sha256=ApUJ0zbMCiSxnrzStwyHIXe2Yi-HXPjszMF0UPt1UVQ,468
|
|
11
|
+
nirfmxvna/internal/_grpc_stub_interpreter.py,sha256=DwnZ723SYq5B017RD0IB1kg3fatxJgQNtrzaLSHsW1M,91313
|
|
12
|
+
nirfmxvna/internal/_helper.py,sha256=D8R2YLRh6_K2deu_bqeffp2-ZRqrz6JPcGPmqAXRTOk,13664
|
|
13
|
+
nirfmxvna/internal/_library.py,sha256=7jTSeRFQr1asZb3JUTSoSjdTRyC62PBsqDlHU1m8FEI,191623
|
|
14
|
+
nirfmxvna/internal/_library_interpreter.py,sha256=shsbOhG_bTW6hG-I-MwRzwTd1HDdzFAQvNq6QM3g9Fk,156418
|
|
15
|
+
nirfmxvna/internal/_library_singleton.py,sha256=fcBoIYYVWiOUaL_K4KwwOoP0OtNu-LmDXoAZv1kkhlk,1744
|
|
16
|
+
nirfmxvna/internal/nidevice_pb2.py,sha256=rcppHywj1FzKj-eleSWHpD88j2I0Mx15YexqslIXOb0,1948
|
|
17
|
+
nirfmxvna/internal/nidevice_pb2_grpc.py,sha256=N8jhK5s_FBGwa9EiVeni7MHXctdGPsIyv-lCndxroCU,161
|
|
18
|
+
nirfmxvna/internal/nirfmxvna_pb2.py,sha256=DGh6KafxAc20jKh6OZsJVm8LWPTIvBcdsTBSM77S0Fg,212299
|
|
19
|
+
nirfmxvna/internal/nirfmxvna_pb2_grpc.py,sha256=_VJSLTL0Nd5Njv7ND4kbdqFK7Jm7PhmdP6XjRnzaLiI,426611
|
|
20
|
+
nirfmxvna/internal/session_pb2.py,sha256=Zi9vhO5_hM0jY1njrqy7eYxMfRG9WDVieg2C5NGQ3As,1544
|
|
21
|
+
nirfmxvna/internal/session_pb2_grpc.py,sha256=N8jhK5s_FBGwa9EiVeni7MHXctdGPsIyv-lCndxroCU,161
|
|
22
|
+
nirfmxvna/iq.py,sha256=nsUnkOrlzpD8j_U3Y_EoN76CifkMwwRi5lFHXcAGkuk,1057
|
|
23
|
+
nirfmxvna/iq_configuration.py,sha256=jp8UiKjFcjWwrxsf-y7qAOMSRfx2OYrZIPz2rkTPXOQ,12525
|
|
24
|
+
nirfmxvna/iq_results.py,sha256=KvQ8nmwyk__Njw3ifxpMolmtOEi4oi7Q53x3zZPP7Tk,5187
|
|
25
|
+
nirfmxvna/marker.py,sha256=ZlJJO1jezowIiBlQxCQIGORpDSPv6WRMqB3P3BiOWYY,1089
|
|
26
|
+
nirfmxvna/marker_configuration.py,sha256=6KGHVg6E1NgSVybQQbWP_7nYl8g-oBBoItz9RBXWIto,20877
|
|
27
|
+
nirfmxvna/marker_results.py,sha256=HHtb8Zx4eIrX4OTC2lozHoD1f-eDZeXC9rY6dGZ5eTM,10201
|
|
28
|
+
nirfmxvna/s_params.py,sha256=w2OXyqaxUUHtd0oj-urHd5qwRvNiQuOT7vRHIy3Vgk0,1099
|
|
29
|
+
nirfmxvna/s_params_configuration.py,sha256=URSyZbQhkjB_LSbb73Hqeh7beRpkLOCHozqUF_WG2yk,96002
|
|
30
|
+
nirfmxvna/s_params_results.py,sha256=1b51_AJQteH1oQAYTEMVEDvfsBPKahxqZQ53MUw5iQA,15134
|
|
31
|
+
nirfmxvna/vna.py,sha256=l_fv_3VkSaBCH_kFxHsLuMN2vc_6x6YOpR0Ej-O44S8,674169
|
|
32
|
+
nirfmxvna/waves.py,sha256=_IHNcRNPQLUahLvmSNc7VkJPgMFUiyBpN3zpI37KF_4,1081
|
|
33
|
+
nirfmxvna/waves_configuration.py,sha256=YqO2xQoCGpY88cv3hjMJx7gZK9uF-UGuE0RxzPJWeQM,70059
|
|
34
|
+
nirfmxvna/waves_results.py,sha256=A1-ko8zH34_NajlmdgXsKTKtNHZTkluvlf21u3Fbwm8,13496
|
|
35
|
+
nirfmxvna-26.3.0.dist-info/licenses/LICENSE,sha256=2rv67glEAxLA-Ksqn8N4GnBrBHZcotMa-pbB4eoZeYo,1555
|
|
36
|
+
nirfmxvna-26.3.0.dist-info/METADATA,sha256=GtLsOeLdniOwFgEHBQp69oP-KWqRaqoNirxpi7hDLto,8966
|
|
37
|
+
nirfmxvna-26.3.0.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
|
|
38
|
+
nirfmxvna-26.3.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
This project is licensed under the MIT License
|
|
2
|
+
(http://www.opensource.org/licenses/mit-license.php).
|
|
3
|
+
While the source code is not publicly released,
|
|
4
|
+
the license permits binary distribution with attribution.
|
|
5
|
+
|
|
6
|
+
Note: This Python driver depends on several third-party
|
|
7
|
+
components that are subject to separate commercial licenses.
|
|
8
|
+
Users are responsible for ensuring they have the appropriate
|
|
9
|
+
rights and licenses to use those dependencies in their environments.
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2025, National Instruments Corp.
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
14
|
+
a copy of this software and associated documentation files (the
|
|
15
|
+
"Software"), to deal in the Software without restriction, including
|
|
16
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
17
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
18
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
19
|
+
the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included
|
|
22
|
+
in all copies or substantial portions of the Software.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
25
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
26
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
27
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
28
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
29
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
30
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|