Data Acquisition Toolbox | ![]() ![]() |
Allocate or display memory resources
Syntax
Arguments
obj |
A device object or array of device objects. |
maxmem |
The amount of memory to allocate. |
out |
A structure containing information about memory resources. |
Description
returns the structure out = daqmem
out
, which contains several fields describing the memory resources associated with your platform and the Data Acquisition Toolbox. The fields are described below.
Note that all the above fields, except for UsedDaq
, are identical to the fields returned by Windows' MemoryStatus
function.
returns a 1-by-N structure out = daqmem(obj)
out
containing two fields: UsedBytes
and MaxBytes
for the device object obj
. N is the number of device objects specified by obj
. UsedBytes
returns the number of bytes used by obj
. MaxBytes
returns the maximum number of bytes that can be used by obj
.
sets the maximum memory that can be allocated for daqmem(obj,maxmem)
obj
to the value specified by maxmem
.
More About Allocating and Displaying Memory Resources
daqmem(obj,maxmem)
controls the value of the MaxSamplesQueued
property.
BufferingConfig
property, then this value supersedes the values specified by daqmem(obj,maxmem)
and the MaxSamplesQueued
property.
Example
Create the analog input object aiwin
for a sound card and the analog input object aini
for a National Instruments board, and add two channels to each device object.
aiwin = analoginput('winsound'); addchannel(aiwin,1:2); aini = analoginput('nidaq',1); addchannel(aini,0:1);
To display the total memory used by all existing device objects:
To configure the maximum memory used by aiwin
to 640 KB:
To configure the maximum memory used by each device object with one call to daqmem
:
Properties
BufferingConfig
, MaxSamplesQueued
![]() | daqhwinfo | daqpropedit | ![]() |