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,3011 @@
|
|
|
1
|
+
"""Library C<->Python interpreter.
|
|
2
|
+
|
|
3
|
+
This class is responsible for interpreting the Library's C API. It is responsible for:
|
|
4
|
+
* Converting ctypes to native Python types.
|
|
5
|
+
* Dealing with string encoding.
|
|
6
|
+
* Allocating memory.
|
|
7
|
+
* Converting errors returned by Library into Python exceptions.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import array
|
|
11
|
+
import ctypes
|
|
12
|
+
import math
|
|
13
|
+
from typing import Any
|
|
14
|
+
|
|
15
|
+
import nirfmxinstr
|
|
16
|
+
import nirfmxvna.attributes as attributes
|
|
17
|
+
import nirfmxvna.enums as enums
|
|
18
|
+
import nirfmxvna.errors as errors
|
|
19
|
+
import nirfmxvna.internal._custom_types as _custom_types
|
|
20
|
+
import nirfmxvna.internal._helper as _helper
|
|
21
|
+
import nirfmxvna.internal._library_singleton as _library_singleton
|
|
22
|
+
import numpy
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# Helper functions for creating ctypes needed for calling into the driver DLL
|
|
26
|
+
def _get_ctypes_pointer_for_buffer(
|
|
27
|
+
value: Any = None, library_type: Any = None, size: Any = None
|
|
28
|
+
) -> Any:
|
|
29
|
+
if isinstance(value, array.array):
|
|
30
|
+
assert library_type is not None, "library_type is required for array.array"
|
|
31
|
+
addr, _ = value.buffer_info()
|
|
32
|
+
return ctypes.cast(addr, ctypes.POINTER(library_type))
|
|
33
|
+
elif str(type(value)).find("'numpy.ndarray'") != -1:
|
|
34
|
+
import numpy
|
|
35
|
+
|
|
36
|
+
if "complex" in str(value.dtype):
|
|
37
|
+
complex_dtype = numpy.dtype(library_type)
|
|
38
|
+
structured_array = value.view(complex_dtype)
|
|
39
|
+
return structured_array.ctypes.data_as(ctypes.POINTER(library_type))
|
|
40
|
+
else:
|
|
41
|
+
return numpy.ctypeslib.as_ctypes(value)
|
|
42
|
+
elif isinstance(value, bytes):
|
|
43
|
+
return ctypes.cast(value, ctypes.POINTER(library_type)) # type: ignore
|
|
44
|
+
elif isinstance(value, list):
|
|
45
|
+
assert library_type is not None, "library_type is required for list"
|
|
46
|
+
return (library_type * len(value))(*value)
|
|
47
|
+
else:
|
|
48
|
+
if library_type is not None and size is not None:
|
|
49
|
+
return (library_type * size)()
|
|
50
|
+
else:
|
|
51
|
+
return None
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _convert_to_array(value: Any, array_type: Any) -> Any:
|
|
55
|
+
if value is not None:
|
|
56
|
+
if isinstance(value, array.array):
|
|
57
|
+
value_array = value
|
|
58
|
+
else:
|
|
59
|
+
value_array = array.array(array_type, value)
|
|
60
|
+
else:
|
|
61
|
+
value_array = None
|
|
62
|
+
|
|
63
|
+
return value_array
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class LibraryInterpreter(object):
|
|
67
|
+
"""Library C<->Python interpreter.
|
|
68
|
+
|
|
69
|
+
This class is responsible for interpreting the Library's C API. It is responsible for:
|
|
70
|
+
* Converting ctypes to native Python types.
|
|
71
|
+
* Dealing with string encoding.
|
|
72
|
+
* Allocating memory.
|
|
73
|
+
* Converting errors returned by Library into Python exceptions.
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
_cls_encoding = "windows-1251"
|
|
77
|
+
_cls_library = _library_singleton.get()
|
|
78
|
+
|
|
79
|
+
def __init__(self, encoding, session=None, signal_obj=None):
|
|
80
|
+
"""Initializes the LibraryInterpreter."""
|
|
81
|
+
self._encoding = encoding
|
|
82
|
+
self._library = _library_singleton.get()
|
|
83
|
+
self._signal_obj = signal_obj
|
|
84
|
+
self._instr_session = session
|
|
85
|
+
# Initialize _vi to 0 for now.
|
|
86
|
+
# Session will directly update it once the driver runtime init function has been called and
|
|
87
|
+
# we have a valid session handle.
|
|
88
|
+
self.set_session_handle()
|
|
89
|
+
|
|
90
|
+
def set_session_handle(self, value: Any = 0) -> None:
|
|
91
|
+
"""Sets the session handle."""
|
|
92
|
+
self._vi = value
|
|
93
|
+
|
|
94
|
+
def get_session_handle(self) -> Any:
|
|
95
|
+
"""Returns the session handle."""
|
|
96
|
+
return self._vi
|
|
97
|
+
|
|
98
|
+
def get_error_string(self, error_code: int) -> Any:
|
|
99
|
+
"""Returns the error message."""
|
|
100
|
+
error_code_ctype = ctypes.c_int32(error_code)
|
|
101
|
+
error_string_ctype = ctypes.create_string_buffer(0)
|
|
102
|
+
size_or_error_code = self._library.RFmxVNA_GetErrorString(
|
|
103
|
+
self._vi, error_code_ctype, 0, None
|
|
104
|
+
)
|
|
105
|
+
if size_or_error_code > 0 and error_code_ctype.value != 0:
|
|
106
|
+
error_string_ctype = ctypes.create_string_buffer(size_or_error_code)
|
|
107
|
+
self._library.RFmxVNA_GetErrorString(
|
|
108
|
+
self._vi, error_code_ctype, size_or_error_code, error_string_ctype
|
|
109
|
+
)
|
|
110
|
+
return error_string_ctype.value.decode(self._encoding)
|
|
111
|
+
|
|
112
|
+
def get_error(self) -> tuple[int, Any]:
|
|
113
|
+
"""Returns the error code and error message."""
|
|
114
|
+
error_code_ctype = ctypes.c_int32()
|
|
115
|
+
error_string_ctype = ctypes.create_string_buffer(0)
|
|
116
|
+
size_or_error_code = self._library.RFmxVNA_GetError(self._vi, error_code_ctype, 0, None)
|
|
117
|
+
if size_or_error_code > 0 and error_code_ctype.value != 0:
|
|
118
|
+
error_code_ctype = ctypes.c_int32(error_code_ctype.value)
|
|
119
|
+
error_string_ctype = ctypes.create_string_buffer(size_or_error_code)
|
|
120
|
+
self._library.RFmxVNA_GetError(
|
|
121
|
+
self._vi, error_code_ctype, size_or_error_code, error_string_ctype
|
|
122
|
+
)
|
|
123
|
+
return error_code_ctype.value, error_string_ctype.value.decode(self._encoding)
|
|
124
|
+
|
|
125
|
+
def get_error_description(self, error_code: Any) -> Any:
|
|
126
|
+
"""Returns the error description."""
|
|
127
|
+
try:
|
|
128
|
+
returned_error_code, error_string = self.get_error()
|
|
129
|
+
if returned_error_code == error_code:
|
|
130
|
+
return error_string
|
|
131
|
+
except errors.Error:
|
|
132
|
+
pass
|
|
133
|
+
|
|
134
|
+
try:
|
|
135
|
+
"""
|
|
136
|
+
It is expected for get_error to raise when the session is invalid
|
|
137
|
+
Use get_error_string instead. It doesn't require a session.
|
|
138
|
+
"""
|
|
139
|
+
error_string = self.get_error_string(error_code)
|
|
140
|
+
return error_string
|
|
141
|
+
except errors.Error:
|
|
142
|
+
pass
|
|
143
|
+
return "Failed to retrieve error description."
|
|
144
|
+
|
|
145
|
+
def reset_attribute(self, selector_string, attribute_id):
|
|
146
|
+
"""reset_attribute."""
|
|
147
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
148
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
149
|
+
attribute_id_ctype = ctypes.c_int32(attribute_id)
|
|
150
|
+
error_code = self._library.RFmxVNA_ResetAttribute(
|
|
151
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype
|
|
152
|
+
)
|
|
153
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
154
|
+
return error_code
|
|
155
|
+
|
|
156
|
+
def check_if_current_signal_exists(self):
|
|
157
|
+
"""check_if_current_signal_exists."""
|
|
158
|
+
return_value = False
|
|
159
|
+
if self._signal_obj is not None and not self._signal_obj.signal_configuration_name:
|
|
160
|
+
signal_configuration_exists, local_personality, _ = (
|
|
161
|
+
self._signal_obj._rfmxinstrsession_interpreter.check_if_signal_exists(
|
|
162
|
+
self._signal_obj._default_signal_name_user_visible
|
|
163
|
+
)
|
|
164
|
+
)
|
|
165
|
+
return_value = signal_configuration_exists and (
|
|
166
|
+
local_personality.value == nirfmxinstr.Personalities.VNA.value
|
|
167
|
+
)
|
|
168
|
+
elif self._signal_obj is not None:
|
|
169
|
+
signal_configuration_exists, local_personality, _ = (
|
|
170
|
+
self._signal_obj._rfmxinstrsession_interpreter.check_if_signal_exists(
|
|
171
|
+
self._signal_obj.signal_configuration_name
|
|
172
|
+
)
|
|
173
|
+
)
|
|
174
|
+
return_value = signal_configuration_exists and (
|
|
175
|
+
local_personality.value == nirfmxinstr.Personalities.VNA.value
|
|
176
|
+
)
|
|
177
|
+
return return_value
|
|
178
|
+
|
|
179
|
+
def get_attribute_i8(self, selector_string, attribute_id):
|
|
180
|
+
"""get_attribute_i8."""
|
|
181
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
182
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
183
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
184
|
+
attr_val_ctype = ctypes.c_int8()
|
|
185
|
+
error_code = self._library.RFmxVNA_GetAttributeI8(
|
|
186
|
+
vi_ctype,
|
|
187
|
+
selector_string_ctype,
|
|
188
|
+
attribute_id_ctype,
|
|
189
|
+
None if attr_val_ctype is None else (ctypes.pointer(attr_val_ctype)),
|
|
190
|
+
)
|
|
191
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
192
|
+
return attr_val_ctype.value, error_code
|
|
193
|
+
|
|
194
|
+
def set_attribute_i8(self, selector_string, attribute_id, attr_val):
|
|
195
|
+
"""set_attribute_i8."""
|
|
196
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
197
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
198
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
199
|
+
attr_val_ctype = ctypes.c_int8(attr_val)
|
|
200
|
+
error_code = self._library.RFmxVNA_SetAttributeI8(
|
|
201
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype
|
|
202
|
+
)
|
|
203
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
204
|
+
return error_code
|
|
205
|
+
|
|
206
|
+
def get_attribute_i8_array(self, selector_string, attribute_id):
|
|
207
|
+
"""get_attribute_i8_array."""
|
|
208
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
209
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
210
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
211
|
+
attr_val_ctype = None
|
|
212
|
+
array_size_ctype = ctypes.c_int32()
|
|
213
|
+
actual_array_size_ctype = ctypes.c_int32()
|
|
214
|
+
error_code = self._library.RFmxVNA_GetAttributeI8Array(
|
|
215
|
+
vi_ctype,
|
|
216
|
+
selector_string_ctype,
|
|
217
|
+
attribute_id_ctype,
|
|
218
|
+
attr_val_ctype,
|
|
219
|
+
array_size_ctype,
|
|
220
|
+
None if actual_array_size_ctype is None else (ctypes.pointer(actual_array_size_ctype)),
|
|
221
|
+
)
|
|
222
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
223
|
+
attr_val_array = numpy.empty(actual_array_size_ctype.value, dtype=numpy.int8)
|
|
224
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
225
|
+
value=attr_val_array, library_type=ctypes.c_int8
|
|
226
|
+
)
|
|
227
|
+
error_code = self._library.RFmxVNA_GetAttributeI8Array(
|
|
228
|
+
vi_ctype,
|
|
229
|
+
selector_string_ctype,
|
|
230
|
+
attribute_id_ctype,
|
|
231
|
+
attr_val_ctype,
|
|
232
|
+
actual_array_size_ctype,
|
|
233
|
+
None,
|
|
234
|
+
)
|
|
235
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
236
|
+
return attr_val_array, error_code
|
|
237
|
+
|
|
238
|
+
def set_attribute_i8_array(self, selector_string, attribute_id, attr_val):
|
|
239
|
+
"""set_attribute_i8_array."""
|
|
240
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
241
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
242
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
243
|
+
attr_val_array = _convert_to_array(value=attr_val, array_type="i")
|
|
244
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
245
|
+
value=attr_val_array, library_type=ctypes.c_int8
|
|
246
|
+
)
|
|
247
|
+
error_code = self._library.RFmxVNA_SetAttributeI8Array(
|
|
248
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype, len(attr_val)
|
|
249
|
+
)
|
|
250
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
251
|
+
return error_code
|
|
252
|
+
|
|
253
|
+
def get_attribute_i16(self, selector_string, attribute_id):
|
|
254
|
+
"""get_attribute_i16."""
|
|
255
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
256
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
257
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
258
|
+
attr_val_ctype = ctypes.c_int16()
|
|
259
|
+
error_code = self._library.RFmxVNA_GetAttributeI16(
|
|
260
|
+
vi_ctype,
|
|
261
|
+
selector_string_ctype,
|
|
262
|
+
attribute_id_ctype,
|
|
263
|
+
None if attr_val_ctype is None else (ctypes.pointer(attr_val_ctype)),
|
|
264
|
+
)
|
|
265
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
266
|
+
return attr_val_ctype.value, error_code
|
|
267
|
+
|
|
268
|
+
def set_attribute_i16(self, selector_string, attribute_id, attr_val):
|
|
269
|
+
"""set_attribute_i16."""
|
|
270
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
271
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
272
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
273
|
+
attr_val_ctype = ctypes.c_int16(attr_val)
|
|
274
|
+
error_code = self._library.RFmxVNA_SetAttributeI16(
|
|
275
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype
|
|
276
|
+
)
|
|
277
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
278
|
+
return error_code
|
|
279
|
+
|
|
280
|
+
def get_attribute_i32(self, selector_string, attribute_id):
|
|
281
|
+
"""get_attribute_i32."""
|
|
282
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
283
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
284
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
285
|
+
attr_val_ctype = ctypes.c_int32()
|
|
286
|
+
error_code = self._library.RFmxVNA_GetAttributeI32(
|
|
287
|
+
vi_ctype,
|
|
288
|
+
selector_string_ctype,
|
|
289
|
+
attribute_id_ctype,
|
|
290
|
+
None if attr_val_ctype is None else (ctypes.pointer(attr_val_ctype)),
|
|
291
|
+
)
|
|
292
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
293
|
+
return attr_val_ctype.value, error_code
|
|
294
|
+
|
|
295
|
+
def set_attribute_i32(self, selector_string, attribute_id, attr_val):
|
|
296
|
+
"""set_attribute_i32."""
|
|
297
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
298
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
299
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
300
|
+
attr_val_ctype = ctypes.c_int32(attr_val)
|
|
301
|
+
error_code = self._library.RFmxVNA_SetAttributeI32(
|
|
302
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype
|
|
303
|
+
)
|
|
304
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
305
|
+
return error_code
|
|
306
|
+
|
|
307
|
+
def get_attribute_i32_array(self, selector_string, attribute_id):
|
|
308
|
+
"""get_attribute_i32_array."""
|
|
309
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
310
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
311
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
312
|
+
attr_val_ctype = None
|
|
313
|
+
array_size_ctype = ctypes.c_int32()
|
|
314
|
+
actual_array_size_ctype = ctypes.c_int32()
|
|
315
|
+
error_code = self._library.RFmxVNA_GetAttributeI32Array(
|
|
316
|
+
vi_ctype,
|
|
317
|
+
selector_string_ctype,
|
|
318
|
+
attribute_id_ctype,
|
|
319
|
+
attr_val_ctype,
|
|
320
|
+
array_size_ctype,
|
|
321
|
+
None if actual_array_size_ctype is None else (ctypes.pointer(actual_array_size_ctype)),
|
|
322
|
+
)
|
|
323
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
324
|
+
attr_val_array = numpy.empty(actual_array_size_ctype.value, dtype=numpy.int32)
|
|
325
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
326
|
+
value=attr_val_array, library_type=ctypes.c_int32
|
|
327
|
+
)
|
|
328
|
+
error_code = self._library.RFmxVNA_GetAttributeI32Array(
|
|
329
|
+
vi_ctype,
|
|
330
|
+
selector_string_ctype,
|
|
331
|
+
attribute_id_ctype,
|
|
332
|
+
attr_val_ctype,
|
|
333
|
+
actual_array_size_ctype,
|
|
334
|
+
None,
|
|
335
|
+
)
|
|
336
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
337
|
+
return attr_val_array, error_code
|
|
338
|
+
|
|
339
|
+
def set_attribute_i32_array(self, selector_string, attribute_id, attr_val):
|
|
340
|
+
"""set_attribute_i32_array."""
|
|
341
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
342
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
343
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
344
|
+
attr_val_array = _convert_to_array(value=attr_val, array_type="i")
|
|
345
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
346
|
+
value=attr_val_array, library_type=ctypes.c_int32
|
|
347
|
+
)
|
|
348
|
+
error_code = self._library.RFmxVNA_SetAttributeI32Array(
|
|
349
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype, len(attr_val)
|
|
350
|
+
)
|
|
351
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
352
|
+
return error_code
|
|
353
|
+
|
|
354
|
+
def get_attribute_i64(self, selector_string, attribute_id):
|
|
355
|
+
"""get_attribute_i64."""
|
|
356
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
357
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
358
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
359
|
+
attr_val_ctype = ctypes.c_int64()
|
|
360
|
+
error_code = self._library.RFmxVNA_GetAttributeI64(
|
|
361
|
+
vi_ctype,
|
|
362
|
+
selector_string_ctype,
|
|
363
|
+
attribute_id_ctype,
|
|
364
|
+
None if attr_val_ctype is None else (ctypes.pointer(attr_val_ctype)),
|
|
365
|
+
)
|
|
366
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
367
|
+
return attr_val_ctype.value, error_code
|
|
368
|
+
|
|
369
|
+
def set_attribute_i64(self, selector_string, attribute_id, attr_val):
|
|
370
|
+
"""set_attribute_i64."""
|
|
371
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
372
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
373
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
374
|
+
attr_val_ctype = ctypes.c_int64(attr_val)
|
|
375
|
+
error_code = self._library.RFmxVNA_SetAttributeI64(
|
|
376
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype
|
|
377
|
+
)
|
|
378
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
379
|
+
return error_code
|
|
380
|
+
|
|
381
|
+
def get_attribute_i64_array(self, selector_string, attribute_id):
|
|
382
|
+
"""get_attribute_i64_array."""
|
|
383
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
384
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
385
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
386
|
+
attr_val_ctype = None
|
|
387
|
+
array_size_ctype = ctypes.c_int32()
|
|
388
|
+
actual_array_size_ctype = ctypes.c_int32()
|
|
389
|
+
error_code = self._library.RFmxVNA_GetAttributeI64Array(
|
|
390
|
+
vi_ctype,
|
|
391
|
+
selector_string_ctype,
|
|
392
|
+
attribute_id_ctype,
|
|
393
|
+
attr_val_ctype,
|
|
394
|
+
array_size_ctype,
|
|
395
|
+
None if actual_array_size_ctype is None else (ctypes.pointer(actual_array_size_ctype)),
|
|
396
|
+
)
|
|
397
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
398
|
+
attr_val_array = numpy.empty(actual_array_size_ctype.value, dtype=numpy.int64)
|
|
399
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
400
|
+
value=attr_val_array, library_type=ctypes.c_int64
|
|
401
|
+
)
|
|
402
|
+
error_code = self._library.RFmxVNA_GetAttributeI64Array(
|
|
403
|
+
vi_ctype,
|
|
404
|
+
selector_string_ctype,
|
|
405
|
+
attribute_id_ctype,
|
|
406
|
+
attr_val_ctype,
|
|
407
|
+
actual_array_size_ctype,
|
|
408
|
+
None,
|
|
409
|
+
)
|
|
410
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
411
|
+
return attr_val_array, error_code
|
|
412
|
+
|
|
413
|
+
def set_attribute_i64_array(self, selector_string, attribute_id, attr_val):
|
|
414
|
+
"""set_attribute_i64_array."""
|
|
415
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
416
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
417
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
418
|
+
attr_val_array = _convert_to_array(value=attr_val, array_type="i")
|
|
419
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
420
|
+
value=attr_val_array, library_type=ctypes.c_int64
|
|
421
|
+
)
|
|
422
|
+
error_code = self._library.RFmxVNA_SetAttributeI64Array(
|
|
423
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype, len(attr_val)
|
|
424
|
+
)
|
|
425
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
426
|
+
return error_code
|
|
427
|
+
|
|
428
|
+
def get_attribute_u8(self, selector_string, attribute_id):
|
|
429
|
+
"""get_attribute_u8."""
|
|
430
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
431
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
432
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
433
|
+
attr_val_ctype = ctypes.c_uint8()
|
|
434
|
+
error_code = self._library.RFmxVNA_GetAttributeU8(
|
|
435
|
+
vi_ctype,
|
|
436
|
+
selector_string_ctype,
|
|
437
|
+
attribute_id_ctype,
|
|
438
|
+
None if attr_val_ctype is None else (ctypes.pointer(attr_val_ctype)),
|
|
439
|
+
)
|
|
440
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
441
|
+
return attr_val_ctype.value, error_code
|
|
442
|
+
|
|
443
|
+
def set_attribute_u8(self, selector_string, attribute_id, attr_val):
|
|
444
|
+
"""set_attribute_u8."""
|
|
445
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
446
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
447
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
448
|
+
attr_val_ctype = ctypes.c_uint8(attr_val)
|
|
449
|
+
error_code = self._library.RFmxVNA_SetAttributeU8(
|
|
450
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype
|
|
451
|
+
)
|
|
452
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
453
|
+
return error_code
|
|
454
|
+
|
|
455
|
+
def get_attribute_u8_array(self, selector_string, attribute_id):
|
|
456
|
+
"""get_attribute_u8_array."""
|
|
457
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
458
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
459
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
460
|
+
attr_val_ctype = None
|
|
461
|
+
array_size_ctype = ctypes.c_int32()
|
|
462
|
+
actual_array_size_ctype = ctypes.c_int32()
|
|
463
|
+
error_code = self._library.RFmxVNA_GetAttributeU8Array(
|
|
464
|
+
vi_ctype,
|
|
465
|
+
selector_string_ctype,
|
|
466
|
+
attribute_id_ctype,
|
|
467
|
+
attr_val_ctype,
|
|
468
|
+
array_size_ctype,
|
|
469
|
+
None if actual_array_size_ctype is None else (ctypes.pointer(actual_array_size_ctype)),
|
|
470
|
+
)
|
|
471
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
472
|
+
attr_val_array = numpy.empty(actual_array_size_ctype.value, dtype=numpy.uint8)
|
|
473
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
474
|
+
value=attr_val_array, library_type=ctypes.c_uint8
|
|
475
|
+
)
|
|
476
|
+
error_code = self._library.RFmxVNA_GetAttributeU8Array(
|
|
477
|
+
vi_ctype,
|
|
478
|
+
selector_string_ctype,
|
|
479
|
+
attribute_id_ctype,
|
|
480
|
+
attr_val_ctype,
|
|
481
|
+
actual_array_size_ctype,
|
|
482
|
+
None,
|
|
483
|
+
)
|
|
484
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
485
|
+
return attr_val_array, error_code
|
|
486
|
+
|
|
487
|
+
def set_attribute_u8_array(self, selector_string, attribute_id, attr_val):
|
|
488
|
+
"""set_attribute_u8_array."""
|
|
489
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
490
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
491
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
492
|
+
attr_val_array = _convert_to_array(value=attr_val, array_type="i")
|
|
493
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
494
|
+
value=attr_val_array, library_type=ctypes.c_uint8
|
|
495
|
+
)
|
|
496
|
+
error_code = self._library.RFmxVNA_SetAttributeU8Array(
|
|
497
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype, len(attr_val)
|
|
498
|
+
)
|
|
499
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
500
|
+
return error_code
|
|
501
|
+
|
|
502
|
+
def get_attribute_u16(self, selector_string, attribute_id):
|
|
503
|
+
"""get_attribute_u16."""
|
|
504
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
505
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
506
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
507
|
+
attr_val_ctype = ctypes.c_uint16()
|
|
508
|
+
error_code = self._library.RFmxVNA_GetAttributeU16(
|
|
509
|
+
vi_ctype,
|
|
510
|
+
selector_string_ctype,
|
|
511
|
+
attribute_id_ctype,
|
|
512
|
+
None if attr_val_ctype is None else (ctypes.pointer(attr_val_ctype)),
|
|
513
|
+
)
|
|
514
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
515
|
+
return attr_val_ctype.value, error_code
|
|
516
|
+
|
|
517
|
+
def set_attribute_u16(self, selector_string, attribute_id, attr_val):
|
|
518
|
+
"""set_attribute_u16."""
|
|
519
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
520
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
521
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
522
|
+
attr_val_ctype = ctypes.c_uint16(attr_val)
|
|
523
|
+
error_code = self._library.RFmxVNA_SetAttributeU16(
|
|
524
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype
|
|
525
|
+
)
|
|
526
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
527
|
+
return error_code
|
|
528
|
+
|
|
529
|
+
def get_attribute_u32(self, selector_string, attribute_id):
|
|
530
|
+
"""get_attribute_u32."""
|
|
531
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
532
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
533
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
534
|
+
attr_val_ctype = ctypes.c_uint32()
|
|
535
|
+
error_code = self._library.RFmxVNA_GetAttributeU32(
|
|
536
|
+
vi_ctype,
|
|
537
|
+
selector_string_ctype,
|
|
538
|
+
attribute_id_ctype,
|
|
539
|
+
None if attr_val_ctype is None else (ctypes.pointer(attr_val_ctype)),
|
|
540
|
+
)
|
|
541
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
542
|
+
return attr_val_ctype.value, error_code
|
|
543
|
+
|
|
544
|
+
def set_attribute_u32(self, selector_string, attribute_id, attr_val):
|
|
545
|
+
"""set_attribute_u32."""
|
|
546
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
547
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
548
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
549
|
+
attr_val_ctype = ctypes.c_uint32(attr_val)
|
|
550
|
+
error_code = self._library.RFmxVNA_SetAttributeU32(
|
|
551
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype
|
|
552
|
+
)
|
|
553
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
554
|
+
return error_code
|
|
555
|
+
|
|
556
|
+
def get_attribute_u32_array(self, selector_string, attribute_id):
|
|
557
|
+
"""get_attribute_u32_array."""
|
|
558
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
559
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
560
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
561
|
+
attr_val_ctype = None
|
|
562
|
+
array_size_ctype = ctypes.c_int32()
|
|
563
|
+
actual_array_size_ctype = ctypes.c_int32()
|
|
564
|
+
error_code = self._library.RFmxVNA_GetAttributeU32Array(
|
|
565
|
+
vi_ctype,
|
|
566
|
+
selector_string_ctype,
|
|
567
|
+
attribute_id_ctype,
|
|
568
|
+
attr_val_ctype,
|
|
569
|
+
array_size_ctype,
|
|
570
|
+
None if actual_array_size_ctype is None else (ctypes.pointer(actual_array_size_ctype)),
|
|
571
|
+
)
|
|
572
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
573
|
+
attr_val_array = numpy.empty(actual_array_size_ctype.value, dtype=numpy.uint32)
|
|
574
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
575
|
+
value=attr_val_array, library_type=ctypes.c_uint32
|
|
576
|
+
)
|
|
577
|
+
error_code = self._library.RFmxVNA_GetAttributeU32Array(
|
|
578
|
+
vi_ctype,
|
|
579
|
+
selector_string_ctype,
|
|
580
|
+
attribute_id_ctype,
|
|
581
|
+
attr_val_ctype,
|
|
582
|
+
actual_array_size_ctype,
|
|
583
|
+
None,
|
|
584
|
+
)
|
|
585
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
586
|
+
return attr_val_array, error_code
|
|
587
|
+
|
|
588
|
+
def set_attribute_u32_array(self, selector_string, attribute_id, attr_val):
|
|
589
|
+
"""set_attribute_u32_array."""
|
|
590
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
591
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
592
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
593
|
+
attr_val_array = _convert_to_array(value=attr_val, array_type="i")
|
|
594
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
595
|
+
value=attr_val_array, library_type=ctypes.c_uint32
|
|
596
|
+
)
|
|
597
|
+
error_code = self._library.RFmxVNA_SetAttributeU32Array(
|
|
598
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype, len(attr_val)
|
|
599
|
+
)
|
|
600
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
601
|
+
return error_code
|
|
602
|
+
|
|
603
|
+
def get_attribute_u64_array(self, selector_string, attribute_id):
|
|
604
|
+
"""get_attribute_u64_array."""
|
|
605
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
606
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
607
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
608
|
+
attr_val_ctype = None
|
|
609
|
+
array_size_ctype = ctypes.c_int32()
|
|
610
|
+
actual_array_size_ctype = ctypes.c_int32()
|
|
611
|
+
error_code = self._library.RFmxVNA_GetAttributeU64Array(
|
|
612
|
+
vi_ctype,
|
|
613
|
+
selector_string_ctype,
|
|
614
|
+
attribute_id_ctype,
|
|
615
|
+
attr_val_ctype,
|
|
616
|
+
array_size_ctype,
|
|
617
|
+
None if actual_array_size_ctype is None else (ctypes.pointer(actual_array_size_ctype)),
|
|
618
|
+
)
|
|
619
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
620
|
+
attr_val_array = numpy.empty(actual_array_size_ctype.value, dtype=numpy.uint64)
|
|
621
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
622
|
+
value=attr_val_array, library_type=ctypes.c_uint64
|
|
623
|
+
)
|
|
624
|
+
error_code = self._library.RFmxVNA_GetAttributeU64Array(
|
|
625
|
+
vi_ctype,
|
|
626
|
+
selector_string_ctype,
|
|
627
|
+
attribute_id_ctype,
|
|
628
|
+
attr_val_ctype,
|
|
629
|
+
actual_array_size_ctype,
|
|
630
|
+
None,
|
|
631
|
+
)
|
|
632
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
633
|
+
return attr_val_array, error_code
|
|
634
|
+
|
|
635
|
+
def set_attribute_u64_array(self, selector_string, attribute_id, attr_val):
|
|
636
|
+
"""set_attribute_u64_array."""
|
|
637
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
638
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
639
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
640
|
+
attr_val_array = _convert_to_array(value=attr_val, array_type="i")
|
|
641
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
642
|
+
value=attr_val_array, library_type=ctypes.c_uint64
|
|
643
|
+
)
|
|
644
|
+
error_code = self._library.RFmxVNA_SetAttributeU64Array(
|
|
645
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype, len(attr_val)
|
|
646
|
+
)
|
|
647
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
648
|
+
return error_code
|
|
649
|
+
|
|
650
|
+
def get_attribute_f32(self, selector_string, attribute_id):
|
|
651
|
+
"""get_attribute_f32."""
|
|
652
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
653
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
654
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
655
|
+
attr_val_ctype = ctypes.c_float()
|
|
656
|
+
error_code = self._library.RFmxVNA_GetAttributeF32(
|
|
657
|
+
vi_ctype,
|
|
658
|
+
selector_string_ctype,
|
|
659
|
+
attribute_id_ctype,
|
|
660
|
+
None if attr_val_ctype is None else (ctypes.pointer(attr_val_ctype)),
|
|
661
|
+
)
|
|
662
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
663
|
+
return attr_val_ctype.value, error_code
|
|
664
|
+
|
|
665
|
+
def set_attribute_f32(self, selector_string, attribute_id, attr_val):
|
|
666
|
+
"""set_attribute_f32."""
|
|
667
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
668
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
669
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
670
|
+
attr_val_ctype = ctypes.c_float(attr_val)
|
|
671
|
+
error_code = self._library.RFmxVNA_SetAttributeF32(
|
|
672
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype
|
|
673
|
+
)
|
|
674
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
675
|
+
return error_code
|
|
676
|
+
|
|
677
|
+
def get_attribute_f32_array(self, selector_string, attribute_id):
|
|
678
|
+
"""get_attribute_f32_array."""
|
|
679
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
680
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
681
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
682
|
+
attr_val_ctype = None
|
|
683
|
+
array_size_ctype = ctypes.c_int32()
|
|
684
|
+
actual_array_size_ctype = ctypes.c_int32()
|
|
685
|
+
error_code = self._library.RFmxVNA_GetAttributeF32Array(
|
|
686
|
+
vi_ctype,
|
|
687
|
+
selector_string_ctype,
|
|
688
|
+
attribute_id_ctype,
|
|
689
|
+
attr_val_ctype,
|
|
690
|
+
array_size_ctype,
|
|
691
|
+
None if actual_array_size_ctype is None else (ctypes.pointer(actual_array_size_ctype)),
|
|
692
|
+
)
|
|
693
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
694
|
+
attr_val_array = numpy.empty(actual_array_size_ctype.value, dtype=numpy.float32)
|
|
695
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
696
|
+
value=attr_val_array, library_type=ctypes.c_float
|
|
697
|
+
)
|
|
698
|
+
error_code = self._library.RFmxVNA_GetAttributeF32Array(
|
|
699
|
+
vi_ctype,
|
|
700
|
+
selector_string_ctype,
|
|
701
|
+
attribute_id_ctype,
|
|
702
|
+
attr_val_ctype,
|
|
703
|
+
actual_array_size_ctype,
|
|
704
|
+
None,
|
|
705
|
+
)
|
|
706
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
707
|
+
return attr_val_array, error_code
|
|
708
|
+
|
|
709
|
+
def set_attribute_f32_array(self, selector_string, attribute_id, attr_val):
|
|
710
|
+
"""set_attribute_f32_array."""
|
|
711
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
712
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
713
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
714
|
+
attr_val_array = _convert_to_array(value=attr_val, array_type="f")
|
|
715
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
716
|
+
value=attr_val_array, library_type=ctypes.c_float
|
|
717
|
+
)
|
|
718
|
+
error_code = self._library.RFmxVNA_SetAttributeF32Array(
|
|
719
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype, len(attr_val)
|
|
720
|
+
)
|
|
721
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
722
|
+
return error_code
|
|
723
|
+
|
|
724
|
+
def get_attribute_f64(self, selector_string, attribute_id):
|
|
725
|
+
"""get_attribute_f64."""
|
|
726
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
727
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
728
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
729
|
+
attr_val_ctype = ctypes.c_double()
|
|
730
|
+
error_code = self._library.RFmxVNA_GetAttributeF64(
|
|
731
|
+
vi_ctype,
|
|
732
|
+
selector_string_ctype,
|
|
733
|
+
attribute_id_ctype,
|
|
734
|
+
None if attr_val_ctype is None else (ctypes.pointer(attr_val_ctype)),
|
|
735
|
+
)
|
|
736
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
737
|
+
return attr_val_ctype.value, error_code
|
|
738
|
+
|
|
739
|
+
def set_attribute_f64(self, selector_string, attribute_id, attr_val):
|
|
740
|
+
"""set_attribute_f64."""
|
|
741
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
742
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
743
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
744
|
+
attr_val_ctype = ctypes.c_double(attr_val)
|
|
745
|
+
error_code = self._library.RFmxVNA_SetAttributeF64(
|
|
746
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype
|
|
747
|
+
)
|
|
748
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
749
|
+
return error_code
|
|
750
|
+
|
|
751
|
+
def get_attribute_f64_array(self, selector_string, attribute_id):
|
|
752
|
+
"""get_attribute_f64_array."""
|
|
753
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
754
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
755
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
756
|
+
attr_val_ctype = None
|
|
757
|
+
array_size_ctype = ctypes.c_int32()
|
|
758
|
+
actual_array_size_ctype = ctypes.c_int32()
|
|
759
|
+
error_code = self._library.RFmxVNA_GetAttributeF64Array(
|
|
760
|
+
vi_ctype,
|
|
761
|
+
selector_string_ctype,
|
|
762
|
+
attribute_id_ctype,
|
|
763
|
+
attr_val_ctype,
|
|
764
|
+
array_size_ctype,
|
|
765
|
+
None if actual_array_size_ctype is None else (ctypes.pointer(actual_array_size_ctype)),
|
|
766
|
+
)
|
|
767
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
768
|
+
attr_val_array = numpy.empty(actual_array_size_ctype.value, dtype=numpy.float64)
|
|
769
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
770
|
+
value=attr_val_array, library_type=ctypes.c_double
|
|
771
|
+
)
|
|
772
|
+
error_code = self._library.RFmxVNA_GetAttributeF64Array(
|
|
773
|
+
vi_ctype,
|
|
774
|
+
selector_string_ctype,
|
|
775
|
+
attribute_id_ctype,
|
|
776
|
+
attr_val_ctype,
|
|
777
|
+
actual_array_size_ctype,
|
|
778
|
+
None,
|
|
779
|
+
)
|
|
780
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
781
|
+
return attr_val_array, error_code
|
|
782
|
+
|
|
783
|
+
def set_attribute_f64_array(self, selector_string, attribute_id, attr_val):
|
|
784
|
+
"""set_attribute_f64_array."""
|
|
785
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
786
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
787
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
788
|
+
attr_val_array = _convert_to_array(value=attr_val, array_type="d")
|
|
789
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
790
|
+
value=attr_val_array, library_type=ctypes.c_double
|
|
791
|
+
)
|
|
792
|
+
error_code = self._library.RFmxVNA_SetAttributeF64Array(
|
|
793
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype, len(attr_val)
|
|
794
|
+
)
|
|
795
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
796
|
+
return error_code
|
|
797
|
+
|
|
798
|
+
def get_attribute_nicomplexsingle_array(self, selector_string, attribute_id):
|
|
799
|
+
"""get_attribute_nicomplexsingle_array."""
|
|
800
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
801
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
802
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
803
|
+
attr_val_ctype = None
|
|
804
|
+
array_size_ctype = ctypes.c_int32()
|
|
805
|
+
actual_array_size_ctype = ctypes.c_int32()
|
|
806
|
+
error_code = self._library.RFmxVNA_GetAttributeNIComplexSingleArray(
|
|
807
|
+
vi_ctype,
|
|
808
|
+
selector_string_ctype,
|
|
809
|
+
attribute_id_ctype,
|
|
810
|
+
attr_val_ctype,
|
|
811
|
+
array_size_ctype,
|
|
812
|
+
None if actual_array_size_ctype is None else (ctypes.pointer(actual_array_size_ctype)),
|
|
813
|
+
)
|
|
814
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
815
|
+
attr_val_array = numpy.empty(actual_array_size_ctype.value, dtype=numpy.complex64)
|
|
816
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
817
|
+
value=attr_val_array, library_type=ctypes.c_float
|
|
818
|
+
)
|
|
819
|
+
error_code = self._library.RFmxVNA_GetAttributeNIComplexSingleArray(
|
|
820
|
+
vi_ctype,
|
|
821
|
+
selector_string_ctype,
|
|
822
|
+
attribute_id_ctype,
|
|
823
|
+
attr_val_ctype,
|
|
824
|
+
actual_array_size_ctype,
|
|
825
|
+
None,
|
|
826
|
+
)
|
|
827
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
828
|
+
return attr_val_array, error_code
|
|
829
|
+
|
|
830
|
+
def set_attribute_nicomplexsingle_array(self, selector_string, attribute_id, attr_val):
|
|
831
|
+
"""set_attribute_nicomplexsingle_array."""
|
|
832
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
833
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
834
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
835
|
+
attr_val_array = _convert_to_array(value=attr_val, array_type="")
|
|
836
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
837
|
+
value=attr_val_array, library_type=ctypes.c_float
|
|
838
|
+
)
|
|
839
|
+
error_code = self._library.RFmxVNA_SetAttributeNIComplexSingleArray(
|
|
840
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype, len(attr_val)
|
|
841
|
+
)
|
|
842
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
843
|
+
return error_code
|
|
844
|
+
|
|
845
|
+
def get_attribute_nicomplexdouble_array(self, selector_string, attribute_id):
|
|
846
|
+
"""get_attribute_nicomplexdouble_array."""
|
|
847
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
848
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
849
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
850
|
+
attr_val_ctype = None
|
|
851
|
+
array_size_ctype = ctypes.c_int32()
|
|
852
|
+
actual_array_size_ctype = ctypes.c_int32()
|
|
853
|
+
error_code = self._library.RFmxVNA_GetAttributeNIComplexDoubleArray(
|
|
854
|
+
vi_ctype,
|
|
855
|
+
selector_string_ctype,
|
|
856
|
+
attribute_id_ctype,
|
|
857
|
+
attr_val_ctype,
|
|
858
|
+
array_size_ctype,
|
|
859
|
+
None if actual_array_size_ctype is None else (ctypes.pointer(actual_array_size_ctype)),
|
|
860
|
+
)
|
|
861
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
862
|
+
attr_val_array = numpy.empty(actual_array_size_ctype.value, dtype=numpy.complex128)
|
|
863
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
864
|
+
value=attr_val_array, library_type=ctypes.c_double
|
|
865
|
+
)
|
|
866
|
+
error_code = self._library.RFmxVNA_GetAttributeNIComplexDoubleArray(
|
|
867
|
+
vi_ctype,
|
|
868
|
+
selector_string_ctype,
|
|
869
|
+
attribute_id_ctype,
|
|
870
|
+
attr_val_ctype,
|
|
871
|
+
actual_array_size_ctype,
|
|
872
|
+
None,
|
|
873
|
+
)
|
|
874
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
875
|
+
return attr_val_array, error_code
|
|
876
|
+
|
|
877
|
+
def set_attribute_nicomplexdouble_array(self, selector_string, attribute_id, attr_val):
|
|
878
|
+
"""set_attribute_nicomplexdouble_array."""
|
|
879
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
880
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
881
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
882
|
+
attr_val_array = _convert_to_array(value=attr_val, array_type="")
|
|
883
|
+
attr_val_ctype = _get_ctypes_pointer_for_buffer(
|
|
884
|
+
value=attr_val_array, library_type=ctypes.c_double
|
|
885
|
+
)
|
|
886
|
+
error_code = self._library.RFmxVNA_SetAttributeNIComplexDoubleArray(
|
|
887
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype, len(attr_val)
|
|
888
|
+
)
|
|
889
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
890
|
+
return error_code
|
|
891
|
+
|
|
892
|
+
def get_attribute_string(self, selector_string, attribute_id):
|
|
893
|
+
"""get_attribute_string."""
|
|
894
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
895
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
896
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
897
|
+
array_size_ctype = ctypes.c_int32(0)
|
|
898
|
+
attr_val_ctype = None
|
|
899
|
+
size_or_error_code = self._library.RFmxVNA_GetAttributeString(
|
|
900
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, array_size_ctype, attr_val_ctype
|
|
901
|
+
)
|
|
902
|
+
if size_or_error_code < 0:
|
|
903
|
+
errors.handle_error(
|
|
904
|
+
self, size_or_error_code, ignore_warnings=True, is_error_handling=False
|
|
905
|
+
)
|
|
906
|
+
return None, size_or_error_code
|
|
907
|
+
array_size_ctype = ctypes.c_int32(size_or_error_code)
|
|
908
|
+
attr_val_ctype = (ctypes.c_char * array_size_ctype.value)()
|
|
909
|
+
error_code = self._library.RFmxVNA_GetAttributeString(
|
|
910
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, array_size_ctype, attr_val_ctype
|
|
911
|
+
)
|
|
912
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
913
|
+
return attr_val_ctype.value.decode(self._encoding), error_code
|
|
914
|
+
|
|
915
|
+
def set_attribute_string(self, selector_string, attribute_id, attr_val):
|
|
916
|
+
"""set_attribute_string."""
|
|
917
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
918
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
919
|
+
attribute_id_ctype = ctypes.c_uint32(attribute_id)
|
|
920
|
+
attr_val_ctype = ctypes.create_string_buffer(attr_val.encode(self._encoding))
|
|
921
|
+
error_code = self._library.RFmxVNA_SetAttributeString(
|
|
922
|
+
vi_ctype, selector_string_ctype, attribute_id_ctype, attr_val_ctype
|
|
923
|
+
)
|
|
924
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
925
|
+
return error_code
|
|
926
|
+
|
|
927
|
+
def s_params_configure_s_parameter(self, selector_string, s_parameter):
|
|
928
|
+
"""s_params_configure_s_parameter."""
|
|
929
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
930
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
931
|
+
s_parameter_ctype = ctypes.create_string_buffer(s_parameter.encode(self._encoding))
|
|
932
|
+
error_code = self._library.RFmxVNA_SParamsCfgSParameter(
|
|
933
|
+
vi_ctype, selector_string_ctype, s_parameter_ctype
|
|
934
|
+
)
|
|
935
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
936
|
+
return error_code
|
|
937
|
+
|
|
938
|
+
def s_params_export_to_snp_file(self, selector_string, snp_file_path):
|
|
939
|
+
"""s_params_export_to_snp_file."""
|
|
940
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
941
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
942
|
+
snp_file_path_ctype = ctypes.create_string_buffer(snp_file_path.encode(self._encoding))
|
|
943
|
+
error_code = self._library.RFmxVNA_SParamsExportToSnPFile(
|
|
944
|
+
vi_ctype, selector_string_ctype, snp_file_path_ctype
|
|
945
|
+
)
|
|
946
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
947
|
+
return error_code
|
|
948
|
+
|
|
949
|
+
def waves_configure_wave(self, selector_string, wave):
|
|
950
|
+
"""waves_configure_wave."""
|
|
951
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
952
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
953
|
+
wave_ctype = ctypes.create_string_buffer(wave.encode(self._encoding))
|
|
954
|
+
error_code = self._library.RFmxVNA_WavesCfgWave(vi_ctype, selector_string_ctype, wave_ctype)
|
|
955
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
956
|
+
return error_code
|
|
957
|
+
|
|
958
|
+
def abort_measurements(self, selector_string):
|
|
959
|
+
"""abort_measurements."""
|
|
960
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
961
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
962
|
+
error_code = self._library.RFmxVNA_AbortMeasurements(vi_ctype, selector_string_ctype)
|
|
963
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
964
|
+
return error_code
|
|
965
|
+
|
|
966
|
+
def calibration_initiate(self, selector_string):
|
|
967
|
+
"""calibration_initiate."""
|
|
968
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
969
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
970
|
+
error_code = self._library.RFmxVNA_CalibrationInitiate(vi_ctype, selector_string_ctype)
|
|
971
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
972
|
+
return error_code
|
|
973
|
+
|
|
974
|
+
def calibration_acquire(self, selector_string, timeout):
|
|
975
|
+
"""calibration_acquire."""
|
|
976
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
977
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
978
|
+
timeout_ctype = ctypes.c_double(timeout)
|
|
979
|
+
error_code = self._library.RFmxVNA_CalibrationAcquire(
|
|
980
|
+
vi_ctype, selector_string_ctype, timeout_ctype
|
|
981
|
+
)
|
|
982
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
983
|
+
return error_code
|
|
984
|
+
|
|
985
|
+
def calibration_abort(self, selector_string):
|
|
986
|
+
"""calibration_abort."""
|
|
987
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
988
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
989
|
+
error_code = self._library.RFmxVNA_CalibrationAbort(vi_ctype, selector_string_ctype)
|
|
990
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
991
|
+
return error_code
|
|
992
|
+
|
|
993
|
+
def calibration_save(self, selector_string, calset_name):
|
|
994
|
+
"""calibration_save."""
|
|
995
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
996
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
997
|
+
calset_name_ctype = ctypes.create_string_buffer(calset_name.encode(self._encoding))
|
|
998
|
+
error_code = self._library.RFmxVNA_CalibrationSave(
|
|
999
|
+
vi_ctype, selector_string_ctype, calset_name_ctype
|
|
1000
|
+
)
|
|
1001
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1002
|
+
return error_code
|
|
1003
|
+
|
|
1004
|
+
def clear_calset(self, selector_string, calset_name):
|
|
1005
|
+
"""clear_calset."""
|
|
1006
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1007
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1008
|
+
calset_name_ctype = ctypes.create_string_buffer(calset_name.encode(self._encoding))
|
|
1009
|
+
error_code = self._library.RFmxVNA_ClearCalset(
|
|
1010
|
+
vi_ctype, selector_string_ctype, calset_name_ctype
|
|
1011
|
+
)
|
|
1012
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1013
|
+
return error_code
|
|
1014
|
+
|
|
1015
|
+
def calset_load_from_file(self, selector_string, calset_name, calset_file_path):
|
|
1016
|
+
"""calset_load_from_file."""
|
|
1017
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1018
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1019
|
+
calset_name_ctype = ctypes.create_string_buffer(calset_name.encode(self._encoding))
|
|
1020
|
+
calset_file_path_ctype = ctypes.create_string_buffer(
|
|
1021
|
+
calset_file_path.encode(self._encoding)
|
|
1022
|
+
)
|
|
1023
|
+
error_code = self._library.RFmxVNA_CalsetLoadFromFile(
|
|
1024
|
+
vi_ctype, selector_string_ctype, calset_name_ctype, calset_file_path_ctype
|
|
1025
|
+
)
|
|
1026
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1027
|
+
return error_code
|
|
1028
|
+
|
|
1029
|
+
def calset_save_to_file(self, selector_string, calset_name, calset_file_path):
|
|
1030
|
+
"""calset_save_to_file."""
|
|
1031
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1032
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1033
|
+
calset_name_ctype = ctypes.create_string_buffer(calset_name.encode(self._encoding))
|
|
1034
|
+
calset_file_path_ctype = ctypes.create_string_buffer(
|
|
1035
|
+
calset_file_path.encode(self._encoding)
|
|
1036
|
+
)
|
|
1037
|
+
error_code = self._library.RFmxVNA_CalsetSaveToFile(
|
|
1038
|
+
vi_ctype, selector_string_ctype, calset_name_ctype, calset_file_path_ctype
|
|
1039
|
+
)
|
|
1040
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1041
|
+
return error_code
|
|
1042
|
+
|
|
1043
|
+
def auto_detect_vcal_orientation(self, selector_string):
|
|
1044
|
+
"""auto_detect_vcal_orientation."""
|
|
1045
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1046
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1047
|
+
error_code = self._library.RFmxVNA_AutoDetectvCalOrientation(
|
|
1048
|
+
vi_ctype, selector_string_ctype
|
|
1049
|
+
)
|
|
1050
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1051
|
+
return error_code
|
|
1052
|
+
|
|
1053
|
+
def check_measurement_status(self, selector_string):
|
|
1054
|
+
"""check_measurement_status."""
|
|
1055
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1056
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1057
|
+
is_done_ctype = ctypes.c_int32()
|
|
1058
|
+
error_code = self._library.RFmxVNA_CheckMeasurementStatus(
|
|
1059
|
+
vi_ctype, selector_string_ctype, is_done_ctype
|
|
1060
|
+
)
|
|
1061
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1062
|
+
return bool(is_done_ctype.value), error_code
|
|
1063
|
+
|
|
1064
|
+
def clear_all_named_results(self, selector_string):
|
|
1065
|
+
"""clear_all_named_results."""
|
|
1066
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1067
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1068
|
+
error_code = self._library.RFmxVNA_ClearAllNamedResults(vi_ctype, selector_string_ctype)
|
|
1069
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1070
|
+
return error_code
|
|
1071
|
+
|
|
1072
|
+
def clear_named_result(self, selector_string):
|
|
1073
|
+
"""clear_named_result."""
|
|
1074
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1075
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1076
|
+
error_code = self._library.RFmxVNA_ClearNamedResult(vi_ctype, selector_string_ctype)
|
|
1077
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1078
|
+
return error_code
|
|
1079
|
+
|
|
1080
|
+
def copy_calset(self, selector_string, source_calset_name, new_calset_name):
|
|
1081
|
+
"""copy_calset."""
|
|
1082
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1083
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1084
|
+
source_calset_name_ctype = ctypes.create_string_buffer(
|
|
1085
|
+
source_calset_name.encode(self._encoding)
|
|
1086
|
+
)
|
|
1087
|
+
new_calset_name_ctype = ctypes.create_string_buffer(new_calset_name.encode(self._encoding))
|
|
1088
|
+
error_code = self._library.RFmxVNA_CopyCalset(
|
|
1089
|
+
vi_ctype, selector_string_ctype, source_calset_name_ctype, new_calset_name_ctype
|
|
1090
|
+
)
|
|
1091
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1092
|
+
return error_code
|
|
1093
|
+
|
|
1094
|
+
def select_active_calset(self, selector_string, calset_name, restore_configuration):
|
|
1095
|
+
"""select_active_calset."""
|
|
1096
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1097
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1098
|
+
calset_name_ctype = ctypes.create_string_buffer(calset_name.encode(self._encoding))
|
|
1099
|
+
restore_configuration_ctype = ctypes.c_int32(restore_configuration)
|
|
1100
|
+
error_code = self._library.RFmxVNA_SelectActiveCalset(
|
|
1101
|
+
vi_ctype, selector_string_ctype, calset_name_ctype, restore_configuration_ctype
|
|
1102
|
+
)
|
|
1103
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1104
|
+
return error_code
|
|
1105
|
+
|
|
1106
|
+
def get_all_calset_names(self, selector_string):
|
|
1107
|
+
"""get_all_calset_names."""
|
|
1108
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1109
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1110
|
+
array_size_ctype = ctypes.c_int32(0)
|
|
1111
|
+
error_code = self._library.RFmxVNA_GetAllCalsetNames(
|
|
1112
|
+
vi_ctype, selector_string_ctype, array_size_ctype, None
|
|
1113
|
+
)
|
|
1114
|
+
if error_code < 0:
|
|
1115
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1116
|
+
return "", error_code
|
|
1117
|
+
calset_names_ctype = ctypes.create_string_buffer(error_code)
|
|
1118
|
+
|
|
1119
|
+
error_code = self._library.RFmxVNA_GetAllCalsetNames(
|
|
1120
|
+
vi_ctype, selector_string_ctype, error_code, calset_names_ctype
|
|
1121
|
+
)
|
|
1122
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1123
|
+
return calset_names_ctype.value.decode(self._encoding), error_code
|
|
1124
|
+
|
|
1125
|
+
def commit(self, selector_string):
|
|
1126
|
+
"""commit."""
|
|
1127
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1128
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1129
|
+
error_code = self._library.RFmxVNA_Commit(vi_ctype, selector_string_ctype)
|
|
1130
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1131
|
+
return error_code
|
|
1132
|
+
|
|
1133
|
+
def create_signal_configuration(self, signal_name):
|
|
1134
|
+
"""create_signal_configuration."""
|
|
1135
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1136
|
+
signal_name_ctype = ctypes.create_string_buffer(signal_name.encode(self._encoding))
|
|
1137
|
+
error_code = self._library.RFmxVNA_CreateSignalConfiguration(vi_ctype, signal_name_ctype)
|
|
1138
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1139
|
+
return error_code
|
|
1140
|
+
|
|
1141
|
+
def initiate(self, selector_string, result_name):
|
|
1142
|
+
"""initiate."""
|
|
1143
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1144
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1145
|
+
result_name_ctype = ctypes.create_string_buffer(result_name.encode(self._encoding))
|
|
1146
|
+
error_code = self._library.RFmxVNA_Initiate(
|
|
1147
|
+
vi_ctype, selector_string_ctype, result_name_ctype
|
|
1148
|
+
)
|
|
1149
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1150
|
+
return error_code
|
|
1151
|
+
|
|
1152
|
+
def reset_to_default(self, selector_string):
|
|
1153
|
+
"""reset_to_default."""
|
|
1154
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1155
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1156
|
+
error_code = self._library.RFmxVNA_ResetToDefault(vi_ctype, selector_string_ctype)
|
|
1157
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1158
|
+
return error_code
|
|
1159
|
+
|
|
1160
|
+
def select_measurements(self, selector_string, measurements, enable_all_traces):
|
|
1161
|
+
"""select_measurements."""
|
|
1162
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1163
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1164
|
+
measurements_ctype = ctypes.c_uint32(measurements)
|
|
1165
|
+
enable_all_traces_ctype = ctypes.c_int32(enable_all_traces)
|
|
1166
|
+
error_code = self._library.RFmxVNA_SelectMeasurements(
|
|
1167
|
+
vi_ctype, selector_string_ctype, measurements_ctype, enable_all_traces_ctype
|
|
1168
|
+
)
|
|
1169
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1170
|
+
return error_code
|
|
1171
|
+
|
|
1172
|
+
def wait_for_measurement_complete(self, selector_string, timeout):
|
|
1173
|
+
"""wait_for_measurement_complete."""
|
|
1174
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1175
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1176
|
+
timeout_ctype = ctypes.c_double(timeout)
|
|
1177
|
+
error_code = self._library.RFmxVNA_WaitForMeasurementComplete(
|
|
1178
|
+
vi_ctype, selector_string_ctype, timeout_ctype
|
|
1179
|
+
)
|
|
1180
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1181
|
+
return error_code
|
|
1182
|
+
|
|
1183
|
+
def calset_embed_fixture_s2p(
|
|
1184
|
+
self,
|
|
1185
|
+
selector_string,
|
|
1186
|
+
calset_name,
|
|
1187
|
+
fixture_s2p_file_path,
|
|
1188
|
+
vna_port,
|
|
1189
|
+
s_parameter_orientation,
|
|
1190
|
+
new_calset_name,
|
|
1191
|
+
):
|
|
1192
|
+
"""calset_embed_fixture_s2p."""
|
|
1193
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1194
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1195
|
+
calset_name_ctype = ctypes.create_string_buffer(calset_name.encode(self._encoding))
|
|
1196
|
+
fixture_s2p_file_path_ctype = ctypes.create_string_buffer(
|
|
1197
|
+
fixture_s2p_file_path.encode(self._encoding)
|
|
1198
|
+
)
|
|
1199
|
+
vna_port_ctype = ctypes.create_string_buffer(vna_port.encode(self._encoding))
|
|
1200
|
+
s_parameter_orientation_ctype = ctypes.c_int32(s_parameter_orientation)
|
|
1201
|
+
new_calset_name_ctype = ctypes.create_string_buffer(new_calset_name.encode(self._encoding))
|
|
1202
|
+
error_code = self._library.RFmxVNA_CalsetEmbedFixtureS2p(
|
|
1203
|
+
vi_ctype,
|
|
1204
|
+
selector_string_ctype,
|
|
1205
|
+
calset_name_ctype,
|
|
1206
|
+
fixture_s2p_file_path_ctype,
|
|
1207
|
+
vna_port_ctype,
|
|
1208
|
+
s_parameter_orientation_ctype,
|
|
1209
|
+
new_calset_name_ctype,
|
|
1210
|
+
)
|
|
1211
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1212
|
+
return error_code
|
|
1213
|
+
|
|
1214
|
+
def deselect_active_calset(self, selector_string):
|
|
1215
|
+
"""deselect_active_calset."""
|
|
1216
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1217
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1218
|
+
error_code = self._library.RFmxVNA_DeselectActiveCalset(vi_ctype, selector_string_ctype)
|
|
1219
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1220
|
+
return error_code
|
|
1221
|
+
|
|
1222
|
+
def load_data_to_measurement_memory_from_file(
|
|
1223
|
+
self, selector_string, file_path, parameter, measurement_memory_name
|
|
1224
|
+
):
|
|
1225
|
+
"""load_data_to_measurement_memory_from_file."""
|
|
1226
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1227
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1228
|
+
file_path_ctype = ctypes.create_string_buffer(file_path.encode(self._encoding))
|
|
1229
|
+
parameter_ctype = ctypes.create_string_buffer(parameter.encode(self._encoding))
|
|
1230
|
+
measurement_memory_name_ctype = ctypes.create_string_buffer(
|
|
1231
|
+
measurement_memory_name.encode(self._encoding)
|
|
1232
|
+
)
|
|
1233
|
+
error_code = self._library.RFmxVNA_LoadDataToMeasurementMemoryFromFile(
|
|
1234
|
+
vi_ctype,
|
|
1235
|
+
selector_string_ctype,
|
|
1236
|
+
file_path_ctype,
|
|
1237
|
+
parameter_ctype,
|
|
1238
|
+
measurement_memory_name_ctype,
|
|
1239
|
+
)
|
|
1240
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1241
|
+
return error_code
|
|
1242
|
+
|
|
1243
|
+
def copy_data_to_measurement_memory(self, selector_string, measurement_memory_name):
|
|
1244
|
+
"""copy_data_to_measurement_memory."""
|
|
1245
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1246
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1247
|
+
measurement_memory_name_ctype = ctypes.create_string_buffer(
|
|
1248
|
+
measurement_memory_name.encode(self._encoding)
|
|
1249
|
+
)
|
|
1250
|
+
error_code = self._library.RFmxVNA_CopyDataToMeasurementMemory(
|
|
1251
|
+
vi_ctype, selector_string_ctype, measurement_memory_name_ctype
|
|
1252
|
+
)
|
|
1253
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1254
|
+
return error_code
|
|
1255
|
+
|
|
1256
|
+
def get_measurement_memory_names(self, selector_string):
|
|
1257
|
+
"""get_measurement_memory_names."""
|
|
1258
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1259
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1260
|
+
array_size_ctype = ctypes.c_int32(0)
|
|
1261
|
+
error_code = self._library.RFmxVNA_GetMeasurementMemoryNames(
|
|
1262
|
+
vi_ctype, selector_string_ctype, array_size_ctype, None
|
|
1263
|
+
)
|
|
1264
|
+
if error_code < 0:
|
|
1265
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1266
|
+
return "", error_code
|
|
1267
|
+
measurement_memory_names_ctype = ctypes.create_string_buffer(error_code)
|
|
1268
|
+
|
|
1269
|
+
error_code = self._library.RFmxVNA_GetMeasurementMemoryNames(
|
|
1270
|
+
vi_ctype, selector_string_ctype, error_code, measurement_memory_names_ctype
|
|
1271
|
+
)
|
|
1272
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1273
|
+
return measurement_memory_names_ctype.value.decode(self._encoding), error_code
|
|
1274
|
+
|
|
1275
|
+
def clear_measurement_memory_names(self, selector_string):
|
|
1276
|
+
"""clear_measurement_memory_names."""
|
|
1277
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1278
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1279
|
+
error_code = self._library.RFmxVNA_ClearMeasurementMemoryNames(
|
|
1280
|
+
vi_ctype, selector_string_ctype
|
|
1281
|
+
)
|
|
1282
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1283
|
+
return error_code
|
|
1284
|
+
|
|
1285
|
+
def auto_port_extension_measure(self, selector_string, standard, port):
|
|
1286
|
+
"""auto_port_extension_measure."""
|
|
1287
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1288
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1289
|
+
standard_ctype = ctypes.c_int32(standard)
|
|
1290
|
+
port_ctype = ctypes.create_string_buffer(port.encode(self._encoding))
|
|
1291
|
+
error_code = self._library.RFmxVNA_AutoPortExtensionMeasure(
|
|
1292
|
+
vi_ctype, selector_string_ctype, standard_ctype, port_ctype
|
|
1293
|
+
)
|
|
1294
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1295
|
+
return error_code
|
|
1296
|
+
|
|
1297
|
+
def calkit_manager_import_calkit(self, selector_string, calkit_file_path):
|
|
1298
|
+
"""calkit_manager_import_calkit."""
|
|
1299
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1300
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1301
|
+
calkit_file_path_ctype = ctypes.create_string_buffer(
|
|
1302
|
+
calkit_file_path.encode(self._encoding)
|
|
1303
|
+
)
|
|
1304
|
+
error_code = self._library.RFmxVNA_CalkitManagerImportCalkit(
|
|
1305
|
+
vi_ctype, selector_string_ctype, calkit_file_path_ctype
|
|
1306
|
+
)
|
|
1307
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1308
|
+
return error_code
|
|
1309
|
+
|
|
1310
|
+
def calkit_manager_export_calkit(self, selector_string, calkit_id, calkit_file_path):
|
|
1311
|
+
"""calkit_manager_export_calkit."""
|
|
1312
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1313
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1314
|
+
calkit_id_ctype = ctypes.create_string_buffer(calkit_id.encode(self._encoding))
|
|
1315
|
+
calkit_file_path_ctype = ctypes.create_string_buffer(
|
|
1316
|
+
calkit_file_path.encode(self._encoding)
|
|
1317
|
+
)
|
|
1318
|
+
error_code = self._library.RFmxVNA_CalkitManagerExportCalkit(
|
|
1319
|
+
vi_ctype, selector_string_ctype, calkit_id_ctype, calkit_file_path_ctype
|
|
1320
|
+
)
|
|
1321
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1322
|
+
return error_code
|
|
1323
|
+
|
|
1324
|
+
def calkit_manager_create_calkit(self, selector_string, calkit_id):
|
|
1325
|
+
"""calkit_manager_create_calkit."""
|
|
1326
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1327
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1328
|
+
calkit_id_ctype = ctypes.create_string_buffer(calkit_id.encode(self._encoding))
|
|
1329
|
+
error_code = self._library.RFmxVNA_CalkitManagerCreateCalkit(
|
|
1330
|
+
vi_ctype, selector_string_ctype, calkit_id_ctype
|
|
1331
|
+
)
|
|
1332
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1333
|
+
return error_code
|
|
1334
|
+
|
|
1335
|
+
def calkit_manager_remove_calkit(self, selector_string, calkit_id):
|
|
1336
|
+
"""calkit_manager_remove_calkit."""
|
|
1337
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1338
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1339
|
+
calkit_id_ctype = ctypes.create_string_buffer(calkit_id.encode(self._encoding))
|
|
1340
|
+
error_code = self._library.RFmxVNA_CalkitManagerRemoveCalkit(
|
|
1341
|
+
vi_ctype, selector_string_ctype, calkit_id_ctype
|
|
1342
|
+
)
|
|
1343
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1344
|
+
return error_code
|
|
1345
|
+
|
|
1346
|
+
def calkit_manager_validate_calkit(self, selector_string, calkit_id):
|
|
1347
|
+
"""calkit_manager_validate_calkit."""
|
|
1348
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1349
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1350
|
+
calkit_id_ctype = ctypes.create_string_buffer(calkit_id.encode(self._encoding))
|
|
1351
|
+
error_code = self._library.RFmxVNA_CalkitManagerValidateCalkit(
|
|
1352
|
+
vi_ctype, selector_string_ctype, calkit_id_ctype
|
|
1353
|
+
)
|
|
1354
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1355
|
+
return error_code
|
|
1356
|
+
|
|
1357
|
+
def calkit_manager_get_calkit_ids(self, selector_string):
|
|
1358
|
+
"""calkit_manager_get_calkit_ids."""
|
|
1359
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1360
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1361
|
+
array_size_ctype = ctypes.c_int32(0)
|
|
1362
|
+
error_code = self._library.RFmxVNA_CalkitManagerGetCalkitIDs(
|
|
1363
|
+
vi_ctype, selector_string_ctype, array_size_ctype, None
|
|
1364
|
+
)
|
|
1365
|
+
if error_code < 0:
|
|
1366
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1367
|
+
return "", error_code
|
|
1368
|
+
calkit_ids_ctype = ctypes.create_string_buffer(error_code)
|
|
1369
|
+
|
|
1370
|
+
error_code = self._library.RFmxVNA_CalkitManagerGetCalkitIDs(
|
|
1371
|
+
vi_ctype, selector_string_ctype, error_code, calkit_ids_ctype
|
|
1372
|
+
)
|
|
1373
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1374
|
+
return calkit_ids_ctype.value.decode(self._encoding), error_code
|
|
1375
|
+
|
|
1376
|
+
def calkit_manager_calkit_add_connector(self, selector_string, connector_id):
|
|
1377
|
+
"""calkit_manager_calkit_add_connector."""
|
|
1378
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1379
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1380
|
+
connector_id_ctype = ctypes.create_string_buffer(connector_id.encode(self._encoding))
|
|
1381
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitAddConnector(
|
|
1382
|
+
vi_ctype, selector_string_ctype, connector_id_ctype
|
|
1383
|
+
)
|
|
1384
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1385
|
+
return error_code
|
|
1386
|
+
|
|
1387
|
+
def calkit_manager_calkit_remove_connector(self, selector_string, connector_id):
|
|
1388
|
+
"""calkit_manager_calkit_remove_connector."""
|
|
1389
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1390
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1391
|
+
connector_id_ctype = ctypes.create_string_buffer(connector_id.encode(self._encoding))
|
|
1392
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitRemoveConnector(
|
|
1393
|
+
vi_ctype, selector_string_ctype, connector_id_ctype
|
|
1394
|
+
)
|
|
1395
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1396
|
+
return error_code
|
|
1397
|
+
|
|
1398
|
+
def calkit_manager_calkit_get_connector_ids(self, selector_string):
|
|
1399
|
+
"""calkit_manager_calkit_get_connector_ids."""
|
|
1400
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1401
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1402
|
+
array_size_ctype = ctypes.c_int32(0)
|
|
1403
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitGetConnectorIDs(
|
|
1404
|
+
vi_ctype, selector_string_ctype, array_size_ctype, None
|
|
1405
|
+
)
|
|
1406
|
+
if error_code < 0:
|
|
1407
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1408
|
+
return "", error_code
|
|
1409
|
+
connector_ids_ctype = ctypes.create_string_buffer(error_code)
|
|
1410
|
+
|
|
1411
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitGetConnectorIDs(
|
|
1412
|
+
vi_ctype, selector_string_ctype, error_code, connector_ids_ctype
|
|
1413
|
+
)
|
|
1414
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1415
|
+
return connector_ids_ctype.value.decode(self._encoding), error_code
|
|
1416
|
+
|
|
1417
|
+
def calkit_manager_calkit_add_calibration_element(
|
|
1418
|
+
self, selector_string, calibration_element_id
|
|
1419
|
+
):
|
|
1420
|
+
"""calkit_manager_calkit_add_calibration_element."""
|
|
1421
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1422
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1423
|
+
calibration_element_id_ctype = ctypes.create_string_buffer(
|
|
1424
|
+
calibration_element_id.encode(self._encoding)
|
|
1425
|
+
)
|
|
1426
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitAddCalibrationElement(
|
|
1427
|
+
vi_ctype, selector_string_ctype, calibration_element_id_ctype
|
|
1428
|
+
)
|
|
1429
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1430
|
+
return error_code
|
|
1431
|
+
|
|
1432
|
+
def calkit_manager_calkit_remove_calibration_element(
|
|
1433
|
+
self, selector_string, calibration_element_id
|
|
1434
|
+
):
|
|
1435
|
+
"""calkit_manager_calkit_remove_calibration_element."""
|
|
1436
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1437
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1438
|
+
calibration_element_id_ctype = ctypes.create_string_buffer(
|
|
1439
|
+
calibration_element_id.encode(self._encoding)
|
|
1440
|
+
)
|
|
1441
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitRemoveCalibrationElement(
|
|
1442
|
+
vi_ctype, selector_string_ctype, calibration_element_id_ctype
|
|
1443
|
+
)
|
|
1444
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1445
|
+
return error_code
|
|
1446
|
+
|
|
1447
|
+
def calkit_manager_calkit_get_calibration_element_ids(self, selector_string):
|
|
1448
|
+
"""calkit_manager_calkit_get_calibration_element_ids."""
|
|
1449
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1450
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1451
|
+
array_size_ctype = ctypes.c_int32(0)
|
|
1452
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitGetCalibrationElementIDs(
|
|
1453
|
+
vi_ctype, selector_string_ctype, array_size_ctype, None
|
|
1454
|
+
)
|
|
1455
|
+
if error_code < 0:
|
|
1456
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1457
|
+
return "", error_code
|
|
1458
|
+
calibration_element_ids_ctype = ctypes.create_string_buffer(error_code)
|
|
1459
|
+
|
|
1460
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitGetCalibrationElementIDs(
|
|
1461
|
+
vi_ctype, selector_string_ctype, error_code, calibration_element_ids_ctype
|
|
1462
|
+
)
|
|
1463
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1464
|
+
return calibration_element_ids_ctype.value.decode(self._encoding), error_code
|
|
1465
|
+
|
|
1466
|
+
def calkit_manager_calkit_set_description(self, selector_string, calkit_description):
|
|
1467
|
+
"""calkit_manager_calkit_set_description."""
|
|
1468
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1469
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1470
|
+
calkit_description_ctype = ctypes.create_string_buffer(
|
|
1471
|
+
calkit_description.encode(self._encoding)
|
|
1472
|
+
)
|
|
1473
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitSetDescription(
|
|
1474
|
+
vi_ctype, selector_string_ctype, calkit_description_ctype
|
|
1475
|
+
)
|
|
1476
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1477
|
+
return error_code
|
|
1478
|
+
|
|
1479
|
+
def calkit_manager_calkit_set_version(self, selector_string, calkit_version):
|
|
1480
|
+
"""calkit_manager_calkit_set_version."""
|
|
1481
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1482
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1483
|
+
calkit_version_ctype = ctypes.create_string_buffer(calkit_version.encode(self._encoding))
|
|
1484
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitSetVersion(
|
|
1485
|
+
vi_ctype, selector_string_ctype, calkit_version_ctype
|
|
1486
|
+
)
|
|
1487
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1488
|
+
return error_code
|
|
1489
|
+
|
|
1490
|
+
def calkit_manager_calkit_set_trl_reference_plane(self, selector_string, reference_plane):
|
|
1491
|
+
"""calkit_manager_calkit_set_trl_reference_plane."""
|
|
1492
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1493
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1494
|
+
reference_plane_ctype = ctypes.c_int32(reference_plane)
|
|
1495
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitSetTRLReferencePlane(
|
|
1496
|
+
vi_ctype, selector_string_ctype, reference_plane_ctype
|
|
1497
|
+
)
|
|
1498
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1499
|
+
return error_code
|
|
1500
|
+
|
|
1501
|
+
def calkit_manager_calkit_set_lrl_line_auto_char(
|
|
1502
|
+
self, selector_string, auto_characterization_enabled
|
|
1503
|
+
):
|
|
1504
|
+
"""calkit_manager_calkit_set_lrl_line_auto_char."""
|
|
1505
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1506
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1507
|
+
auto_characterization_enabled_ctype = ctypes.c_int32(auto_characterization_enabled)
|
|
1508
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitSetLRLLineAutoChar(
|
|
1509
|
+
vi_ctype, selector_string_ctype, auto_characterization_enabled_ctype
|
|
1510
|
+
)
|
|
1511
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1512
|
+
return error_code
|
|
1513
|
+
|
|
1514
|
+
def calkit_manager_calkit_connector_set_description(self, selector_string, description):
|
|
1515
|
+
"""calkit_manager_calkit_connector_set_description."""
|
|
1516
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1517
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1518
|
+
description_ctype = ctypes.create_string_buffer(description.encode(self._encoding))
|
|
1519
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorSetDescription(
|
|
1520
|
+
vi_ctype, selector_string_ctype, description_ctype
|
|
1521
|
+
)
|
|
1522
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1523
|
+
return error_code
|
|
1524
|
+
|
|
1525
|
+
def calkit_manager_calkit_connector_set_gender(self, selector_string, connector_gender):
|
|
1526
|
+
"""calkit_manager_calkit_connector_set_gender."""
|
|
1527
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1528
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1529
|
+
connector_gender_ctype = ctypes.c_int32(connector_gender)
|
|
1530
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorSetGender(
|
|
1531
|
+
vi_ctype, selector_string_ctype, connector_gender_ctype
|
|
1532
|
+
)
|
|
1533
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1534
|
+
return error_code
|
|
1535
|
+
|
|
1536
|
+
def calkit_manager_calkit_connector_set_type(self, selector_string, connector_type):
|
|
1537
|
+
"""calkit_manager_calkit_connector_set_type."""
|
|
1538
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1539
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1540
|
+
connector_type_ctype = ctypes.create_string_buffer(connector_type.encode(self._encoding))
|
|
1541
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorSetType(
|
|
1542
|
+
vi_ctype, selector_string_ctype, connector_type_ctype
|
|
1543
|
+
)
|
|
1544
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1545
|
+
return error_code
|
|
1546
|
+
|
|
1547
|
+
def calkit_manager_calkit_connector_set_impedance(self, selector_string, impedance):
|
|
1548
|
+
"""calkit_manager_calkit_connector_set_impedance."""
|
|
1549
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1550
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1551
|
+
impedance_ctype = ctypes.c_double(impedance)
|
|
1552
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorSetImpedance(
|
|
1553
|
+
vi_ctype, selector_string_ctype, impedance_ctype
|
|
1554
|
+
)
|
|
1555
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1556
|
+
return error_code
|
|
1557
|
+
|
|
1558
|
+
def calkit_manager_calkit_connector_set_minimum_frequency(
|
|
1559
|
+
self, selector_string, minimum_frequency
|
|
1560
|
+
):
|
|
1561
|
+
"""calkit_manager_calkit_connector_set_minimum_frequency."""
|
|
1562
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1563
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1564
|
+
minimum_frequency_ctype = ctypes.c_double(minimum_frequency)
|
|
1565
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorSetMinimumFrequency(
|
|
1566
|
+
vi_ctype, selector_string_ctype, minimum_frequency_ctype
|
|
1567
|
+
)
|
|
1568
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1569
|
+
return error_code
|
|
1570
|
+
|
|
1571
|
+
def calkit_manager_calkit_connector_set_maximum_frequency(
|
|
1572
|
+
self, selector_string, maximum_frequency
|
|
1573
|
+
):
|
|
1574
|
+
"""calkit_manager_calkit_connector_set_maximum_frequency."""
|
|
1575
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1576
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1577
|
+
maximum_frequency_ctype = ctypes.c_double(maximum_frequency)
|
|
1578
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorSetMaximumFrequency(
|
|
1579
|
+
vi_ctype, selector_string_ctype, maximum_frequency_ctype
|
|
1580
|
+
)
|
|
1581
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1582
|
+
return error_code
|
|
1583
|
+
|
|
1584
|
+
def calkit_manager_calkit_calibration_element_set_description(
|
|
1585
|
+
self, selector_string, description
|
|
1586
|
+
):
|
|
1587
|
+
"""calkit_manager_calkit_calibration_element_set_description."""
|
|
1588
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1589
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1590
|
+
description_ctype = ctypes.create_string_buffer(description.encode(self._encoding))
|
|
1591
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSetDescription(
|
|
1592
|
+
vi_ctype, selector_string_ctype, description_ctype
|
|
1593
|
+
)
|
|
1594
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1595
|
+
return error_code
|
|
1596
|
+
|
|
1597
|
+
def calkit_manager_calkit_calibration_element_set_types(
|
|
1598
|
+
self, selector_string, calibration_element_types
|
|
1599
|
+
):
|
|
1600
|
+
"""calkit_manager_calkit_calibration_element_set_types."""
|
|
1601
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1602
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1603
|
+
calibration_element_types_ctype = _get_ctypes_pointer_for_buffer(
|
|
1604
|
+
value=calibration_element_types, library_type=ctypes.c_int32
|
|
1605
|
+
)
|
|
1606
|
+
array_size_ctype = ctypes.c_int32(
|
|
1607
|
+
len(calibration_element_types) if calibration_element_types is not None else 0
|
|
1608
|
+
)
|
|
1609
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSetTypes(
|
|
1610
|
+
vi_ctype, selector_string_ctype, calibration_element_types_ctype, array_size_ctype
|
|
1611
|
+
)
|
|
1612
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1613
|
+
return error_code
|
|
1614
|
+
|
|
1615
|
+
def calkit_manager_calkit_calibration_element_get_port_connectors(self, selector_string):
|
|
1616
|
+
"""calkit_manager_calkit_calibration_element_get_port_connectors."""
|
|
1617
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1618
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1619
|
+
array_size_ctype = ctypes.c_int32(0)
|
|
1620
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementGetPortConnectors(
|
|
1621
|
+
vi_ctype, selector_string_ctype, array_size_ctype, None
|
|
1622
|
+
)
|
|
1623
|
+
if error_code < 0:
|
|
1624
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1625
|
+
return "", error_code
|
|
1626
|
+
connector_ids_ctype = ctypes.create_string_buffer(error_code)
|
|
1627
|
+
|
|
1628
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementGetPortConnectors(
|
|
1629
|
+
vi_ctype, selector_string_ctype, error_code, connector_ids_ctype
|
|
1630
|
+
)
|
|
1631
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1632
|
+
return connector_ids_ctype.value.decode(self._encoding), error_code
|
|
1633
|
+
|
|
1634
|
+
def calkit_manager_calkit_calibration_element_set_s_parameter_definition(
|
|
1635
|
+
self, selector_string, s_parameter_definition
|
|
1636
|
+
):
|
|
1637
|
+
"""calkit_manager_calkit_calibration_element_set_s_parameter_definition."""
|
|
1638
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1639
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1640
|
+
s_parameter_definition_ctype = ctypes.c_int32(s_parameter_definition)
|
|
1641
|
+
error_code = (
|
|
1642
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSetSParameterDefinition(
|
|
1643
|
+
vi_ctype, selector_string_ctype, s_parameter_definition_ctype
|
|
1644
|
+
)
|
|
1645
|
+
)
|
|
1646
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1647
|
+
return error_code
|
|
1648
|
+
|
|
1649
|
+
def calkit_manager_calkit_calibration_element_set_minimum_frequency(
|
|
1650
|
+
self, selector_string, minimum_frequency
|
|
1651
|
+
):
|
|
1652
|
+
"""calkit_manager_calkit_calibration_element_set_minimum_frequency."""
|
|
1653
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1654
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1655
|
+
minimum_frequency_ctype = ctypes.c_double(minimum_frequency)
|
|
1656
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSetMinimumFrequency(
|
|
1657
|
+
vi_ctype, selector_string_ctype, minimum_frequency_ctype
|
|
1658
|
+
)
|
|
1659
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1660
|
+
return error_code
|
|
1661
|
+
|
|
1662
|
+
def calkit_manager_calkit_calibration_element_set_maximum_frequency(
|
|
1663
|
+
self, selector_string, maximum_frequency
|
|
1664
|
+
):
|
|
1665
|
+
"""calkit_manager_calkit_calibration_element_set_maximum_frequency."""
|
|
1666
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1667
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1668
|
+
maximum_frequency_ctype = ctypes.c_double(maximum_frequency)
|
|
1669
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSetMaximumFrequency(
|
|
1670
|
+
vi_ctype, selector_string_ctype, maximum_frequency_ctype
|
|
1671
|
+
)
|
|
1672
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1673
|
+
return error_code
|
|
1674
|
+
|
|
1675
|
+
def calkit_manager_calkit_calibration_element_reflect_model_set_model_type(
|
|
1676
|
+
self, selector_string, model_type
|
|
1677
|
+
):
|
|
1678
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_set_model_type."""
|
|
1679
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1680
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1681
|
+
model_type_ctype = ctypes.c_int32(model_type)
|
|
1682
|
+
error_code = (
|
|
1683
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelSetModelType(
|
|
1684
|
+
vi_ctype, selector_string_ctype, model_type_ctype
|
|
1685
|
+
)
|
|
1686
|
+
)
|
|
1687
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1688
|
+
return error_code
|
|
1689
|
+
|
|
1690
|
+
def calkit_manager_calkit_calibration_element_reflect_model_set_s_param_availability(
|
|
1691
|
+
self, selector_string, s_parameter_availability
|
|
1692
|
+
):
|
|
1693
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_set_s_param_availability."""
|
|
1694
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1695
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1696
|
+
s_parameter_availability_ctype = ctypes.c_int32(s_parameter_availability)
|
|
1697
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelSetSParamAvailability(
|
|
1698
|
+
vi_ctype, selector_string_ctype, s_parameter_availability_ctype
|
|
1699
|
+
)
|
|
1700
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1701
|
+
return error_code
|
|
1702
|
+
|
|
1703
|
+
def calkit_manager_calkit_calibration_element_reflect_model_set_c0(self, selector_string, c0):
|
|
1704
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_set_c0."""
|
|
1705
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1706
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1707
|
+
c0_ctype = ctypes.c_double(c0)
|
|
1708
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelSetC0(
|
|
1709
|
+
vi_ctype, selector_string_ctype, c0_ctype
|
|
1710
|
+
)
|
|
1711
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1712
|
+
return error_code
|
|
1713
|
+
|
|
1714
|
+
def calkit_manager_calkit_calibration_element_reflect_model_set_c1(self, selector_string, c1):
|
|
1715
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_set_c1."""
|
|
1716
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1717
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1718
|
+
c1_ctype = ctypes.c_double(c1)
|
|
1719
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelSetC1(
|
|
1720
|
+
vi_ctype, selector_string_ctype, c1_ctype
|
|
1721
|
+
)
|
|
1722
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1723
|
+
return error_code
|
|
1724
|
+
|
|
1725
|
+
def calkit_manager_calkit_calibration_element_reflect_model_set_c2(self, selector_string, c2):
|
|
1726
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_set_c2."""
|
|
1727
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1728
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1729
|
+
c2_ctype = ctypes.c_double(c2)
|
|
1730
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelSetC2(
|
|
1731
|
+
vi_ctype, selector_string_ctype, c2_ctype
|
|
1732
|
+
)
|
|
1733
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1734
|
+
return error_code
|
|
1735
|
+
|
|
1736
|
+
def calkit_manager_calkit_calibration_element_reflect_model_set_c3(self, selector_string, c3):
|
|
1737
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_set_c3."""
|
|
1738
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1739
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1740
|
+
c3_ctype = ctypes.c_double(c3)
|
|
1741
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelSetC3(
|
|
1742
|
+
vi_ctype, selector_string_ctype, c3_ctype
|
|
1743
|
+
)
|
|
1744
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1745
|
+
return error_code
|
|
1746
|
+
|
|
1747
|
+
def calkit_manager_calkit_calibration_element_reflect_model_set_offset_delay(
|
|
1748
|
+
self, selector_string, offset_delay
|
|
1749
|
+
):
|
|
1750
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_set_offset_delay."""
|
|
1751
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1752
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1753
|
+
offset_delay_ctype = ctypes.c_double(offset_delay)
|
|
1754
|
+
error_code = (
|
|
1755
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelSetOffsetDelay(
|
|
1756
|
+
vi_ctype, selector_string_ctype, offset_delay_ctype
|
|
1757
|
+
)
|
|
1758
|
+
)
|
|
1759
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1760
|
+
return error_code
|
|
1761
|
+
|
|
1762
|
+
def calkit_manager_calkit_calibration_element_reflect_model_set_offset_loss(
|
|
1763
|
+
self, selector_string, offset_loss
|
|
1764
|
+
):
|
|
1765
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_set_offset_loss."""
|
|
1766
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1767
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1768
|
+
offset_loss_ctype = ctypes.c_double(offset_loss)
|
|
1769
|
+
error_code = (
|
|
1770
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelSetOffsetLoss(
|
|
1771
|
+
vi_ctype, selector_string_ctype, offset_loss_ctype
|
|
1772
|
+
)
|
|
1773
|
+
)
|
|
1774
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1775
|
+
return error_code
|
|
1776
|
+
|
|
1777
|
+
def calkit_manager_calkit_calibration_element_reflect_model_set_offset_z0(
|
|
1778
|
+
self, selector_string, offset_z0
|
|
1779
|
+
):
|
|
1780
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_set_offset_z0."""
|
|
1781
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1782
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1783
|
+
offset_z0_ctype = ctypes.c_double(offset_z0)
|
|
1784
|
+
error_code = (
|
|
1785
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelSetOffsetZ0(
|
|
1786
|
+
vi_ctype, selector_string_ctype, offset_z0_ctype
|
|
1787
|
+
)
|
|
1788
|
+
)
|
|
1789
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1790
|
+
return error_code
|
|
1791
|
+
|
|
1792
|
+
def calkit_manager_calkit_calibration_element_reflect_model_set_reference_impedance(
|
|
1793
|
+
self, selector_string, reference_impedance
|
|
1794
|
+
):
|
|
1795
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_set_reference_impedance."""
|
|
1796
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1797
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1798
|
+
reference_impedance_ctype = ctypes.c_double(reference_impedance)
|
|
1799
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelSetReferenceImpedance(
|
|
1800
|
+
vi_ctype, selector_string_ctype, reference_impedance_ctype
|
|
1801
|
+
)
|
|
1802
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1803
|
+
return error_code
|
|
1804
|
+
|
|
1805
|
+
def calkit_manager_calkit_calibration_element_delay_model_set_delay(
|
|
1806
|
+
self, selector_string, delay
|
|
1807
|
+
):
|
|
1808
|
+
"""calkit_manager_calkit_calibration_element_delay_model_set_delay."""
|
|
1809
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1810
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1811
|
+
delay_ctype = ctypes.c_double(delay)
|
|
1812
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementDelayModelSetDelay(
|
|
1813
|
+
vi_ctype, selector_string_ctype, delay_ctype
|
|
1814
|
+
)
|
|
1815
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1816
|
+
return error_code
|
|
1817
|
+
|
|
1818
|
+
def calkit_manager_calkit_calibration_element_s_parameter_set_frequency(
|
|
1819
|
+
self, selector_string, frequency
|
|
1820
|
+
):
|
|
1821
|
+
"""calkit_manager_calkit_calibration_element_s_parameter_set_frequency."""
|
|
1822
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1823
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1824
|
+
frequency_ctype = _get_ctypes_pointer_for_buffer(
|
|
1825
|
+
value=frequency, library_type=ctypes.c_double
|
|
1826
|
+
)
|
|
1827
|
+
array_size_ctype = ctypes.c_int32(len(frequency) if frequency is not None else 0)
|
|
1828
|
+
error_code = (
|
|
1829
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterSetFrequency(
|
|
1830
|
+
vi_ctype, selector_string_ctype, frequency_ctype, array_size_ctype
|
|
1831
|
+
)
|
|
1832
|
+
)
|
|
1833
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1834
|
+
return error_code
|
|
1835
|
+
|
|
1836
|
+
def calkit_manager_calkit_calibration_element_s_parameter_set_s_param_availability(
|
|
1837
|
+
self, selector_string, s_parameter_availability
|
|
1838
|
+
):
|
|
1839
|
+
"""calkit_manager_calkit_calibration_element_s_parameter_set_s_param_availability."""
|
|
1840
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1841
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1842
|
+
s_parameter_availability_ctype = ctypes.c_int32(s_parameter_availability)
|
|
1843
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterSetSParamAvailability(
|
|
1844
|
+
vi_ctype, selector_string_ctype, s_parameter_availability_ctype
|
|
1845
|
+
)
|
|
1846
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1847
|
+
return error_code
|
|
1848
|
+
|
|
1849
|
+
def calkit_manager_calkit_calibration_element_s_parameter_set_s11(self, selector_string, s11):
|
|
1850
|
+
"""calkit_manager_calkit_calibration_element_s_parameter_set_s11."""
|
|
1851
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1852
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1853
|
+
_helper.validate_numpy_array(s11, "s11", "complex128")
|
|
1854
|
+
s11_ctype = _get_ctypes_pointer_for_buffer(
|
|
1855
|
+
value=s11, library_type=_custom_types.ComplexDouble
|
|
1856
|
+
)
|
|
1857
|
+
array_size_ctype = ctypes.c_int32(len(s11) if s11 is not None else 0)
|
|
1858
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterSetS11(
|
|
1859
|
+
vi_ctype, selector_string_ctype, s11_ctype, array_size_ctype
|
|
1860
|
+
)
|
|
1861
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1862
|
+
return error_code
|
|
1863
|
+
|
|
1864
|
+
def calkit_manager_calkit_calibration_element_s_parameter_set_s12(self, selector_string, s12):
|
|
1865
|
+
"""calkit_manager_calkit_calibration_element_s_parameter_set_s12."""
|
|
1866
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1867
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1868
|
+
_helper.validate_numpy_array(s12, "s12", "complex128")
|
|
1869
|
+
s12_ctype = _get_ctypes_pointer_for_buffer(
|
|
1870
|
+
value=s12, library_type=_custom_types.ComplexDouble
|
|
1871
|
+
)
|
|
1872
|
+
array_size_ctype = ctypes.c_int32(len(s12) if s12 is not None else 0)
|
|
1873
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterSetS12(
|
|
1874
|
+
vi_ctype, selector_string_ctype, s12_ctype, array_size_ctype
|
|
1875
|
+
)
|
|
1876
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1877
|
+
return error_code
|
|
1878
|
+
|
|
1879
|
+
def calkit_manager_calkit_calibration_element_s_parameter_set_s21(self, selector_string, s21):
|
|
1880
|
+
"""calkit_manager_calkit_calibration_element_s_parameter_set_s21."""
|
|
1881
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1882
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1883
|
+
_helper.validate_numpy_array(s21, "s21", "complex128")
|
|
1884
|
+
s21_ctype = _get_ctypes_pointer_for_buffer(
|
|
1885
|
+
value=s21, library_type=_custom_types.ComplexDouble
|
|
1886
|
+
)
|
|
1887
|
+
array_size_ctype = ctypes.c_int32(len(s21) if s21 is not None else 0)
|
|
1888
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterSetS21(
|
|
1889
|
+
vi_ctype, selector_string_ctype, s21_ctype, array_size_ctype
|
|
1890
|
+
)
|
|
1891
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1892
|
+
return error_code
|
|
1893
|
+
|
|
1894
|
+
def calkit_manager_calkit_calibration_element_s_parameter_set_s22(self, selector_string, s22):
|
|
1895
|
+
"""calkit_manager_calkit_calibration_element_s_parameter_set_s22."""
|
|
1896
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1897
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1898
|
+
_helper.validate_numpy_array(s22, "s22", "complex128")
|
|
1899
|
+
s22_ctype = _get_ctypes_pointer_for_buffer(
|
|
1900
|
+
value=s22, library_type=_custom_types.ComplexDouble
|
|
1901
|
+
)
|
|
1902
|
+
array_size_ctype = ctypes.c_int32(len(s22) if s22 is not None else 0)
|
|
1903
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterSetS22(
|
|
1904
|
+
vi_ctype, selector_string_ctype, s22_ctype, array_size_ctype
|
|
1905
|
+
)
|
|
1906
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1907
|
+
return error_code
|
|
1908
|
+
|
|
1909
|
+
def calkit_manager_calkit_calibration_element_s_parameter_set_from_file(
|
|
1910
|
+
self, selector_string, file_name
|
|
1911
|
+
):
|
|
1912
|
+
"""calkit_manager_calkit_calibration_element_s_parameter_set_from_file."""
|
|
1913
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1914
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1915
|
+
file_name_ctype = ctypes.create_string_buffer(file_name.encode(self._encoding))
|
|
1916
|
+
error_code = (
|
|
1917
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterSetFromFile(
|
|
1918
|
+
vi_ctype, selector_string_ctype, file_name_ctype
|
|
1919
|
+
)
|
|
1920
|
+
)
|
|
1921
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1922
|
+
return error_code
|
|
1923
|
+
|
|
1924
|
+
def marker_configure_number_of_markers(self, selector_string, number_of_markers):
|
|
1925
|
+
"""marker_configure_number_of_markers."""
|
|
1926
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1927
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1928
|
+
number_of_markers_ctype = ctypes.c_int32(number_of_markers)
|
|
1929
|
+
error_code = self._library.RFmxVNA_MarkerCfgNumberOfMarkers(
|
|
1930
|
+
vi_ctype, selector_string_ctype, number_of_markers_ctype
|
|
1931
|
+
)
|
|
1932
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1933
|
+
return error_code
|
|
1934
|
+
|
|
1935
|
+
def marker_configure_type(self, selector_string, marker_type):
|
|
1936
|
+
"""marker_configure_type."""
|
|
1937
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1938
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1939
|
+
marker_type_ctype = ctypes.c_int32(marker_type)
|
|
1940
|
+
error_code = self._library.RFmxVNA_MarkerCfgType(
|
|
1941
|
+
vi_ctype, selector_string_ctype, marker_type_ctype
|
|
1942
|
+
)
|
|
1943
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1944
|
+
return error_code
|
|
1945
|
+
|
|
1946
|
+
def marker_configure_reference_marker(self, selector_string, reference_marker):
|
|
1947
|
+
"""marker_configure_reference_marker."""
|
|
1948
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1949
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1950
|
+
reference_marker_ctype = ctypes.c_int32(reference_marker)
|
|
1951
|
+
error_code = self._library.RFmxVNA_MarkerCfgReferenceMarker(
|
|
1952
|
+
vi_ctype, selector_string_ctype, reference_marker_ctype
|
|
1953
|
+
)
|
|
1954
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1955
|
+
return error_code
|
|
1956
|
+
|
|
1957
|
+
def marker_configure_x(self, selector_string, marker_x):
|
|
1958
|
+
"""marker_configure_x."""
|
|
1959
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1960
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1961
|
+
marker_x_ctype = ctypes.c_double(marker_x)
|
|
1962
|
+
error_code = self._library.RFmxVNA_MarkerCfgX(
|
|
1963
|
+
vi_ctype, selector_string_ctype, marker_x_ctype
|
|
1964
|
+
)
|
|
1965
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1966
|
+
return error_code
|
|
1967
|
+
|
|
1968
|
+
def marker_configure_y(self, selector_string, marker_y1, marker_y2):
|
|
1969
|
+
"""marker_configure_y."""
|
|
1970
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1971
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1972
|
+
marker_y1_ctype = ctypes.c_double(marker_y1)
|
|
1973
|
+
marker_y2_ctype = ctypes.c_double(marker_y2)
|
|
1974
|
+
error_code = self._library.RFmxVNA_MarkerCfgY(
|
|
1975
|
+
vi_ctype, selector_string_ctype, marker_y1_ctype, marker_y2_ctype
|
|
1976
|
+
)
|
|
1977
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1978
|
+
return error_code
|
|
1979
|
+
|
|
1980
|
+
def marker_configure_data_source(self, selector_string, data_source):
|
|
1981
|
+
"""marker_configure_data_source."""
|
|
1982
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1983
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1984
|
+
data_source_ctype = ctypes.create_string_buffer(data_source.encode(self._encoding))
|
|
1985
|
+
error_code = self._library.RFmxVNA_MarkerCfgDataSource(
|
|
1986
|
+
vi_ctype, selector_string_ctype, data_source_ctype
|
|
1987
|
+
)
|
|
1988
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
1989
|
+
return error_code
|
|
1990
|
+
|
|
1991
|
+
def marker_configure_peak_search_threshold(self, selector_string, threshold_enabled, threshold):
|
|
1992
|
+
"""marker_configure_peak_search_threshold."""
|
|
1993
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
1994
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
1995
|
+
threshold_enabled_ctype = ctypes.c_int32(threshold_enabled)
|
|
1996
|
+
threshold_ctype = ctypes.c_double(threshold)
|
|
1997
|
+
error_code = self._library.RFmxVNA_MarkerCfgPeakSearchThreshold(
|
|
1998
|
+
vi_ctype, selector_string_ctype, threshold_enabled_ctype, threshold_ctype
|
|
1999
|
+
)
|
|
2000
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2001
|
+
return error_code
|
|
2002
|
+
|
|
2003
|
+
def marker_configure_peak_search_excursion(
|
|
2004
|
+
self, selector_string, peak_excursion_enabled, peak_excursion
|
|
2005
|
+
):
|
|
2006
|
+
"""marker_configure_peak_search_excursion."""
|
|
2007
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2008
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2009
|
+
peak_excursion_enabled_ctype = ctypes.c_int32(peak_excursion_enabled)
|
|
2010
|
+
peak_excursion_ctype = ctypes.c_double(peak_excursion)
|
|
2011
|
+
error_code = self._library.RFmxVNA_MarkerCfgPeakSearchExcursion(
|
|
2012
|
+
vi_ctype, selector_string_ctype, peak_excursion_enabled_ctype, peak_excursion_ctype
|
|
2013
|
+
)
|
|
2014
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2015
|
+
return error_code
|
|
2016
|
+
|
|
2017
|
+
def marker_configure_mode(self, selector_string, marker_mode):
|
|
2018
|
+
"""marker_configure_mode."""
|
|
2019
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2020
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2021
|
+
marker_mode_ctype = ctypes.c_int32(marker_mode)
|
|
2022
|
+
error_code = self._library.RFmxVNA_MarkerCfgMode(
|
|
2023
|
+
vi_ctype, selector_string_ctype, marker_mode_ctype
|
|
2024
|
+
)
|
|
2025
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2026
|
+
return error_code
|
|
2027
|
+
|
|
2028
|
+
def marker_configure_target_value(self, selector_string, target_value):
|
|
2029
|
+
"""marker_configure_target_value."""
|
|
2030
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2031
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2032
|
+
target_value_ctype = ctypes.c_double(target_value)
|
|
2033
|
+
error_code = self._library.RFmxVNA_MarkerCfgTargetValue(
|
|
2034
|
+
vi_ctype, selector_string_ctype, target_value_ctype
|
|
2035
|
+
)
|
|
2036
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2037
|
+
return error_code
|
|
2038
|
+
|
|
2039
|
+
def marker_marker_search(self, selector_string, search_mode):
|
|
2040
|
+
"""marker_marker_search."""
|
|
2041
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2042
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2043
|
+
search_mode_ctype = ctypes.c_int32(search_mode)
|
|
2044
|
+
error_code = self._library.RFmxVNA_MarkerSearch(
|
|
2045
|
+
vi_ctype, selector_string_ctype, search_mode_ctype
|
|
2046
|
+
)
|
|
2047
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2048
|
+
return error_code
|
|
2049
|
+
|
|
2050
|
+
def marker_fetch_x(self, selector_string):
|
|
2051
|
+
"""marker_fetch_x."""
|
|
2052
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2053
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2054
|
+
marker_x_ctype = ctypes.c_double()
|
|
2055
|
+
error_code = self._library.RFmxVNA_MarkerFetchX(
|
|
2056
|
+
vi_ctype, selector_string_ctype, marker_x_ctype
|
|
2057
|
+
)
|
|
2058
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2059
|
+
return marker_x_ctype.value, error_code
|
|
2060
|
+
|
|
2061
|
+
def marker_fetch_y(self, selector_string):
|
|
2062
|
+
"""marker_fetch_y."""
|
|
2063
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2064
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2065
|
+
marker_y1_ctype = ctypes.c_double()
|
|
2066
|
+
marker_y2_ctype = ctypes.c_double()
|
|
2067
|
+
error_code = self._library.RFmxVNA_MarkerFetchY(
|
|
2068
|
+
vi_ctype, selector_string_ctype, marker_y1_ctype, marker_y2_ctype
|
|
2069
|
+
)
|
|
2070
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2071
|
+
return marker_y1_ctype.value, marker_y2_ctype.value, error_code
|
|
2072
|
+
|
|
2073
|
+
def calkit_manager_calkit_get_trl_reference_plane(self, selector_string):
|
|
2074
|
+
"""calkit_manager_calkit_get_trl_reference_plane."""
|
|
2075
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2076
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2077
|
+
reference_plane_ctype = ctypes.c_int32()
|
|
2078
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitGetTRLReferencePlane(
|
|
2079
|
+
vi_ctype, selector_string_ctype, reference_plane_ctype
|
|
2080
|
+
)
|
|
2081
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2082
|
+
return enums.CalkitManagerCalkitTrlReferencePlane(reference_plane_ctype.value), error_code
|
|
2083
|
+
|
|
2084
|
+
def calkit_manager_calkit_get_lrl_line_auto_char(self, selector_string):
|
|
2085
|
+
"""calkit_manager_calkit_get_lrl_line_auto_char."""
|
|
2086
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2087
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2088
|
+
auto_characterization_enabled_ctype = ctypes.c_int32()
|
|
2089
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitGetLRLLineAutoChar(
|
|
2090
|
+
vi_ctype, selector_string_ctype, auto_characterization_enabled_ctype
|
|
2091
|
+
)
|
|
2092
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2093
|
+
return bool(auto_characterization_enabled_ctype.value), error_code
|
|
2094
|
+
|
|
2095
|
+
def calkit_manager_calkit_connector_get_gender(self, selector_string):
|
|
2096
|
+
"""calkit_manager_calkit_connector_get_gender."""
|
|
2097
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2098
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2099
|
+
connector_gender_ctype = ctypes.c_int32()
|
|
2100
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorGetGender(
|
|
2101
|
+
vi_ctype, selector_string_ctype, connector_gender_ctype
|
|
2102
|
+
)
|
|
2103
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2104
|
+
return enums.CalkitManagerCalkitConnectorGender(connector_gender_ctype.value), error_code
|
|
2105
|
+
|
|
2106
|
+
def calkit_manager_calkit_connector_get_impedance(self, selector_string):
|
|
2107
|
+
"""calkit_manager_calkit_connector_get_impedance."""
|
|
2108
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2109
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2110
|
+
impedance_ctype = ctypes.c_double()
|
|
2111
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorGetImpedance(
|
|
2112
|
+
vi_ctype, selector_string_ctype, impedance_ctype
|
|
2113
|
+
)
|
|
2114
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2115
|
+
return impedance_ctype.value, error_code
|
|
2116
|
+
|
|
2117
|
+
def calkit_manager_calkit_connector_get_minimum_frequency(self, selector_string):
|
|
2118
|
+
"""calkit_manager_calkit_connector_get_minimum_frequency."""
|
|
2119
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2120
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2121
|
+
minimum_frequency_ctype = ctypes.c_double()
|
|
2122
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorGetMinimumFrequency(
|
|
2123
|
+
vi_ctype, selector_string_ctype, minimum_frequency_ctype
|
|
2124
|
+
)
|
|
2125
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2126
|
+
return minimum_frequency_ctype.value, error_code
|
|
2127
|
+
|
|
2128
|
+
def calkit_manager_calkit_connector_get_maximum_frequency(self, selector_string):
|
|
2129
|
+
"""calkit_manager_calkit_connector_get_maximum_frequency."""
|
|
2130
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2131
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2132
|
+
maximum_frequency_ctype = ctypes.c_double()
|
|
2133
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorGetMaximumFrequency(
|
|
2134
|
+
vi_ctype, selector_string_ctype, maximum_frequency_ctype
|
|
2135
|
+
)
|
|
2136
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2137
|
+
return maximum_frequency_ctype.value, error_code
|
|
2138
|
+
|
|
2139
|
+
def calkit_manager_calkit_calibration_element_get_s_parameter_definition(self, selector_string):
|
|
2140
|
+
"""calkit_manager_calkit_calibration_element_get_s_parameter_definition."""
|
|
2141
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2142
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2143
|
+
s_parameter_definition_ctype = ctypes.c_int32()
|
|
2144
|
+
error_code = (
|
|
2145
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementGetSParameterDefinition(
|
|
2146
|
+
vi_ctype, selector_string_ctype, s_parameter_definition_ctype
|
|
2147
|
+
)
|
|
2148
|
+
)
|
|
2149
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2150
|
+
return (
|
|
2151
|
+
enums.CalkitManagerCalkitCalibrationElementSParameterDefinition(
|
|
2152
|
+
s_parameter_definition_ctype.value
|
|
2153
|
+
),
|
|
2154
|
+
error_code,
|
|
2155
|
+
)
|
|
2156
|
+
|
|
2157
|
+
def calkit_manager_calkit_calibration_element_get_minimum_frequency(self, selector_string):
|
|
2158
|
+
"""calkit_manager_calkit_calibration_element_get_minimum_frequency."""
|
|
2159
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2160
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2161
|
+
minimum_frequency_ctype = ctypes.c_double()
|
|
2162
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementGetMinimumFrequency(
|
|
2163
|
+
vi_ctype, selector_string_ctype, minimum_frequency_ctype
|
|
2164
|
+
)
|
|
2165
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2166
|
+
return minimum_frequency_ctype.value, error_code
|
|
2167
|
+
|
|
2168
|
+
def calkit_manager_calkit_calibration_element_get_maximum_frequency(self, selector_string):
|
|
2169
|
+
"""calkit_manager_calkit_calibration_element_get_maximum_frequency."""
|
|
2170
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2171
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2172
|
+
maximum_frequency_ctype = ctypes.c_double()
|
|
2173
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementGetMaximumFrequency(
|
|
2174
|
+
vi_ctype, selector_string_ctype, maximum_frequency_ctype
|
|
2175
|
+
)
|
|
2176
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2177
|
+
return maximum_frequency_ctype.value, error_code
|
|
2178
|
+
|
|
2179
|
+
def calkit_manager_calkit_calibration_element_reflect_model_get_model_type(
|
|
2180
|
+
self, selector_string
|
|
2181
|
+
):
|
|
2182
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_get_model_type."""
|
|
2183
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2184
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2185
|
+
model_type_ctype = ctypes.c_int32()
|
|
2186
|
+
error_code = (
|
|
2187
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelGetModelType(
|
|
2188
|
+
vi_ctype, selector_string_ctype, model_type_ctype
|
|
2189
|
+
)
|
|
2190
|
+
)
|
|
2191
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2192
|
+
return (
|
|
2193
|
+
enums.CalkitManagerCalkitCalibrationElementReflectModelType(model_type_ctype.value),
|
|
2194
|
+
error_code,
|
|
2195
|
+
)
|
|
2196
|
+
|
|
2197
|
+
def calkit_manager_calkit_calibration_element_reflect_model_get_s_param_availability(
|
|
2198
|
+
self, selector_string
|
|
2199
|
+
):
|
|
2200
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_get_s_param_availability."""
|
|
2201
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2202
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2203
|
+
s_parameter_availability_ctype = ctypes.c_int32()
|
|
2204
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelGetSParamAvailability(
|
|
2205
|
+
vi_ctype, selector_string_ctype, s_parameter_availability_ctype
|
|
2206
|
+
)
|
|
2207
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2208
|
+
return (
|
|
2209
|
+
enums.CalkitManagerCalkitCalibrationElementReflectModelSParameterAvailability(
|
|
2210
|
+
s_parameter_availability_ctype.value
|
|
2211
|
+
),
|
|
2212
|
+
error_code,
|
|
2213
|
+
)
|
|
2214
|
+
|
|
2215
|
+
def calkit_manager_calkit_calibration_element_reflect_model_get_c0(self, selector_string):
|
|
2216
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_get_c0."""
|
|
2217
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2218
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2219
|
+
c0_ctype = ctypes.c_double()
|
|
2220
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelGetC0(
|
|
2221
|
+
vi_ctype, selector_string_ctype, c0_ctype
|
|
2222
|
+
)
|
|
2223
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2224
|
+
return c0_ctype.value, error_code
|
|
2225
|
+
|
|
2226
|
+
def calkit_manager_calkit_calibration_element_reflect_model_get_c1(self, selector_string):
|
|
2227
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_get_c1."""
|
|
2228
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2229
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2230
|
+
c1_ctype = ctypes.c_double()
|
|
2231
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelGetC1(
|
|
2232
|
+
vi_ctype, selector_string_ctype, c1_ctype
|
|
2233
|
+
)
|
|
2234
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2235
|
+
return c1_ctype.value, error_code
|
|
2236
|
+
|
|
2237
|
+
def calkit_manager_calkit_calibration_element_reflect_model_get_c2(self, selector_string):
|
|
2238
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_get_c2."""
|
|
2239
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2240
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2241
|
+
c2_ctype = ctypes.c_double()
|
|
2242
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelGetC2(
|
|
2243
|
+
vi_ctype, selector_string_ctype, c2_ctype
|
|
2244
|
+
)
|
|
2245
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2246
|
+
return c2_ctype.value, error_code
|
|
2247
|
+
|
|
2248
|
+
def calkit_manager_calkit_calibration_element_reflect_model_get_c3(self, selector_string):
|
|
2249
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_get_c3."""
|
|
2250
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2251
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2252
|
+
c3_ctype = ctypes.c_double()
|
|
2253
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelGetC3(
|
|
2254
|
+
vi_ctype, selector_string_ctype, c3_ctype
|
|
2255
|
+
)
|
|
2256
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2257
|
+
return c3_ctype.value, error_code
|
|
2258
|
+
|
|
2259
|
+
def calkit_manager_calkit_calibration_element_reflect_model_get_offset_delay(
|
|
2260
|
+
self, selector_string
|
|
2261
|
+
):
|
|
2262
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_get_offset_delay."""
|
|
2263
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2264
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2265
|
+
offset_delay_ctype = ctypes.c_double()
|
|
2266
|
+
error_code = (
|
|
2267
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelGetOffsetDelay(
|
|
2268
|
+
vi_ctype, selector_string_ctype, offset_delay_ctype
|
|
2269
|
+
)
|
|
2270
|
+
)
|
|
2271
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2272
|
+
return offset_delay_ctype.value, error_code
|
|
2273
|
+
|
|
2274
|
+
def calkit_manager_calkit_calibration_element_reflect_model_get_offset_loss(
|
|
2275
|
+
self, selector_string
|
|
2276
|
+
):
|
|
2277
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_get_offset_loss."""
|
|
2278
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2279
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2280
|
+
offset_loss_ctype = ctypes.c_double()
|
|
2281
|
+
error_code = (
|
|
2282
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelGetOffsetLoss(
|
|
2283
|
+
vi_ctype, selector_string_ctype, offset_loss_ctype
|
|
2284
|
+
)
|
|
2285
|
+
)
|
|
2286
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2287
|
+
return offset_loss_ctype.value, error_code
|
|
2288
|
+
|
|
2289
|
+
def calkit_manager_calkit_calibration_element_reflect_model_get_offset_z0(
|
|
2290
|
+
self, selector_string
|
|
2291
|
+
):
|
|
2292
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_get_offset_z0."""
|
|
2293
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2294
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2295
|
+
offset_z0_ctype = ctypes.c_double()
|
|
2296
|
+
error_code = (
|
|
2297
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelGetOffsetZ0(
|
|
2298
|
+
vi_ctype, selector_string_ctype, offset_z0_ctype
|
|
2299
|
+
)
|
|
2300
|
+
)
|
|
2301
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2302
|
+
return offset_z0_ctype.value, error_code
|
|
2303
|
+
|
|
2304
|
+
def calkit_manager_calkit_calibration_element_reflect_model_get_reference_impedance(
|
|
2305
|
+
self, selector_string
|
|
2306
|
+
):
|
|
2307
|
+
"""calkit_manager_calkit_calibration_element_reflect_model_get_reference_impedance."""
|
|
2308
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2309
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2310
|
+
reference_impedance_ctype = ctypes.c_double()
|
|
2311
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementReflectModelGetReferenceImpedance(
|
|
2312
|
+
vi_ctype, selector_string_ctype, reference_impedance_ctype
|
|
2313
|
+
)
|
|
2314
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2315
|
+
return reference_impedance_ctype.value, error_code
|
|
2316
|
+
|
|
2317
|
+
def calkit_manager_calkit_calibration_element_delay_model_get_delay(self, selector_string):
|
|
2318
|
+
"""calkit_manager_calkit_calibration_element_delay_model_get_delay."""
|
|
2319
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2320
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2321
|
+
delay_ctype = ctypes.c_double()
|
|
2322
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementDelayModelGetDelay(
|
|
2323
|
+
vi_ctype, selector_string_ctype, delay_ctype
|
|
2324
|
+
)
|
|
2325
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2326
|
+
return delay_ctype.value, error_code
|
|
2327
|
+
|
|
2328
|
+
def calkit_manager_calkit_calibration_element_s_parameter_get_s_param_availability(
|
|
2329
|
+
self, selector_string
|
|
2330
|
+
):
|
|
2331
|
+
"""calkit_manager_calkit_calibration_element_s_parameter_get_s_param_availability."""
|
|
2332
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2333
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2334
|
+
s_parameter_availability_ctype = ctypes.c_int32()
|
|
2335
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterGetSParamAvailability(
|
|
2336
|
+
vi_ctype, selector_string_ctype, s_parameter_availability_ctype
|
|
2337
|
+
)
|
|
2338
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2339
|
+
return (
|
|
2340
|
+
enums.CalkitManagerCalkitCalibrationElementSParameterAvailability(
|
|
2341
|
+
s_parameter_availability_ctype.value
|
|
2342
|
+
),
|
|
2343
|
+
error_code,
|
|
2344
|
+
)
|
|
2345
|
+
|
|
2346
|
+
def s_params_fetch_x_data(self, selector_string, timeout):
|
|
2347
|
+
"""s_params_fetch_x_data."""
|
|
2348
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2349
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2350
|
+
timeout_ctype = ctypes.c_double(timeout)
|
|
2351
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2352
|
+
|
|
2353
|
+
# call library function to get the size of array
|
|
2354
|
+
error_code = self._library.RFmxVNA_SParamsFetchXData(
|
|
2355
|
+
vi_ctype, selector_string_ctype, timeout_ctype, None, 0, actual_array_size_ctype
|
|
2356
|
+
)
|
|
2357
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2358
|
+
|
|
2359
|
+
x_ctype = _get_ctypes_pointer_for_buffer(
|
|
2360
|
+
library_type=ctypes.c_double, size=actual_array_size_ctype.value
|
|
2361
|
+
)
|
|
2362
|
+
|
|
2363
|
+
# call library function again to get array
|
|
2364
|
+
error_code = self._library.RFmxVNA_SParamsFetchXData(
|
|
2365
|
+
vi_ctype, selector_string_ctype, timeout_ctype, x_ctype, actual_array_size_ctype, None
|
|
2366
|
+
)
|
|
2367
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2368
|
+
return x_ctype[:], error_code
|
|
2369
|
+
|
|
2370
|
+
def s_params_fetch_y_data(self, selector_string, timeout):
|
|
2371
|
+
"""s_params_fetch_y_data."""
|
|
2372
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2373
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2374
|
+
timeout_ctype = ctypes.c_double(timeout)
|
|
2375
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2376
|
+
|
|
2377
|
+
# call library function to get the size of array
|
|
2378
|
+
error_code = self._library.RFmxVNA_SParamsFetchYData(
|
|
2379
|
+
vi_ctype, selector_string_ctype, timeout_ctype, None, None, 0, actual_array_size_ctype
|
|
2380
|
+
)
|
|
2381
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2382
|
+
|
|
2383
|
+
y1_ctype = _get_ctypes_pointer_for_buffer(
|
|
2384
|
+
library_type=ctypes.c_float, size=actual_array_size_ctype.value
|
|
2385
|
+
)
|
|
2386
|
+
y2_ctype = _get_ctypes_pointer_for_buffer(
|
|
2387
|
+
library_type=ctypes.c_float, size=actual_array_size_ctype.value
|
|
2388
|
+
)
|
|
2389
|
+
|
|
2390
|
+
# call library function again to get array
|
|
2391
|
+
error_code = self._library.RFmxVNA_SParamsFetchYData(
|
|
2392
|
+
vi_ctype,
|
|
2393
|
+
selector_string_ctype,
|
|
2394
|
+
timeout_ctype,
|
|
2395
|
+
y1_ctype,
|
|
2396
|
+
y2_ctype,
|
|
2397
|
+
actual_array_size_ctype,
|
|
2398
|
+
None,
|
|
2399
|
+
)
|
|
2400
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2401
|
+
return y1_ctype[:], y2_ctype[:], error_code
|
|
2402
|
+
|
|
2403
|
+
def waves_fetch_x_data(self, selector_string, timeout):
|
|
2404
|
+
"""waves_fetch_x_data."""
|
|
2405
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2406
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2407
|
+
timeout_ctype = ctypes.c_double(timeout)
|
|
2408
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2409
|
+
|
|
2410
|
+
# call library function to get the size of array
|
|
2411
|
+
error_code = self._library.RFmxVNA_WavesFetchXData(
|
|
2412
|
+
vi_ctype, selector_string_ctype, timeout_ctype, None, 0, actual_array_size_ctype
|
|
2413
|
+
)
|
|
2414
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2415
|
+
|
|
2416
|
+
x_ctype = _get_ctypes_pointer_for_buffer(
|
|
2417
|
+
library_type=ctypes.c_double, size=actual_array_size_ctype.value
|
|
2418
|
+
)
|
|
2419
|
+
|
|
2420
|
+
# call library function again to get array
|
|
2421
|
+
error_code = self._library.RFmxVNA_WavesFetchXData(
|
|
2422
|
+
vi_ctype, selector_string_ctype, timeout_ctype, x_ctype, actual_array_size_ctype, None
|
|
2423
|
+
)
|
|
2424
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2425
|
+
return x_ctype[:], error_code
|
|
2426
|
+
|
|
2427
|
+
def waves_fetch_y_data(self, selector_string, timeout):
|
|
2428
|
+
"""waves_fetch_y_data."""
|
|
2429
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2430
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2431
|
+
timeout_ctype = ctypes.c_double(timeout)
|
|
2432
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2433
|
+
|
|
2434
|
+
# call library function to get the size of array
|
|
2435
|
+
error_code = self._library.RFmxVNA_WavesFetchYData(
|
|
2436
|
+
vi_ctype, selector_string_ctype, timeout_ctype, None, None, 0, actual_array_size_ctype
|
|
2437
|
+
)
|
|
2438
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2439
|
+
|
|
2440
|
+
y1_ctype = _get_ctypes_pointer_for_buffer(
|
|
2441
|
+
library_type=ctypes.c_float, size=actual_array_size_ctype.value
|
|
2442
|
+
)
|
|
2443
|
+
y2_ctype = _get_ctypes_pointer_for_buffer(
|
|
2444
|
+
library_type=ctypes.c_float, size=actual_array_size_ctype.value
|
|
2445
|
+
)
|
|
2446
|
+
|
|
2447
|
+
# call library function again to get array
|
|
2448
|
+
error_code = self._library.RFmxVNA_WavesFetchYData(
|
|
2449
|
+
vi_ctype,
|
|
2450
|
+
selector_string_ctype,
|
|
2451
|
+
timeout_ctype,
|
|
2452
|
+
y1_ctype,
|
|
2453
|
+
y2_ctype,
|
|
2454
|
+
actual_array_size_ctype,
|
|
2455
|
+
None,
|
|
2456
|
+
)
|
|
2457
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2458
|
+
return y1_ctype[:], y2_ctype[:], error_code
|
|
2459
|
+
|
|
2460
|
+
def iq_fetch_data(self, selector_string, timeout, data):
|
|
2461
|
+
"""iq_fetch_data."""
|
|
2462
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2463
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2464
|
+
timeout_ctype = ctypes.c_double(timeout)
|
|
2465
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2466
|
+
|
|
2467
|
+
# call library function to get the size of array
|
|
2468
|
+
error_code = self._library.RFmxVNA_IQFetchData(
|
|
2469
|
+
vi_ctype,
|
|
2470
|
+
selector_string_ctype,
|
|
2471
|
+
timeout_ctype,
|
|
2472
|
+
None,
|
|
2473
|
+
None,
|
|
2474
|
+
None,
|
|
2475
|
+
0,
|
|
2476
|
+
actual_array_size_ctype,
|
|
2477
|
+
)
|
|
2478
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2479
|
+
|
|
2480
|
+
x0_ctype = ctypes.c_double()
|
|
2481
|
+
dx_ctype = ctypes.c_double()
|
|
2482
|
+
_helper.validate_numpy_array(data, "data", "complex64")
|
|
2483
|
+
if len(data) != actual_array_size_ctype.value:
|
|
2484
|
+
data.resize((actual_array_size_ctype.value,), refcheck=False)
|
|
2485
|
+
data_ctype = _get_ctypes_pointer_for_buffer(
|
|
2486
|
+
value=data, library_type=_custom_types.ComplexSingle
|
|
2487
|
+
)
|
|
2488
|
+
|
|
2489
|
+
# call library function again to get array
|
|
2490
|
+
error_code = self._library.RFmxVNA_IQFetchData(
|
|
2491
|
+
vi_ctype,
|
|
2492
|
+
selector_string_ctype,
|
|
2493
|
+
timeout_ctype,
|
|
2494
|
+
x0_ctype,
|
|
2495
|
+
dx_ctype,
|
|
2496
|
+
data_ctype,
|
|
2497
|
+
actual_array_size_ctype,
|
|
2498
|
+
None,
|
|
2499
|
+
)
|
|
2500
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2501
|
+
return x0_ctype.value, dx_ctype.value, error_code
|
|
2502
|
+
|
|
2503
|
+
def calset_get_frequency_grid(self, selector_string, calset_name, error_term_identifier):
|
|
2504
|
+
"""calset_get_frequency_grid."""
|
|
2505
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2506
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2507
|
+
calset_name_ctype = ctypes.create_string_buffer(calset_name.encode(self._encoding))
|
|
2508
|
+
error_term_identifier_ctype = ctypes.c_int32(error_term_identifier)
|
|
2509
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2510
|
+
|
|
2511
|
+
# call library function to get the size of array
|
|
2512
|
+
error_code = self._library.RFmxVNA_CalsetGetFrequencyGrid(
|
|
2513
|
+
vi_ctype,
|
|
2514
|
+
selector_string_ctype,
|
|
2515
|
+
calset_name_ctype,
|
|
2516
|
+
error_term_identifier_ctype,
|
|
2517
|
+
None,
|
|
2518
|
+
0,
|
|
2519
|
+
actual_array_size_ctype,
|
|
2520
|
+
)
|
|
2521
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2522
|
+
|
|
2523
|
+
frequency_grid_ctype = _get_ctypes_pointer_for_buffer(
|
|
2524
|
+
library_type=ctypes.c_double, size=actual_array_size_ctype.value
|
|
2525
|
+
)
|
|
2526
|
+
|
|
2527
|
+
# call library function again to get array
|
|
2528
|
+
error_code = self._library.RFmxVNA_CalsetGetFrequencyGrid(
|
|
2529
|
+
vi_ctype,
|
|
2530
|
+
selector_string_ctype,
|
|
2531
|
+
calset_name_ctype,
|
|
2532
|
+
error_term_identifier_ctype,
|
|
2533
|
+
frequency_grid_ctype,
|
|
2534
|
+
actual_array_size_ctype,
|
|
2535
|
+
None,
|
|
2536
|
+
)
|
|
2537
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2538
|
+
return frequency_grid_ctype[:], error_code
|
|
2539
|
+
|
|
2540
|
+
def calset_get_error_term(
|
|
2541
|
+
self,
|
|
2542
|
+
selector_string,
|
|
2543
|
+
calset_name,
|
|
2544
|
+
error_term_identifier,
|
|
2545
|
+
measurement_port,
|
|
2546
|
+
source_port,
|
|
2547
|
+
error_term,
|
|
2548
|
+
):
|
|
2549
|
+
"""calset_get_error_term."""
|
|
2550
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2551
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2552
|
+
calset_name_ctype = ctypes.create_string_buffer(calset_name.encode(self._encoding))
|
|
2553
|
+
error_term_identifier_ctype = ctypes.c_int32(error_term_identifier)
|
|
2554
|
+
measurement_port_ctype = ctypes.create_string_buffer(
|
|
2555
|
+
measurement_port.encode(self._encoding)
|
|
2556
|
+
)
|
|
2557
|
+
source_port_ctype = ctypes.create_string_buffer(source_port.encode(self._encoding))
|
|
2558
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2559
|
+
|
|
2560
|
+
# call library function to get the size of array
|
|
2561
|
+
error_code = self._library.RFmxVNA_CalsetGetErrorTerm(
|
|
2562
|
+
vi_ctype,
|
|
2563
|
+
selector_string_ctype,
|
|
2564
|
+
calset_name_ctype,
|
|
2565
|
+
error_term_identifier_ctype,
|
|
2566
|
+
measurement_port_ctype,
|
|
2567
|
+
source_port_ctype,
|
|
2568
|
+
None,
|
|
2569
|
+
0,
|
|
2570
|
+
actual_array_size_ctype,
|
|
2571
|
+
)
|
|
2572
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2573
|
+
|
|
2574
|
+
_helper.validate_numpy_array(error_term, "error_term", "complex64")
|
|
2575
|
+
if len(error_term) != actual_array_size_ctype.value:
|
|
2576
|
+
error_term.resize((actual_array_size_ctype.value,), refcheck=False)
|
|
2577
|
+
error_term_ctype = _get_ctypes_pointer_for_buffer(
|
|
2578
|
+
value=error_term, library_type=_custom_types.ComplexSingle
|
|
2579
|
+
)
|
|
2580
|
+
|
|
2581
|
+
# call library function again to get array
|
|
2582
|
+
error_code = self._library.RFmxVNA_CalsetGetErrorTerm(
|
|
2583
|
+
vi_ctype,
|
|
2584
|
+
selector_string_ctype,
|
|
2585
|
+
calset_name_ctype,
|
|
2586
|
+
error_term_identifier_ctype,
|
|
2587
|
+
measurement_port_ctype,
|
|
2588
|
+
source_port_ctype,
|
|
2589
|
+
error_term_ctype,
|
|
2590
|
+
actual_array_size_ctype,
|
|
2591
|
+
None,
|
|
2592
|
+
)
|
|
2593
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2594
|
+
return error_code
|
|
2595
|
+
|
|
2596
|
+
def get_measurement_memory_x_data(self, selector_string):
|
|
2597
|
+
"""get_measurement_memory_x_data."""
|
|
2598
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2599
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2600
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2601
|
+
|
|
2602
|
+
# call library function to get the size of array
|
|
2603
|
+
error_code = self._library.RFmxVNA_GetMeasurementMemoryXData(
|
|
2604
|
+
vi_ctype, selector_string_ctype, None, 0, actual_array_size_ctype
|
|
2605
|
+
)
|
|
2606
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2607
|
+
|
|
2608
|
+
measurement_memory_x_ctype = _get_ctypes_pointer_for_buffer(
|
|
2609
|
+
library_type=ctypes.c_double, size=actual_array_size_ctype.value
|
|
2610
|
+
)
|
|
2611
|
+
|
|
2612
|
+
# call library function again to get array
|
|
2613
|
+
error_code = self._library.RFmxVNA_GetMeasurementMemoryXData(
|
|
2614
|
+
vi_ctype,
|
|
2615
|
+
selector_string_ctype,
|
|
2616
|
+
measurement_memory_x_ctype,
|
|
2617
|
+
actual_array_size_ctype,
|
|
2618
|
+
None,
|
|
2619
|
+
)
|
|
2620
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2621
|
+
return measurement_memory_x_ctype[:], error_code
|
|
2622
|
+
|
|
2623
|
+
def get_measurement_memory_y_data(self, selector_string):
|
|
2624
|
+
"""get_measurement_memory_y_data."""
|
|
2625
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2626
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2627
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2628
|
+
|
|
2629
|
+
# call library function to get the size of array
|
|
2630
|
+
error_code = self._library.RFmxVNA_GetMeasurementMemoryYData(
|
|
2631
|
+
vi_ctype, selector_string_ctype, None, None, 0, actual_array_size_ctype
|
|
2632
|
+
)
|
|
2633
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2634
|
+
|
|
2635
|
+
measurement_memory_y1_ctype = _get_ctypes_pointer_for_buffer(
|
|
2636
|
+
library_type=ctypes.c_float, size=actual_array_size_ctype.value
|
|
2637
|
+
)
|
|
2638
|
+
measurement_memory_y2_ctype = _get_ctypes_pointer_for_buffer(
|
|
2639
|
+
library_type=ctypes.c_float, size=actual_array_size_ctype.value
|
|
2640
|
+
)
|
|
2641
|
+
|
|
2642
|
+
# call library function again to get array
|
|
2643
|
+
error_code = self._library.RFmxVNA_GetMeasurementMemoryYData(
|
|
2644
|
+
vi_ctype,
|
|
2645
|
+
selector_string_ctype,
|
|
2646
|
+
measurement_memory_y1_ctype,
|
|
2647
|
+
measurement_memory_y2_ctype,
|
|
2648
|
+
actual_array_size_ctype,
|
|
2649
|
+
None,
|
|
2650
|
+
)
|
|
2651
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2652
|
+
return measurement_memory_y1_ctype[:], measurement_memory_y2_ctype[:], error_code
|
|
2653
|
+
|
|
2654
|
+
def calkit_manager_calkit_calibration_element_get_types(self, selector_string):
|
|
2655
|
+
"""calkit_manager_calkit_calibration_element_get_types."""
|
|
2656
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2657
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2658
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2659
|
+
|
|
2660
|
+
# call library function to get the size of array
|
|
2661
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementGetTypes(
|
|
2662
|
+
vi_ctype, selector_string_ctype, None, 0, actual_array_size_ctype
|
|
2663
|
+
)
|
|
2664
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2665
|
+
|
|
2666
|
+
calibration_element_types_ctype = _get_ctypes_pointer_for_buffer(
|
|
2667
|
+
library_type=ctypes.c_int32, size=actual_array_size_ctype.value
|
|
2668
|
+
)
|
|
2669
|
+
|
|
2670
|
+
# call library function again to get array
|
|
2671
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementGetTypes(
|
|
2672
|
+
vi_ctype,
|
|
2673
|
+
selector_string_ctype,
|
|
2674
|
+
calibration_element_types_ctype,
|
|
2675
|
+
actual_array_size_ctype,
|
|
2676
|
+
None,
|
|
2677
|
+
)
|
|
2678
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2679
|
+
return [
|
|
2680
|
+
enums.CalkitManagerCalkitCalibrationElementType(value)
|
|
2681
|
+
for value in calibration_element_types_ctype
|
|
2682
|
+
], error_code
|
|
2683
|
+
|
|
2684
|
+
def calkit_manager_calkit_calibration_element_s_parameter_get_frequency(self, selector_string):
|
|
2685
|
+
"""calkit_manager_calkit_calibration_element_s_parameter_get_frequency."""
|
|
2686
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2687
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2688
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2689
|
+
|
|
2690
|
+
# call library function to get the size of array
|
|
2691
|
+
error_code = (
|
|
2692
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterGetFrequency(
|
|
2693
|
+
vi_ctype, selector_string_ctype, None, 0, actual_array_size_ctype
|
|
2694
|
+
)
|
|
2695
|
+
)
|
|
2696
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2697
|
+
|
|
2698
|
+
frequency_ctype = _get_ctypes_pointer_for_buffer(
|
|
2699
|
+
library_type=ctypes.c_double, size=actual_array_size_ctype.value
|
|
2700
|
+
)
|
|
2701
|
+
|
|
2702
|
+
# call library function again to get array
|
|
2703
|
+
error_code = (
|
|
2704
|
+
self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterGetFrequency(
|
|
2705
|
+
vi_ctype, selector_string_ctype, frequency_ctype, actual_array_size_ctype, None
|
|
2706
|
+
)
|
|
2707
|
+
)
|
|
2708
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2709
|
+
return frequency_ctype[:], error_code
|
|
2710
|
+
|
|
2711
|
+
def calkit_manager_calkit_calibration_element_s_parameter_get_s11(self, selector_string, s11):
|
|
2712
|
+
"""calkit_manager_calkit_calibration_element_s_parameter_get_s11."""
|
|
2713
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2714
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2715
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2716
|
+
|
|
2717
|
+
# call library function to get the size of array
|
|
2718
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterGetS11(
|
|
2719
|
+
vi_ctype, selector_string_ctype, None, 0, actual_array_size_ctype
|
|
2720
|
+
)
|
|
2721
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2722
|
+
|
|
2723
|
+
_helper.validate_numpy_array(s11, "s11", "complex128")
|
|
2724
|
+
if len(s11) != actual_array_size_ctype.value:
|
|
2725
|
+
s11.resize((actual_array_size_ctype.value,), refcheck=False)
|
|
2726
|
+
s11_ctype = _get_ctypes_pointer_for_buffer(
|
|
2727
|
+
value=s11, library_type=_custom_types.ComplexDouble
|
|
2728
|
+
)
|
|
2729
|
+
|
|
2730
|
+
# call library function again to get array
|
|
2731
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterGetS11(
|
|
2732
|
+
vi_ctype, selector_string_ctype, s11_ctype, actual_array_size_ctype, None
|
|
2733
|
+
)
|
|
2734
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2735
|
+
return error_code
|
|
2736
|
+
|
|
2737
|
+
def calkit_manager_calkit_calibration_element_s_parameter_get_s12(self, selector_string, s12):
|
|
2738
|
+
"""calkit_manager_calkit_calibration_element_s_parameter_get_s12."""
|
|
2739
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2740
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2741
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2742
|
+
|
|
2743
|
+
# call library function to get the size of array
|
|
2744
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterGetS12(
|
|
2745
|
+
vi_ctype, selector_string_ctype, None, 0, actual_array_size_ctype
|
|
2746
|
+
)
|
|
2747
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2748
|
+
|
|
2749
|
+
_helper.validate_numpy_array(s12, "s12", "complex128")
|
|
2750
|
+
if len(s12) != actual_array_size_ctype.value:
|
|
2751
|
+
s12.resize((actual_array_size_ctype.value,), refcheck=False)
|
|
2752
|
+
s12_ctype = _get_ctypes_pointer_for_buffer(
|
|
2753
|
+
value=s12, library_type=_custom_types.ComplexDouble
|
|
2754
|
+
)
|
|
2755
|
+
|
|
2756
|
+
# call library function again to get array
|
|
2757
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterGetS12(
|
|
2758
|
+
vi_ctype, selector_string_ctype, s12_ctype, actual_array_size_ctype, None
|
|
2759
|
+
)
|
|
2760
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2761
|
+
return error_code
|
|
2762
|
+
|
|
2763
|
+
def calkit_manager_calkit_calibration_element_s_parameter_get_s21(self, selector_string, s21):
|
|
2764
|
+
"""calkit_manager_calkit_calibration_element_s_parameter_get_s21."""
|
|
2765
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2766
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2767
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2768
|
+
|
|
2769
|
+
# call library function to get the size of array
|
|
2770
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterGetS21(
|
|
2771
|
+
vi_ctype, selector_string_ctype, None, 0, actual_array_size_ctype
|
|
2772
|
+
)
|
|
2773
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2774
|
+
|
|
2775
|
+
_helper.validate_numpy_array(s21, "s21", "complex128")
|
|
2776
|
+
if len(s21) != actual_array_size_ctype.value:
|
|
2777
|
+
s21.resize((actual_array_size_ctype.value,), refcheck=False)
|
|
2778
|
+
s21_ctype = _get_ctypes_pointer_for_buffer(
|
|
2779
|
+
value=s21, library_type=_custom_types.ComplexDouble
|
|
2780
|
+
)
|
|
2781
|
+
|
|
2782
|
+
# call library function again to get array
|
|
2783
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterGetS21(
|
|
2784
|
+
vi_ctype, selector_string_ctype, s21_ctype, actual_array_size_ctype, None
|
|
2785
|
+
)
|
|
2786
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2787
|
+
return error_code
|
|
2788
|
+
|
|
2789
|
+
def calkit_manager_calkit_calibration_element_s_parameter_get_s22(self, selector_string, s22):
|
|
2790
|
+
"""calkit_manager_calkit_calibration_element_s_parameter_get_s22."""
|
|
2791
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2792
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2793
|
+
actual_array_size_ctype = ctypes.c_int32(0)
|
|
2794
|
+
|
|
2795
|
+
# call library function to get the size of array
|
|
2796
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterGetS22(
|
|
2797
|
+
vi_ctype, selector_string_ctype, None, 0, actual_array_size_ctype
|
|
2798
|
+
)
|
|
2799
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2800
|
+
|
|
2801
|
+
_helper.validate_numpy_array(s22, "s22", "complex128")
|
|
2802
|
+
if len(s22) != actual_array_size_ctype.value:
|
|
2803
|
+
s22.resize((actual_array_size_ctype.value,), refcheck=False)
|
|
2804
|
+
s22_ctype = _get_ctypes_pointer_for_buffer(
|
|
2805
|
+
value=s22, library_type=_custom_types.ComplexDouble
|
|
2806
|
+
)
|
|
2807
|
+
|
|
2808
|
+
# call library function again to get array
|
|
2809
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSParameterGetS22(
|
|
2810
|
+
vi_ctype, selector_string_ctype, s22_ctype, actual_array_size_ctype, None
|
|
2811
|
+
)
|
|
2812
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2813
|
+
return error_code
|
|
2814
|
+
|
|
2815
|
+
def clone_signal_configuration(self, old_signal_name, new_signal_name):
|
|
2816
|
+
"""clone_signal_configuration."""
|
|
2817
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2818
|
+
old_signal_name_ctype = ctypes.create_string_buffer(old_signal_name.encode(self._encoding))
|
|
2819
|
+
new_signal_name_ctype = ctypes.create_string_buffer(new_signal_name.encode(self._encoding))
|
|
2820
|
+
error_code = self._library.RFmxVNA_CloneSignalConfiguration(
|
|
2821
|
+
vi_ctype, old_signal_name_ctype, new_signal_name_ctype
|
|
2822
|
+
)
|
|
2823
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2824
|
+
|
|
2825
|
+
import nirfmxvna
|
|
2826
|
+
|
|
2827
|
+
signal_configuration = (
|
|
2828
|
+
nirfmxvna._VnaSignalConfiguration.get_vna_signal_configuration( # type: ignore
|
|
2829
|
+
self._instr_session, new_signal_name, True
|
|
2830
|
+
)
|
|
2831
|
+
)
|
|
2832
|
+
return signal_configuration, error_code
|
|
2833
|
+
|
|
2834
|
+
def delete_signal_configuration(self, ignore_driver_error):
|
|
2835
|
+
"""delete_signal_configuration."""
|
|
2836
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2837
|
+
signal_name_ctype = ctypes.create_string_buffer(
|
|
2838
|
+
self._signal_obj.signal_configuration_name.encode(self._encoding)
|
|
2839
|
+
)
|
|
2840
|
+
error_code = self._library.RFmxVNA_DeleteSignalConfiguration(vi_ctype, signal_name_ctype)
|
|
2841
|
+
if not ignore_driver_error:
|
|
2842
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2843
|
+
return error_code
|
|
2844
|
+
|
|
2845
|
+
def send_software_edge_trigger(self):
|
|
2846
|
+
"""send_software_edge_trigger."""
|
|
2847
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2848
|
+
error_code = self._library.RFmxVNA_SendSoftwareEdgeTrigger(vi_ctype)
|
|
2849
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2850
|
+
return error_code
|
|
2851
|
+
|
|
2852
|
+
def get_all_named_result_names(self, selector_string):
|
|
2853
|
+
"""get_all_named_result_names."""
|
|
2854
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2855
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2856
|
+
actual_result_names_size_ctype = ctypes.c_int32(0)
|
|
2857
|
+
default_result_exists_ctype = ctypes.c_int32()
|
|
2858
|
+
|
|
2859
|
+
# call library function to get the size of array
|
|
2860
|
+
error_code = self._library.RFmxVNA_GetAllNamedResultNames(
|
|
2861
|
+
vi_ctype,
|
|
2862
|
+
selector_string_ctype,
|
|
2863
|
+
None,
|
|
2864
|
+
0,
|
|
2865
|
+
actual_result_names_size_ctype,
|
|
2866
|
+
default_result_exists_ctype,
|
|
2867
|
+
)
|
|
2868
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2869
|
+
|
|
2870
|
+
result_names_ctype = (ctypes.c_char * actual_result_names_size_ctype.value)()
|
|
2871
|
+
|
|
2872
|
+
# call library function again to get array
|
|
2873
|
+
error_code = self._library.RFmxVNA_GetAllNamedResultNames(
|
|
2874
|
+
vi_ctype,
|
|
2875
|
+
selector_string_ctype,
|
|
2876
|
+
result_names_ctype,
|
|
2877
|
+
actual_result_names_size_ctype,
|
|
2878
|
+
None,
|
|
2879
|
+
default_result_exists_ctype,
|
|
2880
|
+
)
|
|
2881
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2882
|
+
|
|
2883
|
+
return (
|
|
2884
|
+
_helper.split_string_by_comma(result_names_ctype.value.decode(self._encoding)),
|
|
2885
|
+
default_result_exists_ctype.value,
|
|
2886
|
+
error_code,
|
|
2887
|
+
)
|
|
2888
|
+
|
|
2889
|
+
def calkit_manager_calkit_get_description(self, selector_string):
|
|
2890
|
+
"""calkit_manager_calkit_get_description."""
|
|
2891
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2892
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2893
|
+
calkit_description_ctype = ctypes.create_string_buffer(0)
|
|
2894
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitGetDescription(
|
|
2895
|
+
vi_ctype, selector_string_ctype, 0, None
|
|
2896
|
+
)
|
|
2897
|
+
if error_code > 0:
|
|
2898
|
+
calkit_description_ctype = ctypes.create_string_buffer(error_code)
|
|
2899
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitGetDescription(
|
|
2900
|
+
vi_ctype, selector_string_ctype, error_code, calkit_description_ctype
|
|
2901
|
+
)
|
|
2902
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2903
|
+
return calkit_description_ctype.value.decode(self._encoding), error_code
|
|
2904
|
+
|
|
2905
|
+
def calkit_manager_calkit_get_version(self, selector_string):
|
|
2906
|
+
"""calkit_manager_calkit_get_version."""
|
|
2907
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2908
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2909
|
+
calkit_version_ctype = ctypes.create_string_buffer(0)
|
|
2910
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitGetVersion(
|
|
2911
|
+
vi_ctype, selector_string_ctype, 0, None
|
|
2912
|
+
)
|
|
2913
|
+
if error_code > 0:
|
|
2914
|
+
calkit_version_ctype = ctypes.create_string_buffer(error_code)
|
|
2915
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitGetVersion(
|
|
2916
|
+
vi_ctype, selector_string_ctype, error_code, calkit_version_ctype
|
|
2917
|
+
)
|
|
2918
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2919
|
+
return calkit_version_ctype.value.decode(self._encoding), error_code
|
|
2920
|
+
|
|
2921
|
+
def calkit_manager_calkit_connector_get_description(self, selector_string):
|
|
2922
|
+
"""calkit_manager_calkit_connector_get_description."""
|
|
2923
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2924
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2925
|
+
description_ctype = ctypes.create_string_buffer(0)
|
|
2926
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorGetDescription(
|
|
2927
|
+
vi_ctype, selector_string_ctype, 0, None
|
|
2928
|
+
)
|
|
2929
|
+
if error_code > 0:
|
|
2930
|
+
description_ctype = ctypes.create_string_buffer(error_code)
|
|
2931
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorGetDescription(
|
|
2932
|
+
vi_ctype, selector_string_ctype, error_code, description_ctype
|
|
2933
|
+
)
|
|
2934
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2935
|
+
return description_ctype.value.decode(self._encoding), error_code
|
|
2936
|
+
|
|
2937
|
+
def calkit_manager_calkit_connector_get_type(self, selector_string):
|
|
2938
|
+
"""calkit_manager_calkit_connector_get_type."""
|
|
2939
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2940
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2941
|
+
connector_type_ctype = ctypes.create_string_buffer(0)
|
|
2942
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorGetType(
|
|
2943
|
+
vi_ctype, selector_string_ctype, 0, None
|
|
2944
|
+
)
|
|
2945
|
+
if error_code > 0:
|
|
2946
|
+
connector_type_ctype = ctypes.create_string_buffer(error_code)
|
|
2947
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitConnectorGetType(
|
|
2948
|
+
vi_ctype, selector_string_ctype, error_code, connector_type_ctype
|
|
2949
|
+
)
|
|
2950
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2951
|
+
return connector_type_ctype.value.decode(self._encoding), error_code
|
|
2952
|
+
|
|
2953
|
+
def calkit_manager_calkit_calibration_element_get_description(self, selector_string):
|
|
2954
|
+
"""calkit_manager_calkit_calibration_element_get_description."""
|
|
2955
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2956
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2957
|
+
description_ctype = ctypes.create_string_buffer(0)
|
|
2958
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementGetDescription(
|
|
2959
|
+
vi_ctype, selector_string_ctype, 0, None
|
|
2960
|
+
)
|
|
2961
|
+
if error_code > 0:
|
|
2962
|
+
description_ctype = ctypes.create_string_buffer(error_code)
|
|
2963
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementGetDescription(
|
|
2964
|
+
vi_ctype, selector_string_ctype, error_code, description_ctype
|
|
2965
|
+
)
|
|
2966
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2967
|
+
return description_ctype.value.decode(self._encoding), error_code
|
|
2968
|
+
|
|
2969
|
+
def calkit_manager_calkit_calibration_element_set_port_connectors(
|
|
2970
|
+
self, selector_string, connector_ids
|
|
2971
|
+
):
|
|
2972
|
+
"""calkit_manager_calkit_calibration_element_set_port_connectors."""
|
|
2973
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2974
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2975
|
+
connector_ids_ctype = ctypes.create_string_buffer(connector_ids.encode(self._encoding))
|
|
2976
|
+
array_size_ctype = ctypes.c_int32(len(connector_ids) if connector_ids is not None else 0)
|
|
2977
|
+
error_code = self._library.RFmxVNA_CalkitManagerCalkitCalibrationElementSetPortConnectors(
|
|
2978
|
+
vi_ctype, selector_string_ctype, connector_ids_ctype, array_size_ctype
|
|
2979
|
+
)
|
|
2980
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2981
|
+
return error_code
|
|
2982
|
+
|
|
2983
|
+
def get_s_parameter(self, selector_string):
|
|
2984
|
+
"""get_s_parameter."""
|
|
2985
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
2986
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
2987
|
+
s_parameter_ctype = ctypes.create_string_buffer(0)
|
|
2988
|
+
error_code = self._library.RFmxVNA_SParamsGetSParameter(
|
|
2989
|
+
vi_ctype, selector_string_ctype, 0, None
|
|
2990
|
+
)
|
|
2991
|
+
if error_code > 0:
|
|
2992
|
+
s_parameter_ctype = ctypes.create_string_buffer(error_code)
|
|
2993
|
+
error_code = self._library.RFmxVNA_SParamsGetSParameter(
|
|
2994
|
+
vi_ctype, selector_string_ctype, error_code, s_parameter_ctype
|
|
2995
|
+
)
|
|
2996
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
2997
|
+
return s_parameter_ctype.value.decode(self._encoding), error_code
|
|
2998
|
+
|
|
2999
|
+
def get_wave(self, selector_string):
|
|
3000
|
+
"""get_wave."""
|
|
3001
|
+
vi_ctype = ctypes.c_uint32(self._vi)
|
|
3002
|
+
selector_string_ctype = ctypes.create_string_buffer(selector_string.encode(self._encoding))
|
|
3003
|
+
wave_ctype = ctypes.create_string_buffer(0)
|
|
3004
|
+
error_code = self._library.RFmxVNA_WavesGetWave(vi_ctype, selector_string_ctype, 0, None)
|
|
3005
|
+
if error_code > 0:
|
|
3006
|
+
wave_ctype = ctypes.create_string_buffer(error_code)
|
|
3007
|
+
error_code = self._library.RFmxVNA_WavesGetWave(
|
|
3008
|
+
vi_ctype, selector_string_ctype, error_code, wave_ctype
|
|
3009
|
+
)
|
|
3010
|
+
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
|
|
3011
|
+
return wave_ctype.value.decode(self._encoding), error_code
|