AUTO Session Initialization Fails in Python Measurement Plugin with VISA Devices
@bkeryan 已经在做这个了。
开始于 2025年11月13日。
评估
这个 Issue 还没有评估数据。
描述
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]
- 主要语言
- Python
- 星标
- 21
- 派生
- 20
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ni/measurement-plugin-python 的其他 Issue
-
Clean up the unused `build_in_import_modules` dictionary in ni-measurement-plugin-client-generator未关闭tech debt
难度 1/5 1 小时以内 新手友好度 68/100
ni/measurement-plugin-python#979 ·
-
tech debt
难度 2/5 1-3 小时 新手友好度 65/100
ni/measurement-plugin-python#926 ·
-
enhancement
难度 4/5 3-5 天 新手友好度 45/100
ni/measurement-plugin-python#1227 ·
-
tech debt
难度 3/5 1-2 天 新手友好度 45/100
ni/measurement-plugin-python#978 ·
-
tech debt
难度 3/5 1-2 天 新手友好度 48/100
ni/measurement-plugin-python#959 ·
查看 ni/measurement-plugin-python 的全部 Issue
相似的 Issue
-
namespace operations
难度 1/5 1 小时以内 新手友好度 82/100
EclipseFdn/open-vsx.org#13573 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
collective/icalendar#1854 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
rancher/rancher-ai-agent#412 ·
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
TUDelftGeodesy/DePSI#134 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
HenriquesLab/rxiv-maker#335 ·