0% found this document useful (0 votes)
76 views68 pages

Automation Desk Accessing Model Desk

The document provides instructions for accessing ModelDesk via AutomationDesk 2024-A, including contact information for dSPACE support and recommendations for software updates. It outlines the basics of ModelDesk, its elements, and how to automate tasks using the ModelDesk Access library. Additionally, it includes details on the structure of ModelDesk projects and the various automation blocks available for managing experiments, parameters, and maneuvers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views68 pages

Automation Desk Accessing Model Desk

The document provides instructions for accessing ModelDesk via AutomationDesk 2024-A, including contact information for dSPACE support and recommendations for software updates. It outlines the basics of ModelDesk, its elements, and how to automate tasks using the ModelDesk Access library. Additionally, it includes details on the structure of ModelDesk projects and the various automation blocks available for managing experiments, parameters, and maneuvers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

AutomationDesk

Accessing ModelDesk
For AutomationDesk 2024‑A

Release 2024-A – May 2024


How to Contact dSPACE
Mail: dSPACE GmbH
Rathenaustraße 26
33102 Paderborn
Germany
Tel.: +49 5251 1638-0
E-mail: [email protected]
Web: https://www.dspace.com

How to Contact dSPACE Support


If you encounter a problem when using dSPACE products, contact your local dSPACE
representative:
§ Local dSPACE companies and distributors: https://www.dspace.com/go/locations
§ For countries not listed, contact dSPACE GmbH in Paderborn, Germany.
Tel.: +49 5251 1638-941 or e-mail: [email protected]

You can also use the support request form: https://www.dspace.com/go/supportrequest. If


you are logged on to mydSPACE, you are automatically identified and do not have to add
your contact details manually.

If possible, always provide the serial number of the hardware, the relevant dSPACE License
ID, or the serial number of the CmContainer in your support request.

Software Updates and Patches


dSPACE strongly recommends that you download and install the most recent patches
for your current dSPACE installation. Visit https://www.dspace.com/go/patches for the
software updates and patches themselves and for more information, such as how to
receive an automatic notification when an update or a patch is available for your dSPACE
software.

Important Notice
This publication contains proprietary information that is protected by copyright. All rights
are reserved. The publication may be printed for personal or internal use provided all the
proprietary markings are retained on all printed copies. In all other cases, the publication
must not be copied, photocopied, reproduced, translated, or reduced to any electronic
medium or machine-readable form, in whole or in part, without the prior written consent
of dSPACE GmbH.

© 2017 - 2024 by:


dSPACE GmbH
Rathenaustraße 26
33102 Paderborn
Germany

This publication and the contents hereof are subject to change without notice.

AURELION, AUTERA, ConfigurationDesk, ControlDesk, MicroAutoBox, MicroLabBox,


SCALEXIO, SIMPHERA, SYNECT, SystemDesk, TargetLink, and VEOS are registered
trademarks of dSPACE GmbH in the United States or other countries, or both. Other
brand names or product names are trademarks or registered trademarks of their respective
companies or organizations.
Contents

Contents

About This Document 5

Basics and Instructions 7


Basics on ModelDesk....................................................................................... 7
Overview of the ModelDesk Access Library.................................................... 10
How to Build a Basic Sequence for Accessing ModelDesk.............................. 12
How to Work with Parameters...................................................................... 15
How to Control Maneuvers........................................................................... 18

Reference Information 23
Automation Blocks................................................................................................. 24

Application........................................................................................................ 24
StartModelDesk................................................................................ ............ 25
CloseModelDesk........................................................................................... 26

ProjectAndExperiment........................................................................... ............ 26
OpenProjectAndExperiment........................................................................... 27
ActivateExperiment....................................................................................... 28
CloseProjectAndExperiment........................................................................... 29

Maneuver.......................................................................................................... 30
ActivateManeuver......................................................................................... 30
DownloadActiveManeuver............................................................................ 31
SaveActiveManeuver..................................................................................... 32

ManeuverControl.................................................................................. ............ 33
StartManeuver.............................................................................................. 33
StopManeuver.................................................................................. ............ 35
ResetVehicle.................................................................................................. 37
GetManeuverState........................................................................................ 38

Road.................................................................................................................. 40
ActivateRoad................................................................................................. 41
DownloadActiveRoad.................................................................................... 41
SaveActiveRoad............................................................................................. 42

Traffic................................................................................................................ 42
ActivateTrafficScenario.................................................................................. 43
DownloadActiveTrafficScenario...................................................................... 44
SaveTrafficScenario........................................................................................ 44

3
May 2024 AutomationDesk Accessing ModelDesk
Contents

Parameter.......................................................................................................... 45
GetScalarParameter....................................................................................... 46
SetScalarParameter........................................................................... ............ 47
GetVectorParameter...................................................................................... 47
SetVectorParameter....................................................................................... 48
GetMatrixParameter...................................................................................... 49
SetMatrixParameter....................................................................................... 50
GetLUT1DParameter......................................................................... ............ 50
SetLUT1DParameter...................................................................................... 51
GetLUT2DParameter......................................................................... ............ 52
SetLUT2DParameter...................................................................................... 53
GetGenericParameterValue............................................................................ 54
SetGenericParameterValue............................................................................ 56

ParameterSet..................................................................................................... 56
ActivateParameterSet.................................................................................... 57
SaveActiveParameterSet................................................................................ 58
DownloadActiveParameterSet....................................................................... 59
DownloadParameterRecord........................................................................... 59
ChangeParameterRecordLink......................................................................... 60

Automation 63
Basics on Automating the Access to ModelDesk............................................ 63

Limitations 65
Limitations When Using the ModelDesk Access Library.................................. 65

Index 67

4
AutomationDesk Accessing ModelDesk May 2024
About This Document

About This Document

Content This document gives you information on how to access ModelDesk via
AutomationDesk.

Required knowledge Working with AutomationDesk requires:


§ Basic knowledge in handling the PC and the Microsoft Windows operating
system.
§ Basic knowledge in developing applications or tests.
§ Basic knowledge in handling the external device, which you control remotely
via AutomationDesk.

dSPACE provides trainings for AutomationDesk. For more information, refer to


https://www.dspace.com/go/trainings.

Symbols dSPACE user documentation uses the following symbols:

Symbol Description
Indicates a hazardous situation that, if not avoided,
V DANGER
will result in death or serious injury.
Indicates a hazardous situation that, if not avoided,
V WARNING could result in death or serious injury.
Indicates a hazardous situation that, if not avoided,
V CAUTION could result in minor or moderate injury.
Indicates a hazard that, if not avoided, could result in
NOTICE
property damage.
Indicates important information that you should take
Note
into account to avoid malfunctions.
Indicates tips that can make your work easier.
Tip
Indicates a link that refers to a definition in the
glossary, which you can find at the end of the
document unless stated otherwise.

5
May 2024 AutomationDesk Accessing ModelDesk
About This Document

Symbol Description
Follows the document title in a link that refers to
another document.

Naming conventions dSPACE user documentation uses the following naming conventions:

%name% Names enclosed in percent signs refer to environment variables for


file and path names.

<> Angle brackets contain wildcard characters or placeholders for variable


file and path names, etc.

Special Windows folders Windows‑based software products use the following special folders:

Common Program Data folder A standard folder for application-specific


program data that is used by all users.
%PROGRAMDATA%\dSPACE\<InstallationGUID>\<ProductName>
or
%PROGRAMDATA%\dSPACE\<ProductName>\<VersionNumber>

Documents folder A standard folder for application‑specific files that are


used by the current user.
%USERPROFILE%\Documents\dSPACE\<ProductName>\<VersionNumber>

Local Program Data folder A standard folder for application-specific


program data that is used by the current user.
%USERPROFILE%\AppData\Local\dSPACE\<InstallationGUID>\
<ProductName>

Accessing dSPACE Help and After you install and decrypt Windows‑based dSPACE software, the
PDF files documentation for the installed products is available in dSPACE Help and as PDF
files.

dSPACE Help (local) You can open your local installation of dSPACE Help:
§ On its home page via Windows Start Menu
§ On specific content using context-sensitive help via F1

PDF files You can access PDF files via the icon in dSPACE Help. The PDF
opens on the first page.

dSPACE Help (Web) Independently of the software installation, you can


access the Web version of dSPACE Help at https://www.dspace.com/go/help.
To access the Web version, you must have a mydSPACE account.
For more information on the mydSPACE registration process, refer to
https://www.dspace.com/faq?097.

6
AutomationDesk Accessing ModelDesk May 2024
Basics and Instructions

Basics and Instructions

Where to go from here Information in this section

Basics on ModelDesk................................................................................. 7
General information on ModelDesk.

Overview of the ModelDesk Access Library.............................................. 10


General information on the features of the ModelDesk Access library.

How to Build a Basic Sequence for Accessing ModelDesk........................ 12


Instructions on building a sequence providing the basic actions required
for any ModelDesk use case, for example, starting ModelDesk and
opening an experiment.

How to Work with Parameters................................................................. 15


Instructions on reading and writing the parameter values of an ASM
model.

How to Control Maneuvers..................................................................... 18


Instructions on controlling the execution of a ModelDesk maneuver.

Basics on ModelDesk

Introduction ModelDesk is a user interface for parameterizing and managing the parameter
sets of ASM models. It contains graphical tools for creating roads and planning
maneuvers, and has parameter pages with illustrations for each modeled
component as an aid to entering parameters.

ModelDesk elements You can group parameterization tasks that belong together in a ModelDesk
project.

7
May 2024 AutomationDesk Accessing ModelDesk
Basics and Instructions

The illustration below shows an example of a ModelDesk project. The main


structure is always the same and is realized by specific ModelDesk elements.

Pool This is the container for all the project-specific files, such as the
parameter files of the simulation models and the ASM environment model files.
These files can be used in each experiment of the project.

Experiment This is the basis for carrying out a parameterization task on one
specific simulation model. To experiment with another simulation model, you
have to add a second experiment to the project.
An experiment defines one or more parameter sets that contain the
parameterization of the simulation model.

Simulation Model An Automotive Simulation Model (ASM) is a set of


Simulink® models for hardware-in-the-loop testing of electronic control units or
for early validation of controller algorithms during the design phase.
In ModelDesk, you can parameterize the following simulation model types:
§ Real-time simulation
A simulation running on a real-time system based on, for example,a SCALEXIO
system
§ VEOS simulation
An offline simulation running with VEOS on a host PC
§ Simulink simulation
An offline simulation running in Simulink®

Maneuver You can create maneuvers with ModelDesk's Maneuver Editor.


In a maneuver you can define a vehicle's movements on a road or across an
unspecified area.

8
AutomationDesk Accessing ModelDesk May 2024
Basics on ModelDesk

Road You can create roads with different surfaces, profiles and courses, such
as junctions, with ModelDesk's Road Generator.

Traffic scenario You can create traffic scenarios that define the movements
of fellow vehicles relative to the ASM vehicle with ModelDesk's Traffic Editor.

Parameter set A parameter set defines one parameterization of the


experiment's ASM vehicle model. It is an aggregation of parameter records, one
for each model component. A parameter record links a model component to a
parameter file in the project's Pool. A parameter file is an XML file that contains
the parameters of a model component with their values.
ModelDesk parameter pages are a convenient way to modify a parameter
value in a parameter file. Parameter pages visualize the parameters of a model
component. You can navigate to them via graphics that reflect the model
structure in navigation pages. The modified parameters can be stored in the
project's Pool in a parameter file with a new name.

Activating ModelDesk Although a ModelDesk project can contain several experiments, you can only
elements work with one experiment at a time. To select an experiment for further
processing, you have to activate it. The same applies to roads, maneuvers, traffic
scenarios and parameter sets.

9
May 2024 AutomationDesk Accessing ModelDesk
Basics and Instructions

Automating ModelDesk You can write scripts to control ModelDesk via a COM-based
automation interface. For more details, refer to ModelDesk Automation .
AutomationDesk's ModelDesk Access library uses this interface to provide
automation blocks for some basic ModelDesk features. The blocks offer only
a subset of the automation interface, but additionally, there are blocks in the
ManeuverControl library folder to automate functionality of ControlDesk for
experimenting.

Demo Projects For an example of a ModelDesk project, refer to


<RCP_HIL_InstallationPath>\Demos\ASM\Models\
VehicleDynamics\Parameterization.current.

Related topics Basics

ModelDesk Automation
Features of ModelDesk (ModelDesk Basics )

Overview of the ModelDesk Access Library

Library overview AutomationDesk's ModelDesk Access library is grouped in library folders which
represent the elements of a ModelDesk project.

The library folders group the provided automation blocks in the following
categories.

Application This folder provides automation blocks to start and close


ModelDesk. You can specify to save all project files when you close ModelDesk.

ProjectAndExperiment This folder provides automation blocks to open and


close a ModelDesk project and to activate and close an experiment in it.
If you want to keep the modifications you made to the active experiment, you
can specify to save it. The former version of the experiment is overwritten.

Road, Maneuver and Traffic Each of these folders provides automation


blocks to activate and download an environment element, i.e., a road, a
maneuver or a traffic scenario.

10
AutomationDesk Accessing ModelDesk May 2024
Overview of the ModelDesk Access Library

First activate the environment element you want to work with. Activation
means that the environment element is selected for later downloading and it
is registered as an active element in the ASM environment model configuration.
If you modify an environment element, for example, by using ModelDesk's
automation interface, you can save it by overwriting its former version.
You can download an active element to the simulation platform that is specified
in the active experiment.

ParameterSet This folder provides automation blocks to activate, save and


download ModelDesk parameter sets and parameter records.
You can activate one parameter set, i.e. select it for later modification and
downloading. If you modified a parameter set by using the automation blocks of
the Parameter folder, you can save it by overwriting its former version. You can
download an active parameter set to the simulation platform that is specified in
the active experiment.
You can also change the parameterization of a model component by linking the
parameter record to a different parameter file.

Parameter This folder provides automation blocks to read and write


parameter values of the active parameter set.
If the parameter type is known, you can use type-specific automation blocks.
Otherwise, you can use blocks for reading and writing parameter values
generically.

ManeuverControl This folder provides automation blocks to control the


execution of ModelDesk maneuvers. The blocks extent the functionality offered
by ModelDesk's automation interface.
You can start, stop and reset a downloaded maneuver and retrieve its execution
state.
The automation blocks to control ModelDesk maneuvers are only applicable to
maneuvers running the ASM Vehicle Dynamics model.

For detailed information on the automation blocks, refer to Automation Blocks


(AutomationDesk Basic Practices ).

The ModelDesk Access library is implemented as a custom library. This means


that you can manage it like any other custom library, for example, you can open,
close, export and import it.

Note

In this document there are some cross-references to the ModelDesk


documentation. If a linked topic is not found, open dSPACE Help via
the Help shortcut in the Windows Start menu for dSPACE RCP and HIL
software.

Access via Exec block The Python module audmodeldeskaccess provides methods for all automation
blocks except the maneuver control blocks. Each method has the same name
as its block, its arguments correspond to the block’s input data objects, and its
return value corresponds to the output data object.

11
May 2024 AutomationDesk Accessing ModelDesk
Basics and Instructions

Example
import audmodeldeskaccess
MyVehicleMass = \
audmodeldeskaccess.GetScalarParameter( \
"VehicleDynamics.VEHICLE_MASS_AND_ADDITIONAL_LOADS.Const_m_Vehicle")

Demo Projects For an example of automating ModelDesk access, refer to the AutomationDesk
demo project at <DocumentsFolder>\ModelDesk Access.

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12


How to Control Maneuvers...................................................................................................... 18
How to Work with Parameters.................................................................................................. 15

References

Automation Blocks (AutomationDesk Basic Practices )

How to Build a Basic Sequence for Accessing ModelDesk

Objective Using AutomationDesk's ModelDesk Access library, you can build a basic
sequence that contains generic steps to automate ModelDesk access.

Generic steps of ModelDesk ModelDesk must be opened and an experiment must be activated for each
access ModelDesk use case. Roads, maneuvers and traffic scenarios can be optionally
activated and downloaded. After testing, for example, by analyzing different
parameter values, ModelDesk must be closed.

Preconditions § ModelDesk as of version 2.5p1 must be installed on the host PC. You need the
same licenses as to execute the tasks manually using ModelDesk.
§ The ModelDesk elements you want to access must exist in the ModelDesk
project.
§ The simulation application that is configured in the ModelDesk experiment
must be loaded to the simulation platform, for example, by using the
automation blocks from the Platform Management library.
§ The following information is required as input data:
§ The name and path of the ModelDesk project file (CDP) you want to open
§ The name of the ModelDesk experiment you want to access
§ The names of the road, maneuver and traffic scenario you want to
download

12
AutomationDesk Accessing ModelDesk May 2024
How to Build a Basic Sequence for Accessing ModelDesk

Method To build a basic sequence for accessing ModelDesk


1 Add the following data objects to your project to parameterize the input
data:
§ A File data object
In the Data Object Editor, parameterize it with the file name and path of
the project file (CDP) of the ModelDesk project you want to open.
§ A String data object
Parameterize it with the name of the experiment you want to activate.
§ A String data object
Parameterize it with the name of the maneuver you want to activate and
download.
§ A String data object
Parameterize it with the name of the road you want to activate and
download.
2 From the Library Browser, drag a StartModelDesk block from the
ModelDesk Access library to the Sequence Builder to get an instance of
ModelDesk. If ModelDesk is already running, the existing instance is used.
3 Drag an OpenProjectAndExperiment block from the ModelDesk Access
library to the Sequence Builder. This opens the specified project and activate
the specified experiment.
4 In the Data Object Editor, set the block's ProjectFile and InitialExperiment
data objects as references to the project-specific File and String data objects
that contain the ModelDesk project file and the experiment name.
5 Drag an ActivateManeuver block from the ModelDesk Access library to the
Sequence Builder to activate the specified maneuver.
6 Set the block's ManeuverName data object as a reference to the project-
specific String data object that contains the maneuver name.
7 Drag a DownloadActiveManeuver block from the ModelDesk Access
library to the Sequence Builder. This downloads the active maneuver to the
simulation platform.
8 Drag an ActivateRoad block from the ModelDesk Access library to the
Sequence Builder to activate the specified road.
9 Set the block's RoadName data object as a reference to the project-specific
String data object that contains the road name.
10 Drag a DownloadActiveRoad block from the ModelDesk Access library
to the Sequence Builder to download the active road to the simulation
platform.
11 Drag a CloseProjectAndExperiment block from the ModelDesk Access
library to the Sequence Builder. This closes the active experiment and the
ModelDesk project.
12 Drag a CloseModelDesk block from the ModelDesk Access library to the
Sequence Builder. This closes the existing ModelDesk instance.

Note

This will also close a ModelDesk instance that you started manually.

13
May 2024 AutomationDesk Accessing ModelDesk
Basics and Instructions

Result You created a basic sequence to automate the generic steps to access
ModelDesk.

When you run the sequence, a ModelDesk instance is created or accessed


to open the specified project and to activate the specified experiment. The
ASM maneuver and road elements are downloaded to the simulation platform.
The ModelDesk access is finished by saving and closing the project with its
experiment and by closing ModelDesk.

Next steps You can now parameterize your ASM model. Refer to How to Work with
Parameters on page 15.

14
AutomationDesk Accessing ModelDesk May 2024
How to Work with Parameters

Related topics Basics

Basics on ModelDesk.................................................................................................................. 7
Overview of the ModelDesk Access Library............................................................................... 10

References

ActivateManeuver.................................................................................................................... 30
ActivateRoad............................................................................................................................ 41
CloseModelDesk....................................................................................................................... 26
CloseProjectAndExperiment...................................................................................................... 29
DownloadActiveManeuver........................................................................................................ 31
DownloadActiveRoad............................................................................................................... 41
OpenProjectAndExperiment...................................................................................................... 27
StartModelDesk........................................................................................................................ 25

How to Work with Parameters

Objective You can modify and save a parameter set of an ASM model and download it to
the simulation platform with AutomationDesk's ModelDesk Access library.

Access to model parameters Model parameters are not accessed directly on the simulation platform. You can
activate a parameter set to load it to your host PC's memory. There you can
modify the parameters using the automation blocks from the Parameter folder.
Then you can download the active parameter set from the PC's memory to the
simulation platform to parameterize the current simulation application.

Format of parameter values In AutomationDesk, the different model parameter types are represented by
Python tuples, except for Scalars, which are represented as Float values.

Parameter Type Representation


Scalar v
Vector (v1, v2, v3, …)
Matrix ( (v_a1, v_a2, …), (v_b1, v_b2, …), (v_c1, v_c2, …) )
(where a, b, c is the row index and 1, 2 is the column index)
LUT1D1) ( (v1, v2, v3, …), (x1, x2, x3, …) )
LUT2D2) ( (v1, v2, v3, …), (x1, x2, x3, …), (y1, y2, y3, …) )
1) One-dimensional look-up-table
2) Two-dimensional look-up-table

If the parameter type is known, you can use type-specific automation


blocks to read or write parameter values, such as GetVectorParameter or
SetLUT1DParameter.

15
May 2024 AutomationDesk Accessing ModelDesk
Basics and Instructions

If the parameter type is unknown, you can use the automation blocks
GetGenericParameterValue and SetGenericParameterValue to access
parameters generically.

Preconditions § You have built a basic sequence for accessing ModelDesk. For instructions,
refer to How to Build a Basic Sequence for Accessing ModelDesk on page 12.
§ The parameter set you want to access must exist in the ModelDesk project.
§ The following information is required as input data:
§ The name of the parameter set you want to access and download
§ The addresses of the parameters you want to access

Method To work with parameters


1 Add the following data objects to your project to parameterize the input
data:
§ A String data object
Parameterize it with the name of the parameter set you want to modify,
save and download.
§ A String data object for every parameter you want to access
Parameterize them with the addresses of the parameters, i.e., with their
variable paths in the simulation model.
For example,
VehicleDynamics.VEHICLE_MASS_AND_ADDITIONAL_LOADS.
Const_PosVec_CoG_Vehicle is the address of the
Const_PosVec_CoG_Vehicle parameter in the ASM Vehicle Dynamics
model.
2 For every parameter you want to access, add a data object to your project
in order to reference the parameter value. The data type of the data object
depends on the parameter type. For a Scalar parameter, add a Float data
object. For all other parameter types, add a Tuple data object.
3 Drag an ActivateParameterSet block from the ModelDesk Access library to
the Sequence Builder to activate the specified parameter set.
4 Set the block's ParameterSetName data object as a reference to the
project-specific String data object that contains the parameter set name.
5 Add an automation block for the required parameter type to your sequence
to read a parameter.
For example, to read a Vector parameter, drag a GetVectorParameter block
from the ModelDesk Access library to the Sequence Builder to read a Vector
parameter.
6 Set the block's ParameterAddress data object as a reference to the project-
specific String data object that contains the address of the parameter you
want to read.
7 Set the block's V data object as a reference to the project-specific object to
store the parameter value that you want to read.
In case of one-dimensional look-up tables, in addition, you must
parameterize the x-axis. In case of two-dimensional look-up tables, in
addition, you must parameterize the x- and the y-axis.

16
AutomationDesk Accessing ModelDesk May 2024
How to Work with Parameters

8 Add an automation block for the required parameter type to your sequence
to write a parameter.
For example, to write a Vector parameter, drag a SetVectorParameter block
from the ModelDesk Access library to the Sequence Builder.
9 Set the block's ParameterAddress data object as a reference to the project-
specific String data object that contains the address of the parameter you
want to write.
10 Set the block's V data object as a reference to the project-specific data
object to store the parameter value you want to write.
In case of one-dimensional look-up tables, in addition, you must
parameterize the x-axis. In case of two-dimensional look-up tables, in
addition, you must parameterize the x- and the y-axis.
11 Drag a DownloadActiveParameterSet block from the ModelDesk Access
library to the Sequence Builder. This downloads the currently active
parameter set to the simulation platform.

Result You created a sequence to automate the reading and writing of a parameter set.
If you access a Vector parameter, the sequence looks like this.

When you run the sequence, the specified parameter set is activated. The
specified Vector parameter is read. After the value is modified, the parameter is
written to the active parameter set, which is then downloaded to the simulation
platform.

For an example of modifying a parameterization iteratively, refer to the


AutomationDesk demo project at <DocumentsFolder>\ModelDesk Access.

17
May 2024 AutomationDesk Accessing ModelDesk
Basics and Instructions

Next steps You can execute ModelDesk maneuvers. Refer to How to Control Maneuvers on
page 18.

Related topics Basics

Basics on ModelDesk.................................................................................................................. 7
Overview of the ModelDesk Access Library............................................................................... 10

References

ActivateParameterSet............................................................................................................... 57
DownloadActiveParameterSet................................................................................................... 59
GetVectorParameter................................................................................................................. 47
SetVectorParameter.................................................................................................................. 48

How to Control Maneuvers

Objective You can control the execution of a maneuver with AutomationDesk's


ModelDesk Access library.

Note

§ The automation blocks to control ModelDesk maneuvers are only


applicable to maneuvers running the ASM Vehicle Dynamics model.
§ Up to and including ModelDesk 5.2, you can use the maneuver
compatibility mode in ModelDesk to work with maneuvers created with
ModelDesk 4.6 and earlier.
As of ModelDesk 5.3, the maneuver compatibility mode is discontinued.
Maneuvers created with ModelDesk 4.6 and earlier are no longer
supported. Executing ModelDesk Access blocks to activate and download
these maneuvers leads to exceptions.

Controlling the maneuver The automation blocks to control maneuvers use the following parameters of the
execution maneuver scheduler in the ASM environment model.

Parameter Parameter Path


ResetVehicleVariable ()://Model Root/Environment/Maneuver/UserInterface/
PAR_Plant/ManeuverControl/
RESET/MDLDCtrl_Reset

ManeuverStartVariable ()://Model Root/Environment/Maneuver/UserInterface/


PAR_Plant/ManeuverControl/
MANEUVER_START/MDLDCtrl_ManeuverStart

18
AutomationDesk Accessing ModelDesk May 2024
How to Control Maneuvers

Parameter Parameter Path


ManeuverStateVariable ()://Model Root/Environment/Maneuver/UserInterface/
DISP_Plant/ManeuverState[]/Out1

ManeuverStopVariable ()://Model Root/Environment/Maneuver/UserInterface/


PAR_Plant/ManeuverControl/
MANEUVER_STOP/MDLDCtrl_ManeuverStop

Note

For an MP model, the variable path has to be adapted accordingly.

The automation blocks to control maneuvers use preconfigured references to


project-specific String data objects. If you create your project's data structure
according to the preconfiguration, you do not have to adjust the references. For
details, refer to ManeuverControl on page 33.

Tip

The required project contents are also in the ModelDeskAccessDemo


project in <DocumentsFolder>\ModelDesk Access.

Retrieving the maneuver state You can retrieve the state of the maneuver that is currently downloaded to the
simulation platform by using the GetManeuverState automation block. The
following maneuver states are defined.

Maneuver State1) State Number2) Description


Init 2 The maneuver is in its initialization phase.
Run 3 The maneuver is executing.
Stopping 4 The maneuver has just stopped or finished and the vehicle is coasting.
Wait 5 The maneuver stopped or finished and the simulation is waiting for restart.
Init Manual3) 6 The maneuver is in its initialization phase for manual driving.
Manual3) 7 The maneuver is executing in manual driving mode.
1)
In ModelDesk Access library
2) In Maneuver Scheduler
3) Not applicable in terms of automation.

For details, refer to Maneuver Scheduler (ASM Environment Reference ).

Preconditions § The XIL API Convenience library must be opened in AutomationDesk's


Library Browser, because its functionality is used internally by the
ModelDesk Access library.
§ You have built a basic sequence for accessing ModelDesk. For instructions,
refer to How to Build a Basic Sequence for Accessing ModelDesk on page 12
§ You have set up and downloaded the parameterization of your simulation. For
instructions, refer to How to Work with Parameters on page 15.

19
May 2024 AutomationDesk Accessing ModelDesk
Basics and Instructions

§ The following information is required as input data:


§ The configuration of the model access port. For details, refer to InitMAPort
(AutomationDesk Accessing Simulation Platforms ).
§ The variable paths of the control parameters of the maneuver scheduler in
the ASM environment model.

Method To control a maneuver


1 Add the following data objects to your project to parameterize the input
data:
§ A data container named SimulationPlatform containing an
MAPortConfiguration data object. Parameterize it with the platform
identifier and the application path of the simulation platform specified in
the ModelDesk experiment
§ A data container named VariablePool containing the following data
objects:
§ A String data object named Reset_VehicleStates. Parameterize it with
the variable path of the ResetVehicleVariable parameter.
§ A String data object named ManeuverStart. Parameterize it with the
variable path of the ManeuverStartVariable parameter.
§ A String data object named ManeuverState. Parameterize it with the
variable path of the ManeuverStateVariable parameter.
§ A String data object named ManeuverStop. Parameterize it with the
variable path of the ManeuverStopVariable parameter.
2 Add the following data objects to your project to provide data objects for
referencing:
§ An MAPort data object in the SimulationPlatform data container to
store the instantiated model access port object.
§ A String data object to store the execution state of the maneuver.
3 Drag an InitMAPort block from the XIL API library's MAPort folder to the
Sequence Builder. This initializes the access to the application that is running
on the simulation platform.
4 Set the block's ConfigurationDict data object as a reference to the
project-specific MAPortConfiguration data object that contains the platform
identifier and the application path.
5 Set the block's MAPort data object as a reference to the project-specific
MAPort data object in the SimulationPlatform data container.
If the project-specific data objects are created as described above, the data
objects of the ManeuverControl blocks are automatically referenced.
6 Drag a ResetVehicle block from the ModelDesk Access library to the
Sequence Builder. This sets the currently downloaded vehicle and maneuver
on the simulation platform to its initial state.
7 Drag a StartManeuver block from the ModelDesk Access library to the
Sequence Builder. This is starts the currently downloaded maneuver.
8 Drag a GetManeuverState block from the ModelDesk Access library to the
Sequence Builder. This starts the currently downloaded maneuver.

20
AutomationDesk Accessing ModelDesk May 2024
How to Control Maneuvers

9 Set the block's ManeuverState data object as a reference to the project-


specific String data object to store the state of the currently downloaded
maneuver.
10 Drag a StopManeuver block from the ModelDesk Access library to the
Sequence Builder. This stops the currently downloaded maneuver.

Result You created a sequence to automate the execution of the downloaded


ModelDesk maneuver.

When you run the sequence, the vehicle is reset and the maneuver is started.
The maneuver's execution state is retrieved and the maneuver is stopped.

Related topics Basics

Basics on ModelDesk.................................................................................................................. 7
Overview of the ModelDesk Access Library............................................................................... 10

21
May 2024 AutomationDesk Accessing ModelDesk
Basics and Instructions

References

GetManeuverState................................................................................................................... 38
InitMAPort (AutomationDesk Accessing Simulation Platforms )
ResetVehicle............................................................................................................................. 37
StartManeuver.......................................................................................................................... 33
StopManeuver.......................................................................................................................... 35
XIL API (Model Access) (AutomationDesk Accessing Simulation Platforms )

22
AutomationDesk Accessing ModelDesk May 2024
Reference Information

Reference Information

23
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

Automation Blocks
Introduction The Signal-ModelDesk Access library is a custom library. It is write-protected to
prevent modifications to its blocks.

Using ModelDesk Access You can use functions and other definitions of the ModelDesk Access library
library features in Python in Python scripts after you imported the audmodeldeskaccess module to the
scripts currentname space.

Where to go from here Information in this section

Application.............................................................................................. 24

ProjectAndExperiment............................................................................. 26

Maneuver................................................................................................ 30

ManeuverControl.................................................................................... 33

Road....................................................................................................... 40

Traffic...................................................................................................... 42

Parameter................................................................................................ 45

ParameterSet........................................................................................... 56

Application
Introduction The Application folder in the ModelDesk Access library provides blocks to
access the ModelDesk application.

Where to go from here Information in this section

StartModelDesk....................................................................................... 25
To start ModelDesk.

CloseModelDesk...................................................................................... 26
To close ModelDesk.

24
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

StartModelDesk

Graphical representation

Purpose To start ModelDesk.

Description This block creates an instance of ModelDesk. If a ModelDesk process is already


running, the existing process is used. You can specify to open ModelDesk in
visible or invisible mode.

Note

If ModelDesk is not available, for example, if it is not installed,


AutomationDesk throws an exception.

Data objects This automation block provides the following data object:

Name In / Out Data Type Default Value Description


Visible In String "True" Lets you specify the visible mode of the application:
§ True
ModelDesk starts with the user interface displayed.
§ False
ModelDesk starts in hidden mode.

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12

References

CloseModelDesk....................................................................................................................... 26

25
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

CloseModelDesk

Graphical representation

Purpose To close ModelDesk.

Description This block exits ModelDesk. You can specify whether to save the modifications
made during automated access. If ModelDesk is already closed, AutomationDesk
starts the ModelDesk application in invisible mode to close it correctly
afterwards.

This block also closes a ModelDesk instance, if it was opened manually.

Data objects This automation block provides the following data object:

Name In / Out Data Type Default Value Description


SaveAll In String "True" Lets you specify whether to save your modifications:
§ True
Modifications are saved before closing ModelDesk.
§ False
Modifications are discarded without confirmation.

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12

References

StartModelDesk........................................................................................................................ 25

ProjectAndExperiment
Introduction The ProjectAndExperiment folder in the ModelDesk Access library provides
blocks to access ModelDesk's Project Navigator for managing projects and
experiments.

26
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

Where to go from here Information in this section

OpenProjectAndExperiment..................................................................... 27
To load a project and activate an experiment.

ActivateExperiment.................................................................................. 28
To activate an experiment in the current ModelDesk project.

CloseProjectAndExperiment..................................................................... 29
To close a ModelDesk project.

OpenProjectAndExperiment

Graphical representation

Purpose To load a project and activate an experiment.

Description This block loads the specified project. If the project contains several experiments,
you can specify which experiment is to be activated. Because you can load only
one project at the same time in ModelDesk, any already loaded project is closed
if it differs from the specified one.You can specify whether to save the project
before it is closed. An already loaded project is not saved and closed if it matches
the specified one, i.e. the project paths are identical. The block then refers to this
project without further actions.

If you have not used the StartModelDesk block beforehand, ModelDesk is


automatically started in invisible mode.

If the specified project file is not available, AutomationDesk throws an exception.

Data objects This automation block provides the following data objects:

Name In / Out Data Default Description


Type Value
ProjectFile In File "" Lets you specify the ModelDesk project file (CDP) to be
loaded.
InitialExperiment In String "" Lets you optionally specify the experiment to be activated.

27
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

Name In / Out Data Default Description


Type Value
SaveActiveProject In String "True" Lets you specify whether to save an already loaded project if
it differs from the specified one.
§ True
Modifications in the already loaded project are saved.
§ False
Modifications in the already loaded project are discarded.

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12

References

ActivateExperiment................................................................................................................... 28
CloseProjectAndExperiment...................................................................................................... 29

ActivateExperiment

Graphical representation

Purpose To activate an experiment in the current ModelDesk project.

Description This block is used to activate another experiment from the loaded ModelDesk
project. You can specify whether to save the modifications in the currently active
experiment before switching to the new active experiment.

If the specified experiment is not available, AutomationDesk throws an


exception.

Because the block requires an already loaded project, you have to execute the
OpenProjectAndExperiment block beforehand.

28
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

Data objects This automation block provides the following data objects:

Name In / Out Data Default Description


Type Value
ExperimentName In String "" Lets you specify the experiment to be activated.
SaveActiveExperiment In String "True" Lets you specify whether to save modifications in the
currently active experiment before switching to the new
one.
§ True
Modifications are saved.
§ False
Modifications are discarded.

Related topics Basics

Overview of the ModelDesk Access Library............................................................................... 10

CloseProjectAndExperiment

Graphical representation

Purpose To close a ModelDesk project.

Description This block closes the active ModelDesk project. You can specify whether to save
modifications in the project before closing it. If the project is already closed, the
block executes with no action.

Data objects This automation block provides the following data object:

Name In / Out Data Type Default Description


Value
Save In String "True" Lets you specify whether to save modifications in the active
experiment and project before closing it.
§ True
Modifications are saved.
§ False
Modifications are discarded.

29
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12

References

OpenProjectAndExperiment...................................................................................................... 27

Maneuver
Introduction The Maneuver folder in the ModelDesk Access library provides blocks to activate
and download a maneuver.

Note

Up to and including ModelDesk 5.2, you can use the maneuver


compatibility mode in ModelDesk to work with maneuvers created with
ModelDesk 4.6 and earlier.
As of ModelDesk 5.3, the maneuver compatibility mode is discontinued.
Maneuvers created with ModelDesk 4.6 and earlier are no longer
supported. Executing ModelDesk Access blocks to activate and download
these maneuvers leads to exceptions.

Where to go from here Information in this section

ActivateManeuver................................................................................... 30
To activate a maneuver.

DownloadActiveManeuver....................................................................... 31
To download the active maneuver to Simulink or the real‑time hardware.

SaveActiveManeuver............................................................................... 32
To save the settings of the active maneuver.

ActivateManeuver

Graphical representation

30
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

Purpose To activate a maneuver.

Description This block activates the specified maneuver. If the maneuver is not available in
the active experiment, AutomationDesk throws an exception.

The related project and experiment must be activated before you execute this
block.

Data objects This automation block provides the following data object:

Name In / Out Data Type Default Value Description


ManeuverName In String "" Lets you specify the name of the maneuver to be activated.

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12

References

ActivateExperiment................................................................................................................... 28
DownloadActiveManeuver........................................................................................................ 31

DownloadActiveManeuver

Graphical representation

Purpose To download the active maneuver to Simulink, VEOS or the real‑time hardware.

Description This block downloads to the simulation platform the maneuver that you
activated beforehand by using the ActivateManeuver block.

The simulation platform to which the maneuver is downloaded has to be


configured in ModelDesk beforehand.

Data objects None

31
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12

References

ActivateManeuver.................................................................................................................... 30

SaveActiveManeuver

Graphical representation

Purpose To save the settings of the active maneuver.

Description This block saves the settings of the maneuver that you activated by using the
ActivateManeuver on page 30 block.

Data objects None

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12

References

ActivateManeuver.................................................................................................................... 30
DownloadActiveManeuver........................................................................................................ 31

32
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

ManeuverControl
Introduction The ManeuverControl folder in the ModelDesk Access library provides blocks to
control maneuver actions such as starting a maneuver.

Note

§ The XIL API Convenience library must be loaded in AutomationDesk


because the ModelDesk Access library contains dependencies to it.
§ The automation blocks to control ModelDesk maneuvers are only
applicable to maneuvers running the ASM Vehicle Dynamics model.

Where to go from here Information in this section

StartManeuver......................................................................................... 33
To start a maneuver.

StopManeuver......................................................................................... 35
To stop a running maneuver.

ResetVehicle............................................................................................ 37
To reset the vehicle to its initial state.

GetManeuverState.................................................................................. 38
To get the current state of a maneuver.

StartManeuver

Graphical representation

Purpose To start a maneuver.

Description This block starts the maneuver that you downloaded to the simulation platform
by using the DownloadActiveManeuver block.

33
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

The block's data objects have preconfigured reference names. You have to add
the referencing data objects to the project as shown below.

Note

The MAPort data object has to be initialized in the AutomationDesk


sequence by using the InitMAPort block from the XIL API library.

Tip

The required project contents are also in the ModelDeskAccessDemo


project in <DocumentsFolder>\ModelDesk Access.

Data objects This automation block provides the following data objects:

Name In / Data Default Description


Out Type Value
MAPort In MAPort None The data object references an MAPort data object of the XIL
API library in the AutomationDesk project. The reference name is
preconfigured with SimulationPlatform.MAPort.
ManeuverStartVariable In String "" The data object references a String data object in the
AutomationDesk project. The reference name is preconfigured
with VariablePool.ManeuverStart.

34
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

Name In / Data Default Description


Out Type Value
The referenced String data object in the project has to provide the
path of the ManeuverStart parameter in the maneuver scheduler.
For example, the parameter path for an SP model is:
()://Model Root/Environment/Maneuver/UserInterface/
PAR_Plant/ManeuverControl/
MANEUVER_START/MDLDCtrl_ManeuverStart
Note: For an MP model, the variable path has to be adapted
accordingly.

Related topics HowTos

How to Control Maneuvers...................................................................................................... 18

References

DownloadActiveManeuver........................................................................................................ 31
StopManeuver.......................................................................................................................... 35

StopManeuver

Graphical representation

Purpose To stop a running maneuver.

Description This block stops a maneuver that you started by using the StartManeuver block.

35
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

The block's data objects have preconfigured reference names. You have to add
the referencing data objects to the project as shown below.

Tip

The required project contents are also in the ModelDeskAccessDemo


project in <DocumentsFolder>\ModelDesk Access.

Data objects This automation block provides the following data objects:

Name In / Data Default Description


Out Type Value
MAPort In MAPort None The data object references an MAPort data object of the XIL
API library in the AutomationDesk project. The reference name is
preconfigured with SimulationPlatform.MAPort.
ManeuverStopVariable In String "" The data object references a String data object in the
AutomationDesk project. The reference name is preconfigured
with VariablePool.ManeuverStop.
The referenced String data object in the project has to provide the
path of the ManeuverStop parameter in the maneuver scheduler.
For example, the parameter path for an SP model is:
()://Model Root/Environment/Maneuver/UserInterface/
PAR_Plant/ManeuverControl/
MANEUVER_STOP/MDLDCtrl_ManeuverStop
Note: For an MP model, the variable path has to be adapted
accordingly.

36
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

Related topics HowTos

How to Control Maneuvers...................................................................................................... 18

References

StartManeuver.......................................................................................................................... 33

ResetVehicle

Graphical representation

Purpose To reset the vehicle to its initial state.

Description This block resets the vehicle specified in the ModelDesk maneuver to its initial
state.

The block's data objects have preconfigured reference names. You have to add
the referencing data objects to the project as shown below.

37
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

Tip

The required project contents are also in the ModelDeskAccessDemo


project in <DocumentsFolder>\ModelDesk Access.

Data objects This automation block provides the following data objects:

Name In / Data Default Description


Out Type Value
MAPort In MAPort None The data object references an MAPort data object of the XIL
API library in the AutomationDesk project. The reference name is
preconfigured with SimulationPlatform.MAPort.
ResetVehicleVariable In String "" The data object references a String data object in the
AutomationDesk project. The reference name is preconfigured with
VariablePool.Reset_VehicleStates.
The referenced String data object in the project has to provide
the path of the Reset_VehicleStates parameter in the maneuver
scheduler. For example, the parameter path for an SP model is:
()://Model Root/Environment/Maneuver/UserInterface/
PAR_Plant/ManeuverControl/
RESET/MDLDCtrl_Reset
Note: For an MP model, the variable path has to be adapted
accordingly.

Related topics HowTos

How to Control Maneuvers...................................................................................................... 18

References

GetManeuverState................................................................................................................... 38

GetManeuverState

Graphical representation

Purpose To get the current state of a maneuver.

38
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

Description This block reads the current state of the active maneuver.

The block's data objects have preconfigured reference names. You have to add
the referencing data objects to the project as shown below.

Tip

The required project contents are also in the ModelDeskAccessDemo


project in <DocumentsFolder>\ModelDesk Access.

Data objects This automation block provides the following data objects:

Name In / Data Default Description


Out Type Value
MAPort In MAPort None The data object references an MAPort data object of the XIL
API library in the AutomationDesk project. The reference name is
preconfigured with SimulationPlatform.MAPort.
ManeuverStateVariable In String "" The data object references a String data object in the
AutomationDesk project. The reference name is preconfigured
with VariablePool.ManeuverState.
The referenced String data object in the project has to provide
the path of the ManeuverState parameter in the maneuver
scheduler. For example, the parameter path for an SP model is :
()://Model Root/Environment/Maneuver/UserInterface/
DISP_Plant/ManeuverState[]/Out1
Note: For an MP model, the variable path has to be adapted
accordingly.

39
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

Name In / Data Default Description


Out Type Value
ManeuverState Out String "" Returns the value of the maneuver state variable as a string.
The mapping is:
§ 2: "Init"
§ 3: "Run"
§ 4: "Stopping"
§ 5: "Wait"
§ 6: "Init Manual"
§ 7: "Manual"

Related topics HowTos

How to Control Maneuvers...................................................................................................... 18

References

StartManeuver.......................................................................................................................... 33
StopManeuver.......................................................................................................................... 35

Road
Introduction The Road folder in the ModelDesk Access library provides blocks to activate and
download a road.

Where to go from here Information in this section

ActivateRoad........................................................................................... 41
To activate a road.

DownloadActiveRoad.............................................................................. 41
To download the active road to the simulation platform.

SaveActiveRoad....................................................................................... 42
To save the settings of the active road.

40
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

ActivateRoad

Graphical representation

Purpose To activate a road.

Description This block activates the road specified in the current ModelDesk experiment.

Data objects This automation block provides the following data object:

Name In / Out Data Type Default Value Description


RoadName In String "" Lets you specify the name of the road to be activated.

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12

References

DownloadActiveRoad............................................................................................................... 41

DownloadActiveRoad

Graphical representation

Purpose To download the active road to the simulation platform.

Description This block downloads the road that you activated by using the ActivateRoad
block to Simulink, VEOS or the specified real‑time hardware.

Data objects None

41
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12

References

ActivateRoad............................................................................................................................ 41

SaveActiveRoad

Graphical representation

Purpose To save the settings of the active road.

Description This block saves the settings of the road that you activated by using the
ActivateRoad on page 41 block.

Data objects None

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12

References

ActivateRoad............................................................................................................................ 41
DownloadActiveRoad............................................................................................................... 41

Traffic
Introduction The Traffic folder in the ModelDesk Access library provides blocks to activate
and download a traffic scenario.

42
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

Where to go from here Information in this section

ActivateTrafficScenario............................................................................. 43
To activate a traffic scenario.

DownloadActiveTrafficScenario................................................................ 44
To download the active traffic scenario to the simulation platform.

SaveTrafficScenario.................................................................................. 44
To save the settings of the active traffic scenario.

ActivateTrafficScenario

Graphical representation

Purpose To activate a traffic scenario.

Description This block activates the traffic scenario specified in the current ModelDesk
experiment.

Data objects This automation block provides the following data object:

Name In / Out Data Type Default Value Description


TrafficScenarioName In String "" Lets you specify the name of the traffic scenario to be
activated.

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12

References

DownloadActiveTrafficScenario................................................................................................. 44

43
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

DownloadActiveTrafficScenario

Graphical representation

Purpose To download the active traffic scenario to the simulation platform.

Description This block downloads the traffic scenario that you activated by using the
ActivateTrafficScenario block to Simulink, VEOS or the specified real‑time
hardware.

Data objects None

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12

References

ActivateTrafficScenario.............................................................................................................. 43

SaveTrafficScenario

Graphical representation

Purpose To save the settings of the active traffic scenario.

Description This block saves the settings of the traffic scenario that you activated by using
the ActivateTrafficScenario on page 43 block.

Data objects None

44
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

Related topics HowTos

How to Build a Basic Sequence for Accessing ModelDesk......................................................... 12

References

ActivateTrafficScenario.............................................................................................................. 43
DownloadActiveTrafficScenario................................................................................................. 44

Parameter
Introduction The Parameter folder in the ModelDesk Access library provides blocks to
manage read values from parameters and to write values to parameters.

Where to go from here Information in this section

GetScalarParameter................................................................................. 46
To read a scalar parameter value.

SetScalarParameter.................................................................................. 47
To write a scalar parameter value.

GetVectorParameter................................................................................ 47
To read a vector parameter value.

SetVectorParameter................................................................................. 48
To write a vector parameter value.

GetMatrixParameter................................................................................ 49
To read a matrix parameter value.

SetMatrixParameter................................................................................. 50
To write a matrix parameter value.

GetLUT1DParameter................................................................................ 50
To read a one‑dimensional look‑up table (LUT1D) parameter.

SetLUT1DParameter................................................................................. 51
To write a one‑dimensional look‑up table (LUT1D) parameter value.

GetLUT2DParameter................................................................................ 52
To read a two‑dimensional look‑up table (LUT2D) parameter.

SetLUT2DParameter................................................................................. 53
To write a two‑dimensional look‑up table (LUT2D) parameter value.

GetGenericParameterValue...................................................................... 54
To read a parameter of any type.

45
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

SetGenericParameterValue....................................................................... 56
To write a parameter value of any type.

GetScalarParameter

Graphical representation

Purpose To read a scalar parameter value.

Description This block reads the parameter at the specified address and returns its value as
a single float value. If the specified address does not provide a scalar value, an
error message is displayed.

Data objects This automation block provides the following data objects:

Name In / Out Data Type Default Value Description


ParameterAddress In String "" Lets you specify the address of the parameter to read
from.
V Out Float 0.0 Returns the parameter value.

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

GetGenericParameterValue....................................................................................................... 54
SetScalarParameter................................................................................................................... 47

46
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

SetScalarParameter

Graphical representation

Purpose To write a scalar parameter value.

Description This block writes the specified scalar value to the specified parameter address.
If the parameter is configured for a different data type, an error message is
displayed.

Data objects This automation block provides the following data objects:

Name In / Out Data Type Default Value Description


ParameterAddress In String "" Lets you specify the parameter address to write to.
V In Float 0.0 Lets you specify the parameter value you want to write.

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

GetScalarParameter.................................................................................................................. 46
SetGenericParameterValue........................................................................................................ 56

GetVectorParameter

Graphical representation

Purpose To read a vector parameter value.

47
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

Description This block reads the parameter at the specified address and returns its vector
value as a tuple of float values. If the specified address does not provide a vector
value, an error message is displayed.

Data objects This automation block provides the following data objects:

Name In / Out Data Type Default Value Description


ParameterAddress In String "" Lets you specify the address of the parameter to read
from.
V Out Tuple () Returns the values of a vector parameter.

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

GetGenericParameterValue....................................................................................................... 54
SetVectorParameter.................................................................................................................. 48

SetVectorParameter

Graphical representation

Purpose To write a vector parameter value.

Description This block writes the specified vector value as a tuple of float values to the
specified parameter address. If the parameter is configured for a different data
type, an error message is displayed.

Data objects This automation block provides the following data objects:

Name In / Out Data Type Default Value Description


ParameterAddress In String "" Lets you specify the parameter address to write to.
V In Tuple () Lets you specify the parameter value you want to write.

48
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

GetVectorParameter................................................................................................................. 47
SetGenericParameterValue........................................................................................................ 56

GetMatrixParameter

Graphical representation

Purpose To read a matrix parameter value.

Description This block reads the parameter at the specified address and returns its matrix
value as a tuple of float values. Each row of the matrix is stored in a separate
tuple. For example, a 3x3 matrix is stored at ((v_a1, v_a2, v_a3), (v_b1, v_b2,
v_b3), (v_c1, v_c2, v_c3)), where a, b, c is the row index and 1, 2, 3 is the
column index. If the specified address does not provide a matrix value, an error
message is displayed.

Data objects This automation block provides the following data objects:

Name In / Out Data Type Default Value Description


ParameterAddress In String "" Lets you specify the address of the parameter to read
from.
V Out Tuple () Returns the values of a matrix parameter.

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

GetGenericParameterValue....................................................................................................... 54
SetMatrixParameter.................................................................................................................. 50

49
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

SetMatrixParameter

Graphical representation

Purpose To write a matrix parameter value.

Description This block writes the specified matrix value to the specified parameter address
as a tuple of float values. You have to add a separate tuple for each row of
the matrix. For example, a 3x3 matrix is defined by ((v_a1, v_a2, v_a3), (v_b1,
v_b2, v_b3), (v_c1, v_c2, v_c3)), where a, b, c is the row index and 1, 2, 3 is the
column index. If the parameter is configured for a different data type, an error
message is displayed.

Data objects This automation block provides the following data objects:

Name In / Out Data Type Default Value Description


ParameterAddress In String "" Lets you specify the parameter address to write to.
V In Tuple () Lets you specify the parameter value you want to write.

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

GetMatrixParameter................................................................................................................. 49
SetGenericParameterValue........................................................................................................ 56

GetLUT1DParameter

Graphical representation

50
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

Purpose To read a one‑dimensional look‑up table (LUT1D) parameter.

Description This block reads the parameter at the specified address and returns its
one‑dimensional look‑up table (LUT1D) value as two tuples of float values. The
first tuple X provides the values of the x‑axis. The second tuple V provides the
values at the related x position. If the specified address does not provide a LUT1D
value, an error message is displayed.

Data objects This automation block provides the following data objects:

Name In / Out Data Type Default Value Description


ParameterAddress In String "" Lets you specify the address of the parameter to read
from.
X Out Tuple () Returns the values of the x‑axis of the specified LUT1D
parameter.
V Out Tuple () Returns the values of the specified LUT1D parameter.

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

GetGenericParameterValue....................................................................................................... 54
SetLUT1DParameter.................................................................................................................. 51

SetLUT1DParameter

Graphical representation

Purpose To write a one‑dimensional look‑up table (LUT1D) parameter value.

Description This block writes the specified one‑dimensional look‑up table (LUT1D) values to
the specified parameter address by two tuples of float values. The first tuple X
provides the values of the x‑axis. The second tuple V provides the values at the

51
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

related x position. If the parameter is configured for a different data type, an


error message is displayed.

Note

Both tuples must have the same dimension.

Data objects This automation block provides the following data objects:

Name In / Out Data Type Default Value Description


ParameterAddress In String "" Lets you specify the parameter address to write to.
X In Tuple () Lets you specify the parameter values for the x‑axis you
want to write.
V In Tuple () Lets you specify the parameter values you want to write.

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

GetLUT1DParameter................................................................................................................. 50
SetGenericParameterValue........................................................................................................ 56

GetLUT2DParameter

Graphical representation

Purpose To read a two‑dimensional look‑up table (LUT2D) parameter.

Description This block reads the parameter at the specified address and returns its
two‑dimensional look‑up table (LUT2D) value as three tuples of float values.
The first tuple X provides the values of the x‑axis. The second tuple Y provides
the values of the y‑axis. The third tuple V provides the values at the related

52
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

xy position. If the specified address does not provide a LUT2D value, an error
message is displayed.

Data objects This automation block provides the following data objects:

Name In / Out Data Type Default Description


Value
ParameterAddress In String "" Lets you specify the address of the parameter to read
from.
X Out Tuple () Returns the values of the x‑axis of the specified LUT2D
parameter.
Y Out Tuple () Returns the values of the y‑axis of the specified LUT2D
parameter.
V Out Tuple () Returns the values of the specified LUT2D parameter.

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

GetGenericParameterValue....................................................................................................... 54
SetLUT2DParameter.................................................................................................................. 53

SetLUT2DParameter

Graphical representation

Purpose To write a two‑dimensional look‑up table (LUT2D) parameter value.

Description This block writes the specified two‑dimensional look‑up table (LUT2D) values to
the specified parameter address by three tuples of float values. The first tuple
X provides the values of the x‑axis. The second tuple Y provides the values of
the y‑axis. The third tuple V provides the values at the related xy position. If the
parameter is configured for a different data type, an error message is displayed.

53
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

Note

All the tuples must have the same dimension.

Data objects This automation block provides the following data objects:

Name In / Out Data Type Default Description


Value
ParameterAddress In String "" Lets you specify the parameter address to write to.
X In Tuple () Lets you specify the parameter values for the x‑axis you
want to write.
Y In Tuple () Lets you specify the parameter values for the y‑axis you
want to write.
V In Tuple () Lets you specify the parameter values you want to write.

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

GetLUT2DParameter................................................................................................................. 52
SetGenericParameterValue........................................................................................................ 56

GetGenericParameterValue

Graphical representation

Purpose To read a parameter of any type.

Description This block reads the parameter at the specified address and returns the
values as a tuple of float values. It also returns the parameter type that is
required to implement postprocessing for reading the returned tuple correctly. A
multi‑dimensional parameter is returned as nested tuples. If the specified address
does not provide a parameter, an error message is displayed.

54
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

Mapping example The following table shows how a specific parameter type
is stored.

Parameter Type Representation


Scalar v
Vector (v1, v2, v3, …)
Matrix ( (v_a1, v_a2, …), (v_b1, v_b2, …), (v_c1, v_c2, …) )
(where a, b, c is the row index and 1, 2 is the column index)
LUT1D1) ( (v1, v2, v3, …), (x1, x2, x3, …) )
LUT2D2) ( (v1, v2, v3, …), (x1, x2, x3, …), (y1, y2, y3, …) )
1) One-dimensional look-up-table
2) Two-dimensional look-up-table

Data objects This automation block provides the following data objects:

Name In / Out Data Type Default Description


Value
ParameterAddress In String "" Lets you specify the address of the parameter to read
from.
Values Out Tuple () Returns the values of the specified parameter.
ParameterType Out String "" Returns the type of the specified parameter.
The following names are returned:
§ Scalar
§ Vector
§ Matrix
§ LUT1D
§ LUT2D

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

GetLUT1DParameter................................................................................................................. 50
GetLUT2DParameter................................................................................................................. 52
GetMatrixParameter................................................................................................................. 49
GetScalarParameter.................................................................................................................. 46
GetVectorParameter................................................................................................................. 47
SetGenericParameterValue........................................................................................................ 56

55
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

SetGenericParameterValue

Graphical representation

Purpose To write a parameter value of any type.

Description This block writes the specified tuple values to the specified parameter address.
The tuple structure must follow the rules described in the description of the
GetGenericParameterValue block. If the specified values do not match the
type of the specified parameter, an error message is displayed.

Data objects This automation block provides the following data objects:

Name In / Out Data Type Default Value Description


ParameterAddress In String "" Lets you specify the parameter address to write to.
Values In Tuple () Lets you specify the parameter values you want to write.

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

GetGenericParameterValue....................................................................................................... 54
SetLUT1DParameter.................................................................................................................. 51
SetLUT2DParameter.................................................................................................................. 53
SetMatrixParameter.................................................................................................................. 50
SetScalarParameter................................................................................................................... 47
SetVectorParameter.................................................................................................................. 48

ParameterSet
Introduction The ParameterSet folder in the ModelDesk Access library provides blocks to
manage parameter sets.

56
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

Where to go from here Information in this section

ActivateParameterSet.............................................................................. 57
To activate a parameter set.

SaveActiveParameterSet.......................................................................... 58
To save the settings in the active parameter set.

DownloadActiveParameterSet.................................................................. 59
To download the active parameter set to the simulation platform.

DownloadParameterRecord..................................................................... 59
To download a subset of the active parameter set to the simulation
platform.

ChangeParameterRecordLink................................................................... 60
To link a parameter file saved in the ModelDesk project pool to the
specified parameter record.

ActivateParameterSet

Graphical representation

Purpose To activate a parameter set.

Description This block is used to activate a parameter set from the loaded ModelDesk
project. You can specify whether to save the modifications in a currently active
parameter set before switching to the new one.

If the specified parameter set name is not available, AutomationDesk throws an


exception.

Data objects This automation block provides the following data objects:

Name In / Data Default Description


Out Type Value
ParameterSetName In String "" Lets you specify the name of the parameter set to be
activated.

57
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

Name In / Data Default Description


Out Type Value
SaveActiveParameterSet In String "True" Lets you specify whether to save modifications in the
currently active parameter set before switching to the
new one.
§ True
Modifications will be saved.
§ False
Modifications will be discarded.

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

DownloadActiveParameterSet................................................................................................... 59
SaveActiveParameterSet........................................................................................................... 58

SaveActiveParameterSet

Graphical representation

Purpose To save the settings in the active parameter set.

Description This block saves the settings in the parameter set that you activated by using the
ActivateParameterSet block.

Data objects None

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

ActivateParameterSet............................................................................................................... 57
DownloadActiveParameterSet................................................................................................... 59

58
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

DownloadActiveParameterSet

Graphical representation

Purpose To download the active parameter set to the simulation platform.

Description This block downloads the parameter set that you activated by using the
ActivateParameterSet block to Simulink or the specified real‑time hardware.

Data objects None

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

ActivateParameterSet............................................................................................................... 57

DownloadParameterRecord

Graphical representation

Purpose To download a subset of the active parameter set to the simulation platform.

Description This block downloads a subset of the active parameter set to Simulink or the
specified real‑time hardware. The parameter subset is specified by its main
component name, for example, VehicleDynamics or Drivetrain, and its parameter
record name. A parameter record stores the values of one or more parameter
pages of the specified main component in ModelDesk.

59
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

If any of the specified names cannot be found in the ModelDesk project,


AutomationDesk throws an exception.

Tip

You can get the corresponding parameter record name of a parameter page
by choosing Help in its context menu in ModelDesk. dSPACE Help opens
with the reference information of the according parameter page in ASM
Parameters (ModelDesk Parameterizing ).

Data objects This automation block provides the following data objects:

Name In / Out Data Default Description


Type Value
MainComponentName In String "" Lets you enter the name of the main component
to specify the subset of the parameter set to be
downloaded.
ParameterRecordName In String "" Lets you enter the name of the parameter record
to specify the subset of the parameter set to be
downloaded.

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

ChangeParameterRecordLink.................................................................................................... 60

ChangeParameterRecordLink

Graphical representation

Purpose To link a parameter file saved in the ModelDesk project pool to the specified
parameter record.

60
AutomationDesk Accessing ModelDesk May 2024
Automation Blocks

Description This block makes parameters that are specified in a parameter file available in the
parameter record. The file must be available in the Pool of the active ModelDesk
project.

If any of the specified names is not available, AutomationDesk throws an


exception.

Tip

You can get the corresponding parameter record name of a parameter page
by choosing Help in its context menu in ModelDesk. dSPACE Help opens
with the reference information of the according parameter page in ASM
Parameters (ModelDesk Parameterizing ).

Data objects This automation block provides the following data objects:

Name In / Out Data Default Description


Type Value
MainComponentName In String "" Lets you specify the name of the main component the
parameters from the file are to be added to.
ParameterRecordName In String "" Lets you specify the name of the parameter record the
parameters from the file are to be added to.
FileName In String "" Lets you specify the name of the parameter file to be
linked.

Related topics HowTos

How to Work with Parameters.................................................................................................. 15

References

DownloadParameterRecord...................................................................................................... 59

61
May 2024 AutomationDesk Accessing ModelDesk
Reference Information

62
AutomationDesk Accessing ModelDesk May 2024
Automation

Automation

Basics on Automating the Access to ModelDesk

Introduction AutomationDesk provides a COM‑based API to automate the handling of


AutomationDesk.

Related information The AutomationDesk COM API provides no specific objects for accessing
ModelDesk. You can only use the basic automation features, such as executing a
project via script.

For information on the available objects with their properties and methods, refer
to Basic Interface (AutomationDesk Automation ).

For basic information and instructions, refer to Basics and Instructions on page 7.

63
May 2024 AutomationDesk Accessing ModelDesk
Automation

64
AutomationDesk Accessing ModelDesk May 2024
Limitations

Limitations

Limitations When Using the ModelDesk Access Library

Using the blocks of the The automation blocks to control ModelDesk maneuvers are only applicable to
ManeuverControl folder maneuvers running the ASM Vehicle Dynamics model.

Working with maneuvers Up to and including ModelDesk 5.2, you can use the maneuver compatibility
created with ModelDesk 4.6 mode in ModelDesk to work with maneuvers created with ModelDesk 4.6 and
and earlier earlier.

As of ModelDesk 5.3, the maneuver compatibility mode is discontinued.


Maneuvers created with ModelDesk 4.6 and earlier are no longer supported.
Executing ModelDesk Access blocks to activate and download these maneuvers
leads to exceptions.

65
May 2024 AutomationDesk Accessing ModelDesk
Limitations

66
AutomationDesk Accessing ModelDesk May 2024
Index
Index
starting 18
A stopping 18
ModelDesk access
accessing ModelDesk
limitations 65
basics 7
ModelDesk Access library 10
ActivateExperiment 28
accessing experiments 12
ActivateManeuver 30
accessing parameter sets 15
ActivateParameterSet 57
building a basic sequence 12
ActivateRoad 41
closing ModelDesk 12
ActivateTrafficScenario 43
configuring the ASM environment model 12
activating
controlling maneuver execution 18
maneuver 12
getting maneuver execution state 18
ModelDesk experiment 12
starting ModelDesk 12
parameter sets 15
working with parameters 15
road 12
ModelDesk experiment
traffic scenario 12
activating 12
ASM vehicle
ModelDesk project
restarting 18
opening 12
AutomationDesk library
modifying
ModelDesk Access 10
parameter sets 15
parameters 15
C
ChangeParameterRecordLink 60 O
CloseModelDesk 26
opening
CloseProjectAndExperiment 29
ModelDesk project 12
Common Program Data folder 6
OpenProjectAndExperiment 27

D P
Documents folder 6
parameter sets
DownloadActiveManeuver 31
activating 15
DownloadActiveParameterSet 59
downloading 15
DownloadActiveRoad 41
modifying 15
DownloadActiveTrafficScenario 44
parameters
downloading
modifying 15
maneuver 12
parameter sets 15
road 12 R
traffic scenario 12 ResetVehicle 37
DownloadParameterRecord 59 road
activating 12
G downloading 12

GetGenericParameterValue 54
GetLUT1DParameter 50 S
GetLUT2DParameter 52 SaveActiveManeuver 32
GetManeuverState 38 SaveActiveParameterSet 58
GetMatrixParameter 49 SaveActiveRoad 42
GetScalarParameter 46 SaveTrafficScenario 44
GetVectorParameter 47 SetGenericParameterValue 56
SetLUT1DParameter 51
L SetLUT2DParameter 53
SetMatrixParameter 50
libraries
SetScalarParameter 47
ModelDesk Access 10
SetVectorParameter 48
limitations
StartManeuver 33
ModelDesk access 65
StartModelDesk 25
Local Program Data folder 6
StopManeuver 35

M T
maneuver
traffic scenario
activating 12
activating 12
downloading 12
downloading 12
getting execution state 18

67
May 2024 AutomationDesk Accessing ModelDesk
Index

68
AutomationDesk Accessing ModelDesk May 2024

You might also like