Release session resources
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.
s— Data acquisition session
Data acquisition session, specified as a session object. Create
the session object using
Use the data acquisition session for acquisition and generation operations.
Create one session per vendor and use that vendor session to perform
all data acquisition operations.
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);