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).

已驗證STDIO僅桌面開發者工具資料與分析

概覽

AI 產生的概覽

本機 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。僅限桌面端。
安裝前請注意
此伺服器標示為模擬狀態,尚未在真實硬體上驗證。輸出工具會寫入電壓並驅動數位線,且輸出在呼叫結束後會維持該值,直到變更或呼叫 set_outputs_safe,可能影響所連接的設備。讀取數位線可能將其重新設定為輸入。可使用 --read-only 或 LABMCP_READ_ONLY 阻擋會改變狀態的工具,並以 LABMCP_LIMITS 限制輸出電壓、取樣數、取樣率與擷取時間。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 NI-DAQmx DAQ Devices,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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.

Packagelabmcp-ni-daqmx
InstrumentsNI-DAQmx devices: USB-6001/6002/6003, USB-6008/6009, USB-6211/6212/6218, USB/PCIe M and X Series (62xx/63xx), CompactDAQ C Series modules (e.g. NI 9201, 9211, 9263, 9401), NI MAX simulated devices
InterfacesUSB, PCI/PCIe, PXI, Ethernet (cDAQ chassis)
ProtocolNI-DAQmx via the nidaqmx Python API (API docs, source, NI-DAQmx driver)
Status🧪 simulated: tested against a simulated nidaqmx backend, not yet verified on hardware. Report a hardware test

Try it without hardware

bash
uvx labmcp-ni-daqmx --simulate --check

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

  1. Install NI-DAQmx (Windows or Linux; macOS is not supported by NI-DAQmx) from ni.com. The nidaqmx Python package is installed with this server; python -m nidaqmx installdriver can also install the driver.
  2. Find the device name in NI MAX (Devices and Interfaces) or with nilsdev on Linux, e.g. Dev1 or cDAQ1Mod1. Close NI MAX test panels before connecting.
  3. Test the connection:
    bash
    uvx labmcp-ni-daqmx --check                    # works if exactly one device is presentuvx labmcp-ni-daqmx --address Dev1 --check
    --address is the NI-DAQmx device name. It is optional when exactly one device exists.

Add to your MCP client

Claude Code

bash
claude mcp add ni-daq -- uvx labmcp-ni-daqmx --address Dev1

Claude Desktop / Cursor / Windsurf (claude_desktop_config.json, .cursor/mcp.json, …)

json
{  "mcpServers": {    "ni-daq": {      "command": "uvx",      "args": ["labmcp-ni-daqmx", "--address", "Dev1"]    }  }}

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

ToolKindDescription
get_command_log👁 readReturn the most recent raw commands sent to / replies received from the instrument (newest last). Useful for debugging and for recording what was done.
get_connection_info👁 readReport which instrument is connected (identity, address, simulated or real), whether the server is read-only, and the active safety limits. Call this first.
get_device_info👁 readDescribe the connected device: analog input/output channels, digital lines, supported voltage ranges, maximum sample rates, and the outputs this server has set. Call this before choosing channels, ranges and rates.
list_devices👁 readList every NI-DAQmx device the driver can see (product type, serial number, channels, whether it is an NI MAX simulated device) and which one this server is connected to.
read_analog👁 readMeasure voltage on one or more analog inputs: a single on-demand reading, or a finite hardware-timed acquisition of samples per channel at rate_hz. Returns per-channel statistics and a downsampled waveform; optionally saves all data to CSV.
read_digital_lines👁 readRead the logic level of digital lines.
read_thermocouple👁 readMeasure temperature (°C) with thermocouples (types B, E, J, K, N, R, S, T) on a thermocouple-capable device, e.g. an NI 9211/9212/9213/9214 module or USB-TC01.
reconnect🛑 safetyClose and re-open the connection to the instrument (e.g. after it was power cycled or a cable was re-plugged).
set_outputs_safe🛑 safetyPut the device's outputs in a safe state: every analog output to 0 V (or the bottom of its range if 0 V is not in it) and, by default, every digital line this server drove - plus the safe_do_lines option lines - driven low. Use when finished or if anything looks wrong.
write_analog⚠️ hazardSet an analog output to a DC voltage (static, software-timed). The output keeps this value after the call on most NI devices, until changed or set_outputs_safe is called.
write_digital_lines⚠️ hazardDrive digital output lines high or low. The lines keep their level after the call until changed or set_outputs_safe is called.

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

LimitDefaultMeaning
max_ao_voltage_v5 VLargest |voltage| an agent may put on an analog output
max_samples100 000Most samples per channel in one acquisition
max_rate_hz100 000 HzHighest sample clock rate per channel
max_acquisition_s60 sLongest finite acquisition (samples / rate)

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 (and write_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_s is raised. The returned waveform is downsampled by keeping each block's minimum and maximum, so short spikes are not lost. save_path must be a new .csv file: 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. default lets NI-DAQmx choose (often differential where supported). A wrong choice gives offsets or noise rather than an error.
  • Thermocouples use add_ai_thrmcpl_chan with 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_hz across channels, and NI-DAQmx coerces the sample clock to a rate the timebase can produce. The actual rate is returned in sample_rate_hz.
  • NI-DAQmx warnings (e.g. about coerced values) are returned in each acquisition's warnings list.

Hardware verification

ModelNI-DAQmx versionInterfaceVerified byDate
none yet: be the first

來源:servers/engineering/ni-daqmx/README.md,提交 46545ea

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v0.1.2最新Sep 27, 2026
  2. v0.1.0Sep 26, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分