-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Bug Report
The AUTO session initialization behavior in the Python measurement plugin does not work as expected when communicating with VISA instruments. Instead of automatically initializing or attaching based on the environment (InstrumentStudio or TestStand), it fails with a VI_ERROR_RSRC_NFOUND error.
Related Link: InstrumentStudio Pro Python plugin for third party hardware using VISA
Repro or Code Sample
Steps to reproduce:
- Clone and modify the visa example from NI's measurement-plugin-python repo.
- Use the plugin to communicate with any 3rd party instrument.
- Run the plugin with SessionInitializationBehavior.AUTO.
Expected Behavior
The plugin should automatically initialize the session when run from InstrumentStudio and attach when run from TestStand, as per the behavior defined by AUTO.
Current Behavior
The plugin fails with the following error:
VI_ERROR_RSRC_NFOUND (-1073807343): Insufficient location information or the requested device or resource is not present in the system.
Changing init_behavior from AUTO (0) to INITIALIZE_SERVER_SESSION (1) resolves the issue.
Possible Solution
Investigate why AUTO does not behave correctly in Python plugins. A workaround is to manually set the initialization behavior based on the calling environment (e.g., InstrumentStudio vs TestStand), but this should not be necessary.
Context
This issue affects plugin developers trying to use the Python SDK to communicate with VISA instruments. It introduces unnecessary complexity and diverges from expected behavior
Your Environment
- OS & Device: Windows
ni-measurement-plugin-sdk-serviceversion [e.g. 3.0.1]- InstrumentStudio version 25Q3
- Python version [e.g. 3.10]