Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,7 @@
- Changed `interpolation_delay` and `relative_delay` properties to be of type hightime.timedelta, so that it aligns with _delay_ attributes across other APIs in the repository
- Changed `exported_ref_clock_rate` and `ref_clock_rate` properties to be of type float instead of enum, since the enums just represented raw float values
- Fixed the return type of `get_all_script_names` and `get_all_named_waveform_names` to remove the size parameter and return a list of strings instead of a comma-separated string
- Updated `external_calibration_recommended_interval` property to return a hightime.timedelta object instead of months as an int, aligning with other APIs in the repository
- Updated `self_test` to not have any parameters, aligning with other APIs in the repository
- Updated `wait_until_settled` method to have `max_time_milliseconds` parameter as type hightime.timedelta with a default value of 10 seconds
- Updated below properties and method parameters to be of string enum type instead of plain string, since they would support only fixed set of strings
Expand All @@ -1710,6 +1711,12 @@
- `arb_sample_clock_source`
- `ref_clock_source`
- `trigger_identifier` parameter in `send_software_edge_trigger` method
- Updated below properties to be of list of strings type instead of them returning a comma separated list of string values
Comment thread
vnktshr21 marked this conversation as resolved.
Outdated
- `available_paths`
- `available_ports`
- `fixed_group_delay_across_ports`
- `group_capabilities`
- `supported_instrument_models`
- Removed
- Methods and properties applicable only to hardware which are not supported anymore
- Methods
Expand Down
110 changes: 54 additions & 56 deletions docs/nirfsg/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3892,15 +3892,15 @@ available_paths

The following table lists the characteristics of this property.

+-----------------------+-----------+
| Characteristic | Value |
+=======================+===========+
| Datatype | str |
+-----------------------+-----------+
| Permissions | read only |
+-----------------------+-----------+
| Repeated Capabilities | None |
+-----------------------+-----------+
+-----------------------+-------------+
| Characteristic | Value |
+=======================+=============+
| Datatype | list of str |
+-----------------------+-------------+
| Permissions | read only |
+-----------------------+-------------+
| Repeated Capabilities | None |
+-----------------------+-------------+

.. tip::
This property corresponds to the following LabVIEW Property or C Attribute:
Expand All @@ -3919,15 +3919,15 @@ available_ports

The following table lists the characteristics of this property.

+-----------------------+-----------+
| Characteristic | Value |
+=======================+===========+
| Datatype | str |
+-----------------------+-----------+
| Permissions | read only |
+-----------------------+-----------+
| Repeated Capabilities | None |
+-----------------------+-----------+
+-----------------------+-------------+
| Characteristic | Value |
+=======================+=============+
| Datatype | list of str |
+-----------------------+-------------+
| Permissions | read only |
+-----------------------+-------------+
| Repeated Capabilities | None |
+-----------------------+-------------+

.. tip::
This property corresponds to the following LabVIEW Property or C Attribute:
Expand Down Expand Up @@ -5629,21 +5629,19 @@ external_calibration_recommended_interval

Returns the recommended interval between each external calibration of the device.

**Units**: months

**Supported Devices:** PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860

The following table lists the characteristics of this property.

+-----------------------+-----------+
| Characteristic | Value |
+=======================+===========+
| Datatype | int |
+-----------------------+-----------+
| Permissions | read only |
+-----------------------+-----------+
| Repeated Capabilities | None |
+-----------------------+-----------+
+-----------------------+--------------------+
| Characteristic | Value |
+=======================+====================+
| Datatype | hightime.timedelta |
+-----------------------+--------------------+
| Permissions | read only |
+-----------------------+--------------------+
| Repeated Capabilities | None |
+-----------------------+--------------------+

.. tip::
This property corresponds to the following LabVIEW Property or C Attribute:
Expand Down Expand Up @@ -5772,15 +5770,15 @@ fixed_group_delay_across_ports

The following table lists the characteristics of this property.

+-----------------------+------------+
| Characteristic | Value |
+=======================+============+
| Datatype | str |
+-----------------------+------------+
| Permissions | read-write |
+-----------------------+------------+
| Repeated Capabilities | None |
+-----------------------+------------+
+-----------------------+-------------+
| Characteristic | Value |
+=======================+=============+
| Datatype | list of str |
+-----------------------+-------------+
| Permissions | read-write |
+-----------------------+-------------+
| Repeated Capabilities | None |
+-----------------------+-------------+

.. tip::
This property corresponds to the following LabVIEW Property or C Attribute:
Expand Down Expand Up @@ -6099,15 +6097,15 @@ group_capabilities

The following table lists the characteristics of this property.

+-----------------------+-----------+
| Characteristic | Value |
+=======================+===========+
| Datatype | str |
+-----------------------+-----------+
| Permissions | read only |
+-----------------------+-----------+
| Repeated Capabilities | None |
+-----------------------+-----------+
+-----------------------+-------------+
| Characteristic | Value |
+=======================+=============+
| Datatype | list of str |
+-----------------------+-------------+
| Permissions | read only |
+-----------------------+-------------+
| Repeated Capabilities | None |
+-----------------------+-------------+

.. tip::
This property corresponds to the following LabVIEW Property or C Attribute:
Expand Down Expand Up @@ -9798,15 +9796,15 @@ supported_instrument_models

The following table lists the characteristics of this property.

+-----------------------+-----------+
| Characteristic | Value |
+=======================+===========+
| Datatype | str |
+-----------------------+-----------+
| Permissions | read only |
+-----------------------+-----------+
| Repeated Capabilities | None |
+-----------------------+-----------+
+-----------------------+-------------+
| Characteristic | Value |
+=======================+=============+
| Datatype | list of str |
+-----------------------+-------------+
| Permissions | read only |
+-----------------------+-------------+
| Repeated Capabilities | None |
+-----------------------+-------------+

.. tip::
This property corresponds to the following LabVIEW Property or C Attribute:
Expand Down
26 changes: 12 additions & 14 deletions generated/nirfsg/nirfsg/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,13 +727,13 @@ class _SessionBase(object):
Note:
One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed.
'''
available_paths = _attributes.AttributeViString(1150312)
'''Type: str
available_paths = _attributes.AttributeViStringCommaSeparated(1150312)
'''Type: list of str

Returns a comma separated list of the configurable paths available for use based on your instrument configuration.
'''
available_ports = _attributes.AttributeViString(1150249)
'''Type: str
available_ports = _attributes.AttributeViStringCommaSeparated(1150249)
'''Type: list of str

Returns a comma-separated list of the ports available for use based on your instrument configuration.

Expand Down Expand Up @@ -1882,13 +1882,11 @@ class _SessionBase(object):
| "DIO/PFI7" | The trigger is received on PFI7 from the front panel DIO terminal. |
+----------------+----------------------------------------------------------------------------------------------------------------------------------------+
'''
external_calibration_recommended_interval = _attributes.AttributeViInt32(1150076)
'''Type: int
external_calibration_recommended_interval = _attributes.AttributeViInt32TimeDeltaMonths(1150076)
'''Type: hightime.timedelta

Returns the recommended interval between each external calibration of the device.

**Units**: months

**Supported Devices:** PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860
'''
external_calibration_temperature = _attributes.AttributeViReal64(1150077)
Expand Down Expand Up @@ -1938,8 +1936,8 @@ class _SessionBase(object):
| False | The RF signal generator has the 1 ms tuning option. |
+-------+------------------------------------------------------------+
'''
fixed_group_delay_across_ports = _attributes.AttributeViString(1150271)
'''Type: str
fixed_group_delay_across_ports = _attributes.AttributeViStringCommaSeparated(1150271)
'''Type: list of str

Specifies a comma-separated list of ports for which to fix the group delay.

Expand Down Expand Up @@ -2103,8 +2101,8 @@ class _SessionBase(object):
| GenerationMode.SCRIPT | 1002 (0x3ea) | Configures the RF signal generator to generate arbitrary waveforms as directed by the selected_script property.. |
+-----------------------------+--------------+------------------------------------------------------------------------------------------------------------------------+
'''
group_capabilities = _attributes.AttributeViString(1050401)
'''Type: str
group_capabilities = _attributes.AttributeViStringCommaSeparated(1050401)
'''Type: list of str

Returns a string that contains a comma-separated list of class-extension groups that NI-RFSG implements.

Expand Down Expand Up @@ -4098,8 +4096,8 @@ class _SessionBase(object):

`Streaming Waveform Data <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/streaming_waveform_data.html>`_
'''
supported_instrument_models = _attributes.AttributeViString(1050327)
'''Type: str
supported_instrument_models = _attributes.AttributeViStringCommaSeparated(1050327)
'''Type: list of str

Returns a string that contains a model code of the NI-RFSG device. For drivers that support more than one device, this property contains a comma-separated list of supported devices.

Expand Down
26 changes: 19 additions & 7 deletions src/nirfsg/metadata/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,27 @@
},
1050327: {
'access': 'read only',
'attribute_class': 'AttributeViStringCommaSeparated',
'codegen_method': 'public',
'documentation': {
'description': 'Returns a string that contains a model code of the NI-RFSG device. For drivers that support more than one device, this attribute contains a comma-separated list of supported devices.\n\n**Supported Devices:** PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860'
},
'lv_property': 'Inherent IVI Attributes:Driver Capabilities:Supported Instrument Models',
'name': 'SUPPORTED_INSTRUMENT_MODELS',
'type': 'ViString'
'type': 'ViString',
'type_in_documentation': 'list of str'
},
1050401: {
'access': 'read only',
'attribute_class': 'AttributeViStringCommaSeparated',
'codegen_method': 'public',
'documentation': {
'description': 'Returns a string that contains a comma-separated list of class-extension groups that NI-RFSG implements.\n\n**Supported Devices:** PXI-5610, PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860'
},
'lv_property': 'Inherent IVI Attributes:Driver Capabilities:Class Group Capabilities',
'name': 'GROUP_CAPABILITIES',
'type': 'ViString'
'type': 'ViString',
'type_in_documentation': 'list of str'
},
1050510: {
'access': 'read only',
Expand Down Expand Up @@ -1864,13 +1868,15 @@
},
1150076: {
'access': 'read only',
'attribute_class': 'AttributeViInt32TimeDeltaMonths',
'codegen_method': 'public',
'documentation': {
'description': 'Returns the recommended interval between each external calibration of the device.\n\n**Units**: months\n\n**Supported Devices:** PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860'
'description': 'Returns the recommended interval between each external calibration of the device.\n\n**Supported Devices:** PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860'
},
'lv_property': 'External Calibration:Recommended Interval',
'name': 'EXTERNAL_CALIBRATION_RECOMMENDED_INTERVAL',
'type': 'ViInt32'
'type': 'ViInt32',
'type_in_documentation': 'hightime.timedelta'
},
1150077: {
'access': 'read only',
Expand Down Expand Up @@ -3330,13 +3336,15 @@
},
1150249: {
'access': 'read only',
'attribute_class': 'AttributeViStringCommaSeparated',
'codegen_method': 'public',
'documentation': {
'description': 'Returns a comma-separated list of the ports available for use based on your instrument configuration.\n\n**Supported Devices**: PXIe-5644/5645/5646, PXIe-5820/5830/5831/5832/5840/5841/5842/5860'
},
'lv_property': 'Device Specific:Vector Signal Transceiver:Signal Path:Available Ports',
'name': 'AVAILABLE_PORTS',
'type': 'ViString'
'type': 'ViString',
'type_in_documentation': 'list of str'
},
1150251: {
'access': 'read only',
Expand Down Expand Up @@ -3471,13 +3479,15 @@
},
1150271: {
'access': 'read-write',
'attribute_class': 'AttributeViStringCommaSeparated',
'codegen_method': 'public',
'documentation': {
'description': 'Specifies a comma-separated list of ports for which to fix the group delay.\n\n\n**Supported Devices:** PXIe-5831/5832'
Comment thread
vnktshr21 marked this conversation as resolved.
Outdated
},
'lv_property': 'Device Specific:Vector Signal Transceiver:Signal Path:Fixed Group Delay Across Ports',
'name': 'FIXED_GROUP_DELAY_ACROSS_PORTS',
'type': 'ViString'
'type': 'ViString',
'type_in_documentation': 'list of str'
Comment thread
vnktshr21 marked this conversation as resolved.
},
1150273: {
'access': 'read-write',
Expand Down Expand Up @@ -3850,13 +3860,15 @@
},
1150312: {
'access': 'read only',
'attribute_class': 'AttributeViStringCommaSeparated',
'codegen_method': 'public',
'documentation': {
'description': 'Returns a comma separated list of the configurable paths available for use based on your instrument configuration.'
},
'lv_property': 'Signal Path:Advanced:Available Paths',
'name': 'AVAILABLE_PATHS',
'type': 'ViString'
'type': 'ViString',
'type_in_documentation': 'list of str'
},
1154097: {
'access': 'read-write',
Expand Down
11 changes: 10 additions & 1 deletion src/nirfsg/system_tests/test_system_nirfsg.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,21 @@ def test_get_string_attribute(self, rfsg_device_session):
model = rfsg_device_session.instrument_model
assert model == "NI PXIe-5841"

def test_get_list_of_strings_attribute(self, rfsg_device_session):
models = rfsg_device_session.supported_instrument_models
assert isinstance(models, list) and all(isinstance(model, str) for model in models)
assert "NI PXIe-5841" in models

def test_set_string_attribute(self, rfsg_device_session):
rfsg_device_session.selected_script = "myScript"
assert rfsg_device_session.selected_script == "myScript"

def test_get_int32_attribute(self, rfsg_device_session):
def test_get_timedelta_attribute(self, rfsg_device_session):
value = rfsg_device_session.external_calibration_recommended_interval
assert isinstance(value, hightime.timedelta)

def test_get_int32_attribute(self, rfsg_device_session):
value = rfsg_device_session.arb_waveform_quantum
assert isinstance(value, int)

def test_set_int32_enum_attribute(self, rfsg_device_session):
Expand Down