(Not recommended) Release session hardware resources
release( releases all reserved
hardware resources in the session
s, and flushes any data you
have queued in the hardware in that session.
A session might reserve exclusive access to the hardware associated with it. If
you need to use the hardware in another session or by applications other than
release(s) to unreserve the hardware and clear
Hardware resources associated with a session are automatically released when you delete the session object or assign a different value to the variable containing the session object.
Release Session Hardware
Create a session and add an analog input voltage channel and acquire data in the foreground:
s1 = daq.createSession('ni'); addAnalogInputChannel(s1,'cDAQ3Mod1','ai0','Voltage'); startForeground(s1)
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:
release(s1); s2 = daq.createSession('ni'); addAnalogInputChannel(s2,'cDAQ3Mod1','ai2','Voltage'); startForeground(s2);
s — Data acquisition session
Data acquisition session, specified as a session object. Create the
session object using
daq.createSession. Use the data
acquisition session for acquisition and generation operations. Create one
session per vendor and use that vendor session to perform all data
Version HistoryIntroduced in R2010b
session object interface is not recommended
Not recommended starting in R2020a
Use of this function with a
session object is not recommended. To
access a data acquisition device, use a
with its functions and properties instead.
For more information about using the recommended functionality, see Transition Your Code from Session to DataAcquisition Interface.