Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

AUTO Session Initialization Fails in Python Measurement Plugin with VISA Devices

未关闭
#1,263 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@bkeryan 已经在做这个了。

开始于 2025年11月13日。

评估

这个 Issue 还没有评估数据。

描述

bug

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

主要语言
Python
星标
21
派生
20
平均合并
1 天 19 小时
30 天内合并 PR
2

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ni/measurement-plugin-python 的其他 Issue

查看 ni/measurement-plugin-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。