matlab-modernize-daq
Installation
SKILL.md
Port DAQ Code to the Modern DataAcquisition Interface
Translate legacy session-based Data Acquisition Toolbox code (daq.createSession, addAnalogInputChannel, DataAvailable listeners, startBackground, queueOutputData, wait) to the modern DataAcquisition interface introduced in R2020a (daq("ni"), addinput, ScansAvailableFcn, start, write, preload). Also covers writing new multi-feature DAQ scripts where the modern API patterns are easy to get wrong under cognitive load.
When to Use
- Porting an existing script that calls
daq.createSession,addAnalogInputChannel,addAnalogOutputChannel,addCounterInputChannel,addCounterOutputChannel, oraddDigitalChannel. - Replacing
DataAvailable/DataRequired/ErrorOccurredlisteners withScansAvailableFcn/ScansRequiredFcn/ErrorOccurredFcn. - Replacing
startBackground/startForeground/s.wait()lifecycle calls. - Replacing
queueOutputDatawithpreload+write. - Writing a new DAQ script that combines two or more of: external triggers, continuous acquisition, callback-driven streaming, analog output with refill, or cross-callback state.
- Debugging errors like
Undefined function 'wait' for input arguments of type 'daq.interfaces.DataAcquisition'orUnrecognized method, property, or field 'Data' for class 'matlabshared.asyncio.buffer.ElementsAvailableInfo'.