Skip to content

Error in IVI session options mapping #2087

Open

Description

@Arkh42

Description of issue

In the construction or Session, the dictionary options is processed by a non-public converter object: _converters.convert_init_with_options_dictionary.
This is basically a mapping to convert the keys from the dictionary into other keys suitable for the driver.

The issue is related to the following keys:

  • query_instrument_status, which is not processed because in the converter's mapping it does not exist as is (we have queryinstrstatus or query_instr_status);

  • record_value_coersions, for two reasons

    1. there is a typo in the documented key name (docstring), as it should be record_value_coercions;
    2. in either case, it will never be processed because in the converter's mapping it does not exist as is (we have recordcoercions or record_coercions)

System report

The following error is raised when we pass the query_instrument_status: False option:

Driver error: -1074134965: IVI: The option string parameter contains an entry with an unknown option name/

query_instrument_status.

Steps to reproduce issue

import nidcpower

ivi_session_options = {
    cache=True,
    interchange_check=False,
    query_instrument_status = False,
    range_check=True,
    record_value_coersions = False,
    simulate=True,
}

instrument_session = nidcpower.Session(
    resource_name='PXI1Slot2',
    channels=None,
    reset=True,
    options=ivi_session_options,
    independent_channels=True
)
  1. Prepare one of the faulty option, as described above.
  2. Initialise a Session with the faulty option.
  3. Observe the error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions