Sei sulla pagina 1di 3

Models in Matlab Data Acquisition Toolbox

Data Acquisition Toolbox software is a collection of functions and a MEX-file (the


data acquisition engine (or just engine) is a MEX-file (shared library that is executable within
the MATLAB software)) built on the MATLAB technical computing environment. The
toolbox also includes several dynamic link libraries (DLLs) called adaptors, which enable us
to interface with specific hardware.

There are two alternatives in using the Data Aquisition toolbox: Matlab command line
and Simulink. Considering the purpose of this study, the Simulink representation is more
suitable beacouse we can also interconnect these Data Aquisition blocks with blocks in other
Simulink libraries to create sophisticated models. The result is, nevertheless the same: a
model file is automatically generated.
Data Acquisition Toolbox

A/D Data Data D/A

Analog Input Analog Output

Digital Digital
Data Data
Input Output

Digital Input Digital Output

This model is a structured ASCII file that contains keywords and parameter-value
pairs that describe the model. The file describes model components in hierarchical order.
The model file consists of sections that describe different model components:
1. The Model section defines model parameters, configuration sets, and
configuration references.
2. The Simulink.ConfigSet section identifies the active configuration set or
configuration reference.
3. The BlockDefaults section contains default settings for parameters common
to all blocks in the model.
4. The BlockParameterDefaults section contains default settings for block-
specific parameters.
5. The AnnotationDefaults section contains default settings for annotations in
the model.
6. The LineDefaults section contains default settings for lines in the model.
7. The System section contains parameters that describe each system
(including the top-level system and each subsystem) in the model. Each
System section contains block, line, and annotation descriptions.
As a result of studying the Data Acquisition Toolbox, based on the similarity of the
attributes asigned to each model, I conclude that we have implemented 2 types of
metamodels: Analog MetaModel and Digital MetaModel.
Each of these metamodels have been instantiated so to accomodate the purpose of the
equipement used:input or Output .Their roles consist of the following:
The Analog Input acquires data from multiple analog channels of a data
acquisition device.
The Digital Input acquires the latest set of values from multiple digital lines
of a data acquisition device.
The Analog Output outputs data to multiple analog channels of a data
acquisition device.
The Digital Output outputs a set of values to multiple digital lines of a data
acquisition device.
Concerning the analog models we have, what we call in GME „field atributes”
available, such as:, hardware sample rate, block size, hardware channels (we have the
possibility to choose from a list). The majority of the attributes are what we call in GME
„enum attributes”: Aquisition mode (with the predefined modes: synchronous and
asynchronous),input type. We are offered the possibility to configure the output, by choosing
the format of the following „enum attributes” :Number of ports with its Menu Items: 1 per
hardware channel,1 for all hardware channels; Signal type with its Menu Items : Sample
Based, Frame-Based;Data type with its Menu Items : Double, Int16, Uint18. In Matlab this
type of attribute is called an enumerated property type which is, of course, a property type
whose value must be one of a specified set of values.
The Analog models are characterized by the following attributes:
1. Input/Output Mode
2. Device - the data acquisition device from which you want to acquire data.
3. Input/Output type - specifies the hardware channel configuration, such as single-
ended, differential, etc.
4. Channels. These parameters are specified for each selected channel:
Hardware Channel — Displays the hardware channel ID specified by the
device.
Name — Specifies the channel name.
Input/Output Range — Specifies the input ranges available for each channel
supported by the hardware, and the available values are defined when a device
is selected.
Initial Value for the Output Model only.
5. Number of ports
6. Block sample time - specifies the sample time of the block during the simulation.
This is the rate at which the block is executed during simulation. The default value
is 0.01 (seconds).

The Analog blocks incorporate live measured data into Simulink for:
System characterization
Algorithm verification
System and algorithm modeling
Model and design validation
Design control

The Digital Input model and the Digital Output model are a result of making use of the
Simulink.Parameter Class. When using these models we call this class which enables us to
create workspace objects that we can then use as the values of block parameters. Parameter
objects let us specify not only the value of a parameter but also other information about the
parameter, such as the parameter's purpose, its dimensions, its minimum (Simulink generates
a warning if you assign a value to the parameter that is less than the minimum value and when
updating the diagram or starting a simulation, Simulink generates an error if the parameter
value violates its minimum value.) and maximum values.

The Digital models are characterized by the following attributes:


1. Lines - to specify which lines to send data to.
2. Hardware Port ID - specifies the ID for each hardware port.
3. Hardware Line ID - specifies the ID of the hardware line.
4. Name - specifies the hardware line name.
5. Number of ports
The Digital Input model lacks the Number of ports attribute but has an additional attribute :
6. Device - the data acquisition device from which you want to acquire data.

All of these features that are implemented in the model refere to the aquisition
method. The device (hardware) is automatically detected. There is a list of supported
hardware but the user doesn’t have the power to alter the hardware configuration.
Data is acquired from the specified device (which may easily be the computer’s own
sound card) and data is flowing from the hardware device into the data acquisition engine
where it is temporarily stored in memory, until we explicitly extract it using the getdata
function.
The flow of acquired data consists of these two independent steps:
1. Data acquired from the hardware is stored in the engine.
2. Data is extracted from the engine and stored in the MATLAB workspace,or output
to a disk file.
The model is not concerned with processing the aquired data. The data is measured
and stored in a buffer until the user needs it.
Matlab promotes Model-Based Design . The purpose is creating models that are
complete, unambiguous ,statically deterministic, robust and verifiable.
Using models ensures that a final product meets system requirements. Models enable
engineering teams with different specializations to work together efficiently and to
communicate between people working on various stages of the design process; to identify and
fix errors early on in the development process; and to automatically generate robust, efficient,
and high-quality software.

Potrebbero piacerti anche