
NI-DAQmx DAQ Devices
io.github.K-Dense-AI由 GitHub 账号 K-Dense-AI 发布v0.1.2更新于 Oct 24, 2026
MCP server for National Instruments DAQ devices (NI-DAQmx).
概览
本地 MCP 服务器,让 AI 助手通过 NI-DAQmx 在 National Instruments DAQ 硬件上读取模拟、数字和热电偶信号并设置输出。
- 可以做什么
- 发现与查看设备:列出 NI-DAQmx 设备、报告连接信息、说明通道、量程和采样率,查看原始命令日志或在断电重启后重连。采集模拟输入:进行单次读数或硬件定时采集,返回各通道统计量和降采样波形,可选保存到新的 CSV 文件。读取数字线电平并测量常见类型的热电偶温度。驱动输出:设置模拟输出电压和数字线电平,并将所有输出恢复到安全状态。
- 适用场景
- 适用于实验台、实验室或测试环境,让助手查询 NI DAQ 硬件、采集测量数据、记录到 CSV,或在明确的安全限制下切换模拟和数字输出。也可通过内置模拟器在没有硬件时使用。
- 运行要求
- 以 Python 包(uvx labmcp-ni-daqmx)在 Windows 或 Linux 本地运行;NI-DAQmx 不支持 macOS。需要安装 NI-DAQmx 驱动,并通过 --address 传入设备名(仅有一个设备时可省略)。可选环境变量:LABMCP_ADDRESS、LABMCP_LIMITS、LABMCP_READ_ONLY、LABMCP_SIMULATE。仅限桌面端。
安装
在 SourceWeft 中
- 打开 控制台中的 NI-DAQmx DAQ Devices,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
NI-DAQmx DAQ Devices — MCP Server
Let an AI agent acquire voltages and thermocouple temperatures, read digital lines and (with your permission) set analog and digital outputs on National Instruments DAQ hardware through the official NI-DAQmx driver and its Python API.
Try it without hardware
The built-in simulator is a USB-6341-like X Series device Dev1: a 1 V / 50 Hz sine on ai0, a 2.5 V sensor on ai1, ao0/ao1 looped back to ai2/ai3, a ~37 °C thermocouple on ai4, and an external "interlock" holding port1/line0 high. It reproduces NI-DAQmx behaviour such as error codes (e.g. -200170 channel does not exist, -200576 no built-in CJC) and the shapes task.read() returns.
Testing the real NI-DAQmx path without hardware: in NI MAX (Windows) choose Devices and Interfaces → Create New… → Simulated NI-DAQmx Device, then run the server without --simulate against that device, e.g. --address SimDev1. NI MAX simulated devices return synthetic data, and get_connection_info reports ni_max_simulated_device: True. On Linux, simulated-device support is limited (NI's configuration tools can import a configuration file that defines one, with mixed results); use --simulate there.
Connect your instrument
- Install NI-DAQmx (Windows or Linux; macOS is not supported by NI-DAQmx) from ni.com. The
nidaqmxPython package is installed with this server;python -m nidaqmx installdrivercan also install the driver. - Find the device name in NI MAX (Devices and Interfaces) or with
nilsdevon Linux, e.g.Dev1orcDAQ1Mod1. Close NI MAX test panels before connecting. - Test the connection:
--addressis the NI-DAQmx device name. It is optional when exactly one device exists.
Add to your MCP client
Claude Code
Claude Desktop / Cursor / Windsurf (claude_desktop_config.json, .cursor/mcp.json, …)
Add --read-only to allow acquisitions but block the output tools (set_outputs_safe stays available). Add --option safe_do_lines=port0/line0:3 to make set_outputs_safe always drive those lines low. For other clients, generate the snippet with uvx labmcp config ni-daqmx --address Dev1 --client vscode (also cursor, codex, claude-code).
Tools
get_connection_info, get_command_log and reconnect are built into every LabMCP server. The command log records every task the server ran (channels, ranges, rates, values written).
Safety limits
Override at launch, e.g. --limit max_ao_voltage_v=10 --limit max_acquisition_s=300. Limits are checked before anything is sent. The device's own AO range is also enforced (e.g. USB-6008/6009 outputs 0-5 V only), as are its maximum sample rates.
Example prompts
- "List the NI devices and tell me which inputs Dev1 has and their voltage ranges."
- "Acquire ai0 and ai1 differentially at 10 kHz for 0.5 s on the ±1 V range and give me the RMS noise of each; save the data to ~/daq/noise.csv."
- "Read the type K thermocouples on cDAQ1Mod1/ai0:3 once a second for 30 seconds using the built-in CJC and report the average of each."
- "Set ao0 to 2.0 V, confirm it on the ai2 loopback, then set it back to 0."
- "Is the interlock on port1/line0 closed? Then switch port0/line2 high to open the valve."
- "We're done: put every output in a safe state."
Notes
- Every tool call is one short DAQmx task (create channels, configure timing, read or write, close), as in NI's examples, so the server never holds the device reserved between calls. Another program using the device at the same time causes a clear "resource reserved" error (-50103). Output and digital-line tasks are serialised separately from acquisitions, so
set_outputs_safe(andwrite_analog) never wait for a running acquisition to finish: NI-DAQmx runs an analog-input task and AO/DIO tasks on the same device side by side. - Acquisitions are capped at 600 s per tool call even if
max_acquisition_sis raised. The returned waveform is downsampled by keeping each block's minimum and maximum, so short spikes are not lost.save_pathmust be a new.csvfile: it is checked before acquiring, and an existing file is never overwritten. - Outputs hold their value after the task closes on most NI devices, which is what the output tools rely on. Some devices have configurable idle/power-up output behaviour; check your device if it resets outputs.
- Reading a digital line can change it. A DAQmx digital-input task configures the line as an input. The server therefore reports lines it is driving from their last commanded level instead of reading them, and documents the risk for lines driven by other software.
- Terminal configuration matters.
defaultlets NI-DAQmx choose (often differential where supported). A wrong choice gives offsets or noise rather than an error. - Thermocouples use
add_ai_thrmcpl_chanwith built-in or constant cold-junction compensation. A CJC channel (SCANNABLE_CHANNEL) is not offered in this version because its correct use depends on the device. - Rates: multiplexed devices share
ai_max_multi_channel_rate_hzacross channels, and NI-DAQmx coerces the sample clock to a rate the timebase can produce. The actual rate is returned insample_rate_hz. - NI-DAQmx warnings (e.g. about coerced values) are returned in each acquisition's
warningslist.
Hardware verification
来源:servers/engineering/ni-daqmx/README.md,提交 46545ea
工具
0版本历史
2- v0.1.2最新Sep 27, 2026
- v0.1.0Sep 26, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分