s.release () releases all reserved hardware resources.
When you associate hardware with a session using the Data Acquisition Toolbox™, the session reserves exclusive access to the data acquisition hardware.
Hardware resources associated with a session are automatically released when you delete the session object, or you assign a different value to the variable containing your session object. Optionally, you can use s.release to release reserved hardware resources if you need to use it in another session or to use applications other than MATLAB® to access the hardware.
Create a session and add an analog input voltage channel and acquire data in the foreground:
s1 = daq.createSession('ni'); s1.addAnalogInputChannel('cDAQ3Mod1', 'ai0', 'Voltage'); s1.startForeground;
Release the session hardware and create another session object with an analog input voltage channel on the same device as the previous session. Acquire in the foreground:
s1.release() s2 = daq.createSession('ni'); s2.addAnalogInputChannel('cDAQ3Mod1', 'ai2', 'Voltage'); s2.startForeground;