Professional Documents
Culture Documents
Datos Myopenlab - Es.en
Datos Myopenlab - Es.en
com
MyOpenLab
Ttreatment ofdatos
Version 2.4.8.3
User documentation
www.MyOpenLab.de
1
Index
1. Introduction
2
FORMATS AND DATA PROCESSING WITH
MyOpenLab
1. Introduction.
In this section we are going to study the different types of data that the MyOpenLab
application can handle and their conversion methods.
First of all, it is worth keeping in mind that the component window shows the
input and output data and its nature in any of the MyOpenLab components.
This also applies to new function blocks that we can create.
Figure 1
In figure 1 we see the data of the Ellipse component of the canvas library and the data
of the VM MUA component created by us.
• Double (dbl)
• Integer (int)
• String (str)
• Boolean (bowl)
• Var (var)
• Cluster (grp)
• Fountain (font)
• Color (cabbage)
• 1D Value Arrays
3
• 2D Value Arrays
In the design of the circuits, the inputs and outputs of the different elements
are colored with a color code that allows us to know at all times what type of
data is in a given function block.
Figure 2
Double data types are considered to have two decimal places by default. In the case of
providing data with more decimals, rounding will occur when displaying the data,
although it will be stored with its decimals and will operate with all of them:
Example
12,342 12.34
12,348 12.35
4
Integer types are integer numeric variables. Its use in creating models will be
in those cases in which it does not make sense to talk about decimals, for
example in a pulse counter.
In the event that we want to display more than two decimal places in a “Numeric Output”
object, it will be enough for us to change the value of the “Format” field in the properties
window. Figure 3
Figure 3
This type of data consists of any text string that incorporates letters, numbers, and
signs.
As23.89qs
_f_765^4.gg
MyOpenLab
These data are those that belong to the digital systems and operators, which as we
know are elements “0” and “1”.
5
The element belonging to the Operators library
digital is used for setting one component to
entry of a zero or 1 will suffice
set F(false)=0 or T(True)=1. Figure 4.
Figure 4
Below are the input and output elements used in the Display Panel for this
data type.
Entrance Exit
Certain MyOpenLab blocks have the possibility of accepting different types of data,
producing an adaptation of the operator to the inputs. In these blocks, their inputs
and/or outputs are marked as type““var.”
6
Figure 5
We see that in the case of the Boolean data comparator its inputs are of the “bol” type
and in the case of the analog variables it is of the “double” type.
This type of data is a set of data that is transferred from one block to another and that
in a packaged form is made up of a number of individual data.
Figure 6
The signals that are part of these groups are treated together, that is, the signals
cannot be removed and processed independently, at least in the current version of
MyOpenLab.
In Figure 7 below we see a simple example that uses this type of grouped
data. It involves displaying a mathematical function that is entered using a
text entry box in a MathCalc type block.
7
Figure 7
“Font” type data refers, as its name indicates, to fonts. This data is used for
those functional blocks that use fonts, such as the Canvas object.
In figure 8 we see how this type of data is introduced to the Show Text block in a
Canvas area.
Figure 8
The selection of the font is made in the properties menu of the Font
element As seen in figure 9
8
Figure 9
By clicking on the button The Source window is displayed from which we select the
type, size and appearance of the font.
The “col” data types refer to the color selection that through them we can
enter in a block that requires this type of data. In figure 8 we see that the
canvas block is also passed data of this nature.
Figure 10
9
Figure 11
When we select color in the properties menu of the Color object, a color
palette is displayed from which we select the color we want. Figure 11.
It is important to note that the color variable can be decomposed into three numbers that
correspond to the RGB heats of the mixture. This is done with the “Color to RGB” block. In
figure 12 we see how the color is decomposed giving the three values.
Figure 12
This type of data actually responds to an image that can be recovered from a
file type (JPG, GIF, PNG, etc.).
10
Figure 13
There are also function blocks belonging to the library of output elements of
the“Display Panel “that work with “img” type data. In figure 14 we see some.
Figure 14
In Figure 15 we see a simple application that loads three image files and
displays them in the display panel.
eleven
Figure 15
Figure 16
12
Certain MyOpenLab blocks generate an Array of 1D type values in their
outputs, as is the case of the blocks used to generate signals.
Figure 17
In reality, what you do in this block is create a table of values that are then collected
by a graph plotter (oscilloscope) and displayed.
Figure 18
Figure 19
13
The controls are intended to move the signal drawn on the plotter in a vertical and
horizontal direction.
Figure 20
What we see in the previous figure is basically a block of data belonging to the
Figure 21
14
3. Double, integer and string type conversions
The conversions that can be carried out taking this type of data into account are:
Data of this type can be entered into a simulation in the form of constants
using the functions:
It is very important to keep in mind that the data output elements must have their input
compatible with the type of data we want to see. In this we must consider that the
elements that allow us to see the types of variables are those classified in the table
In the figure we see the compatibility in the visualization of elements (data output).
fifteen
Display Elements
Double
String
Integer
In the same way, the data generated by the data entry elements of the
corresponding library of the “Visualization Panel” also provide a specific type of
data that we must take into account when making a design.
In the following figure we see each of these elements that are placed in the
“Display Panel” to enter data into the model with the data types of each of them:
Double
Integer
String
16
Figure 22
In some cases we may be interested in modifying the format of a “double” type data
to add or remove more decimals. To resolve this question we use the function.
which through its format input (string) allows us to define the format that
we give to the value that we put in its data “value” input.
In the example in Figure 23, the data is entered through the “value” input 3.14166666 and it is said
that it only takes five decimal places, therefore the output that is displayed is 3.14167 (we see that
the first digit that is disregarded as it is greater than 6 when above increases it by one unit.
Figure 23
17
6. Find out the length of a string “length”
This function It is very useful in the processing of string type data. The
function collects the string variable, counts the number of characters and returns it in its output.
In figure 24 we see an example in which, using a text input box, we place the
string in the input of the function and its output (number of characters), which is
an Integer data type, we pass it to a format converter. of the type explained
above and from this, once the format is given we extract it using a string display
box.
Figure 24
This function is very useful for when we want to extract a set of characters from a string
and convert it into another different string.
Figure 25
The block has an entry “value” which is where the input string is placed and then two
entries “begin” and “end” which are the integer type values that delimit the string.
The output is logically a string.
In figure 26 we see an example of this function in which a string is placed and the
beginning and end of the string to be cut are delimited.
18
Figure 26
This function allows us to add the elements of two strings. The two input
variables are two strings (string type) and the output is also.
Figure 27
19
Figure 28
Memory function allows you to store data and extract it only when you need it.
order by its governing input In1(boolean signal).
Figure 29
Figure 30
twenty