3
Models i n Ma tlab Da ta Acqu isition 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)) buil t on the MATLAB technical computing env ironment. 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 Aq uisition 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 Acquisitio n Toolbox Digital Output Digital Output Data Digital Input Digital Input Data Analog Output D/A Data Analog Input A/D Dat a  This model is a structured ASCII file that contains keywords and parameter-val ue 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 sec tion identifies the act ive 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 b lock- specific parameters. 5. The AnnotationDefaults section contains default settings for annotations in the model.

Matlab Aquisition Model v2

Embed Size (px)

Citation preview

Page 1: Matlab Aquisition Model v2

8/8/2019 Matlab Aquisition Model v2

http://slidepdf.com/reader/full/matlab-aquisition-model-v2 1/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 moresuitable 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

Digital Output

Digital

OutputData

Digital Input

Digital

InputData

Analog Output

D/AData

Analog Input

A/D Data

 

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 commonto 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 inthe model.

Page 2: Matlab Aquisition Model v2

8/8/2019 Matlab Aquisition Model v2

http://slidepdf.com/reader/full/matlab-aquisition-model-v2 2/3

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 linesof a data acquisition device.

The Analog Output outputs data to multiple analog channels of a dataacquisition device.

The Digital Output outputs a set of values to multiple digital lines of a dataacquisition 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 thepossibility 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 por ts 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 thedevice.

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 deviceis 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 valueis 0.01 (seconds).

The Analog blocks incorporate live measured data into Simulink for:

System characterizationAlgorithm verification

System and algorithm modeling

Model and design validation

Page 3: Matlab Aquisition Model v2

8/8/2019 Matlab Aquisition Model v2

http://slidepdf.com/reader/full/matlab-aquisition-model-v2 3/3

 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 generatesa 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 featur es that a re 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 measuredand stored in a buffer until the user needs it.

Matlab promotes Model-Based Design . The purpose is creating models that arecomplete, unambiguous ,statically deterministic, robust and verifiable.

Using models ensures that a final product meets system requirements. Models enableengineering teams with different specializations to work together efficiently and to

communicate between people working on various stages of the design process; to identify andfix errors early on in the development process; and to automatically generate robust, efficient,

and high-quality software.