matlab-call-nidaqmx

Translate NI-DAQmx C function signatures into calldaqlib MATLAB calls.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-call-nidaqmx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-call-nidaqmx
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/test-and-measurement/matlab-call-nidaqmx
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-call-nidaqmx

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

NI-DAQmx capabilities like retriggerable acquisition, signal export, and terminal routing are not exposed by the MATLAB daq object, and translating C driver signatures into calldaqlib calls is error-prone due to implicit task handles, output-pointer placeholders, and enum conventions.

Core Features & Use Cases

  • C-to-calldaqlib Translation Rules: Maps C argument patterns (taskHandle, output pointers, buffer sizes, enums) to their correct MATLAB equivalents across six call forms.
  • Decision Tree Guidance: Routes between the daq object and calldaqlib, handles multi-task semantics, device-level APIs via empty daq objects, and string/array getter placeholders.
  • Reference Tables: Provides the 20 most-used verified signatures, 15 DAQmx_Val_* enum strings, and a catalog of common mistakes with fixes.
  • Use Case: A user porting LabVIEW code needs retriggerable finite acquisition; the Skill produces calldaqlib(dq, "DAQmxSetStartTrigRetriggerable", true) with the required DAQmx_Val_FiniteSamps configuration and warns that start() clobbers driver-set rates.

Quick Start

Ask the agent to configure a retriggerable analog start trigger on Dev1/ai0 using calldaqlib with a 5000 Hz external sample clock.

Frequently Asked Questions about matlab-call-nidaqmx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I call NI-DAQmx C functions from MATLAB?

Use calldaqlib with a daq object, passing the DAQmx function name as a string followed by its arguments. Omit the taskHandle since the daq object owns it, and use string enum names like "DAQmx_Val_Rising" instead of raw integers.

How do I configure retriggerable acquisition in MATLAB DAQ?

Configure the trigger type first, then call calldaqlib(dq, "DAQmxSetStartTrigRetriggerable", true). Retriggerable mode requires DAQmx_Val_FiniteSamps in DAQmxCfgSampClkTiming and does not work with continuous sampling.

When should I use calldaqlib instead of the daq object?

Use the daq object when its properties and methods cover the capability, such as dq.Rate, addtrigger, or addclock. Use calldaqlib only for driver-level features the daq object does not expose, like retriggerable triggers, signal export, or digital filters.

Why does start() reset the sample rate set via calldaqlib?

The start() method reapplies dq.Rate to the driver, clobbering any rate set through DAQmxCfgSampClkTiming. Set dq.Rate first and reserve calldaqlib for parameters the daq object does not track, or use DAQmxStartTask via calldaqlib.

Can I use DAQmxCreateTask through calldaqlib?

No, DAQmxCreateTask and DAQmxLoadTask cannot work through calldaqlib because it owns task creation internally. Device-level functions without a taskHandle, like DAQmxGetDevIsSimulated or DAQmxConnectTerms, work using an empty daq object with no channels.

Why does a string getter return NI Error -200228?

Error -200228 means the buffer size passed to the getter is too small. The error message includes the required buffer size in bytes; parse it and retry, using 256 for short names and 1024 for long paths or channel lists.