release

Release session hardware resources

Description

example

release(s) 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 MATLAB®, use release(s) to unreserve the hardware and clear its data.

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.

Examples

collapse all

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);

Input Arguments

collapse all

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 acquisition operations.

Introduced in R2010b