Skip to content

AUTO Session Initialization Fails in Python Measurement Plugin with VISA Devices #1263

@Sneha1106

Description

@Sneha1106

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:

  1. Clone and modify the visa example from NI's measurement-plugin-python repo.
  2. Use the plugin to communicate with any 3rd party instrument.
  3. 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-service version [e.g. 3.0.1]
  • InstrumentStudio version 25Q3
  • Python version [e.g. 3.10]

AB#3460500

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions