Approaching Blocks

Building Blocks - looks familiar to you, doesn’t it? A very simple and popular game from childhood times with tiny colorful blocks. Build anything with one kit, no matter if it is a family house, a farm or a castle. The standardized small blocks allowed countless variations. Why should we not use the simplicity of this popular building block system to master complex digital challenges?

This chapter discusses the Building Block Approach from the perspective of the historical and philological study of religion, and in dialogue with perspectives from theories of media, materiality, emotions, and the fantastic. It uses texts from the Hebrew Bible, ancient Mesopotamia, and contemporary popular culture as exemplary material. New method of learning foreign language! Play and read foreign words after lose! - 3 levels - More then 2000 different words and phrases. Cool music 1) You can select dictionary. Now, after death you will see basic words for learning French language (You can skip this step). 2) Press play and select level. There are now 3 of them. Turn on Audio, there is some nice music.

Every day, Allianz faces the needs of 83 million customers in more than 70 different countries. By this diversity we are confronted with the challenge to adapt each digital experience to the specific needs of each target group. Defined UI components have to be changed and every single step has to be configured and adjusted separately from ABS to frontend. This often means not only a loss of consistency it also causes a lot of extra work.

To prevent this, our GDF experts, mainly around Jochen Supper as Head of Development and Anette Voigt as Head of Digital Asset Rollout, are working together with Jose Luís Guart Garrido from Allianz Technology Barcelona in a collaborative spirit on a modular building block approach. The approach is connecting our backend code and Allianz Business System (ABS) system with the frontend UX/UI Design of each standard component currently available to Allianz Operating Entities (OEs) within the UI library. Awesome, right? The approach gives us the chance to increase reusability by decreasing repetitive work. Finally, the need for changes in the code of an element will be eliminated and meanwhile many options for configurations will be left. You now might ask yourself, what a building block is. This question will be answered in the following sequence.

Programmatic Modeling Basics

You can perform most Simulink® modeling basics programmatically at the MATLAB® Command Window, such as creating models, adding blocks to models, and setting parameters. These examples show some of these commands and how you can use them.

Blocks

Load a Model

Approaching Black - Alone Again

Loading a model brings it into memory but does not open it inthe Simulink Editor for editing. After you load a model, youcan work with it programmatically. You can use the Simulink Editorto edit the model only if you open the model.

To load a system, use the load_system command.For example, to load the vdp model, at the MATLAB commandprompt, enter:

Create a Model and Specify Parameter Settings

You can write a function that creates a model and uses the settingsthat you prefer. For example, this function creates a model that hasa green background and uses the ode3 solver:

Black

Programmatically Load Variables When Opening a Model

If you assign a variable as a block parameter value, you must define the value of the variable in the model. See Create a Model. You can define the variable programmatically using the PreloadFcn callback with the set_param function. Use the function in this form:

expression is a MATLAB command or a MATLAB scripton your MATLAB search path. This command sets the model PreloadFcn callbackto the value that you specify. Save the model to save the setting.

For example, when you define the variables in a MATLAB script loadvar.m forthe model modelname.slx, use this command:

Toassign the variable K the value 15,use this command:

After you save the model, the PreloadFcn callbackexecutes when you next open the model.

Programmatically Add and Connect Blocks

This example shows how to use functionsto add blocks and connect the blocks programmatically. Once you haveadded blocks to the model, you use three different approaches to connectthem: routed lines, port handles, and port IDs. Routed lines allowyou to specify the exact (x,y) coordinates of all connecting linesegment endpoints. Port handles and port IDs allow connecting linesto block ports without having to know the port location coordinates.

Createand open a blank model named ‘mymodel’.

Addblocks, including a subsystem block. Use the position arrayin the set_param function to set the size and positionof the blocks. Set the upper left and lower right block corners using(x,y) coordinates.

Inside Subsystem1, deletethe default connection between In1 and Out1.Also, add a second input port by copying and renaming In1 fromthe block library.

Repositionthe internal input and output port blocks inside Subsystem1.

Insert and position an Add blockinside Subsystem1.

Next, add lines to connect all the blocks inthe model. Start by connecting the Sine1 and Pulse1 blocksusing routed lines.

Approaching Blocks For A

Find the (x,y) coordinates of the Sine1 outputport.

Sine1_Port = get_param('mymodel/Sine1','PortConnectivity')

get_param shows that theport Position is [185 100].

Find the (x,y) coordinatesof the Pulse1 output port.

Pulse1_Port= get_param('mymodel/Pulse1','PortConnectivity')

get_param showsthat the port position is [185 220].

Connect the outputof Sine1 to the first input of Subsystem1 usingthree segments of routed line.

Connect the output of Pulse1 tothe second input of Subsystem1 using three segmentsof routed line.

Use get_param to get theport handles of the blocks being connected. Then use the block porthandles to connect the output of Subsystem1 tothe input of Scope1.

Useport names and IDs to connect the Add1 block inside Subsystem1 tothe subsystem inputs and outputs. Simulink uses the most directpath to connect the ports.

Name a Signal Programmatically

  1. Select the block that is the source for the signalline.

  2. Use get_param to assign the porthandle of the currently selected block to the variable p.Use get_param to assign the name of the signalline from that port to the variable l. Then setthe name of the signal line to 's9'.

Arrange Model Layouts Automatically

You can use the Simulink.BlockDiagram.arrangeSystem command to lay out your model. This command aligns input blocks on the left, output blocks on the right, and model elements in columns between the inputs and outputs. The command affects only one layer at a time.

You can use the Simulink.BlockDiagram.routeLine command to route existing lines of your model. Routing existing lines improves line route quality and avoids overlaps of a line with other lines and obstacles in the model.

While you can use these commands with any open model, they are particularly useful with models you build programmatically. For an example, see Arrange Programmatically Populated Model.

Open the Same Model in Multiple Windows

When you open a model, the model appears in a Simulink Editorwindow. For example, if you have one model open and then you opena second model, the second model appears in a second window.

To open the same model in two Simulink Editor windows,at the MATLAB command prompt, enter the open_system commandand use the window argument. For example, if youhave the vdp model open, to open another instanceof the vdp model, enter:

Locate Diagram Elements Using Highlighting

To highlight a block, line, port, or annotation in an open model, use hilite_system.

Specify Colors Programmatically

Alone

You can use the set_param command at the MATLAB commandline or in a MATLAB program to set parameters that determinethe background color of a diagram and the background color and foregroundcolor of diagram elements. The following table summarizes the parametersthat control block diagram colors.

ParameterDetermines

ScreenColor

Block diagram background

BackgroundColor

Block and annotation background

ForegroundColor

Block and annotation foreground

Set the color parameter to either a named color or an RGB value.

  • Named color: 'automatic', 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'gray', 'lightBlue', 'orange', 'darkGreen'

  • RGB value: '[r,g,b]'

    where r, g, and b are the red, green, and blue components of the color normalized to the range 0.0 to 1.0.

For example, the following command sets the background colorof the currently selected system or subsystem to a light green color:

See Also

add_block | add_line | delete_block | delete_line | gcb | get_param | hilite_system | load_system | new_system | open_system | save_system | set_param | Simulink.BlockDiagram.routeLine

Approaching Blocks Meaning

Related Topics