Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

release

Release session resources

Syntax

release(s)

Description

example

release(s) 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.

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.

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);
Was this topic helpful?