Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Migrates legacy session-based MATLAB Data Acquisition code to the modern daq interface, including callbacks, triggers, and output refill.
64% 100%+36 ptsof test cases passed
Passed 25 of 25 test cases with the skill, and 16 of 25 without it.
In legacy MATLAB DAQ sessions, developers set `s.ExternalTriggerTimeout = 15;` to prevent infinite hangs when waiting for an external start pulse. What is the equivalent property on modern `DataAcquisition` objects?
Uses DigitalTriggerTimeout to set the trigger timeout on the DataAcquisition object.
3 of 3 safety checks passed
The official MathWorks transition guide — Transition Your Code from the Session-Based Interface to the DataAcquisition Interface — is the authoritative reference for the basic function and object renames. This table complements it: it covers those renames plus the silent-failure traps the doc does not call out — the trigger Source/Destination argument-order change, the removed wait method, the evt.Data callback gotcha, UserData field-mutation non-persistence, preload being output-only, enum-value renames (BridgeMode), and NumScans being silently ignored.
Each entry below is a substitution agents commonly get wrong when porting verbatim.
| Session API | Modern API | Notes |
|---|---|---|
daq.createSession('ni') | daq("ni") | Returns daq.interfaces.DataAcquisition |
daq.getDevices | daqlist | Optionally pass vendor: daqlist("ni") |
daq.getVendors | daqvendorlist | |
daq.reset | daqreset | Modern form is one word, no dot |
release(s) | clear d | No release method on the modern object |
| Session API | Modern API | Notes |
|---|---|---|
addAnalogInputChannel(s, dev, ch, type) | addinput(d, dev, ch, type) | type strings still apply: "Voltage", "Thermocouple", etc. |
addAnalogOutputChannel(s, dev, ch, type) | addoutput(d, dev, ch, type) | |
addCounterInputChannel(s, dev, "ctr0", type) | addinput(d, dev, "ctr0", type) | addinput handles counters too |
addCounterOutputChannel(s, dev, "ctr0", type) | addoutput(d, dev, "ctr0", type) | |
addDigitalChannel(s, dev, "Port0/Line0", "OutputOnly") | addoutput(d, dev, "Port0/Line0", "Digital") | Direction is implied by addinput vs addoutput; type is "Digital" |
addDigitalChannel(s, dev, "Port0/Line0", "InputOnly") | addinput(d, dev, "Port0/Line0", "Digital") |
| Session API | Modern API | Notes |
|---|---|---|
addTriggerConnection(s, source, dest, role) | addtrigger(d, type, role, trigSrc, trigDest) | Argument order changes. Modern: type, role, source, destination. See snippets §1. |
s.Connections(1).TriggerCondition = 'RisingEdge' | trg.Condition = "RisingEdge" | Property is on the trigger object returned by addtrigger |
addClockConnection(s, source, dest, role) | addclock(d, type, role, clkSrc, clkDest) | Same Source/Destination ordering as addtrigger |
s.ExternalTriggerTimeout = 30 | d.DigitalTriggerTimeout = 30 | Renamed property |
| Session API | Modern API | Notes |
|---|
Next to this one in the catalogue, plus more from the same author.