Automation Desk Accessing Motion Desk
Automation Desk Accessing Motion Desk
Accessing MotionDesk
For AutomationDesk 2024‑A
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.
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.
This publication and the contents hereof are subject to change without notice.
Contents
Reference Information 15
Automation Blocks................................................................................................. 16
Application........................................................................................................ 16
StartMotionDesk........................................................................................... 16
CloseMotionDesk.......................................................................................... 17
ProjectAndExperiment........................................................................... ............ 18
OpenProjectAndExperiment........................................................................... 19
CloseProjectAndExperiment........................................................................... 20
WindowManagement........................................................................................ 21
SelectViewMode........................................................................................... 21
SimulationManagement..................................................................................... 22
StartAnimation.............................................................................................. 22
StopAnimation.............................................................................................. 23
Automation 25
Basics on Automating the Access to MotionDesk........................................... 25
Limitations 27
Limitations When Using the MotionDesk Access Library................................. 27
Index 29
3
May 2024 AutomationDesk Accessing MotionDesk
Contents
4
AutomationDesk Accessing MotionDesk May 2024
About This Document
Content This document gives you information on how to access MotionDesk via
AutomationDesk.
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 MotionDesk
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:
Special Windows folders Windows‑based software products use the following special folders:
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.
6
AutomationDesk Accessing MotionDesk May 2024
Basics and Instructions
Basics on MotionDesk................................................................................ 7
Provides general information on MotionDesk.
Basics on MotionDesk
Note
Features of MotionDesk MotionDesk is a dSPACE software for visualizing the movement of mechanical
objects, such as car components or robot arms, in a virtual 3-D world.
It contains graphical tools for arranging static and movable objects in animatable
scenes.
7
May 2024 AutomationDesk Accessing MotionDesk
Basics and Instructions
MotionDesk elements Project You can group visualization tasks that belong together in a
MotionDesk project.
Experiment This is the basis for carrying out an animation of one specific
scene. To experiment with another scene, you have to add a second experiment
to the project.
Scene The scene of an experiment specifies the static and movable objects
that exist in the experiment's virtual world.
You can add 3-D objects to a scene from a library and parameterize them via
their properties. Via the Data Stream property, you can connect a movable
object to a data stream.
Additionally, you can add observers to a scene, each one specifying a certain
viewpoint within the scene. You select up to four viewpoints to be displayed in
parallel during the animation of the scene.
Activating MotionDesk Although a MotionDesk project can contain several experiments, you can only
experiments work with one experiment at a time. To select an experiment for further
processing, you have to activate it.
Automating MotionDesk You can write scripts to control MotionDesk via a COM-based automation
interface. The AutomationDesk MotionDesk Access library uses this interface
to provide automation blocks for some basic MotionDesk features. The blocks
offer only the subset of the automation interface that is necessary to animate an
experiment's scene.
Introduction Note
8
AutomationDesk Accessing MotionDesk May 2024
Overview of the MotionDesk Access Library
Library overview The blocks of the library are grouped in folders which represent the object that
the blocks deal with.
Access via Exec block The audmotiondeskaccess Python module provides methods for the
MotionDesk Access automation 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.
Example
import audmotiondeskaccess
audmotiondeskaccess.OpenProjectAndExperiment( \
ProjectFile, "Experiment_002", SaveActiveProject="True")
Demo projects For an example of automating MotionDesk access, refer to the AutomationDesk
demo project at <DocumentsFolder>\MotionDesk Access.
References
9
May 2024 AutomationDesk Accessing MotionDesk
Basics and Instructions
Then the contained scene can be animated. The movement of its objects can
be controlled offline by reading a motion data file (MDF) or online by a running
simulation.
Preconditions § MotionDesk must be installed on the host PC. You need the same licenses as
to execute the tasks manually with MotionDesk.
§ The MotionDesk experiment must be completely specified, including the
scene, views and selected data source, so that it is ready to be animated.
§ If the MotionDesk experiment is configured to get the motion data from
a running simulation, the related simulation application must be loaded to
a registered platform and started. You can implement this, for example,
by using automation blocks from the XIL API Convenience library. For
instructions, refer to How to Download and Start a Simulation Application
(AutomationDesk Accessing Simulation Platforms ).
§ If the MotionDesk experiment is configured to get the motion data from an
MDF file, this file must exist.
§ The following information is required as input data:
§ The name and path of the MotionDesk project file (CDP) you want to open
§ The name of the MotionDesk experiment you want to access
10
AutomationDesk Accessing MotionDesk May 2024
How to Animate a MotionDesk Scene
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 MotionDesk project file and the experiment name.
5 Drag a StartAnimation block to your sequence. This starts displaying the
scene that is contained in the currently activated experiment.
6 Add the blocks to be executed during the animation, i.e., your use case, to
the sequence.
7 Drag a StopAnimation block to your sequence. This stops the animation.
8 Drag a CloseProjectAndExperiment block to your sequence. This closes
the active experiment and the MotionDesk project. The display of the scene
ends.
9 Drag a CloseMotionDesk block to your sequence. This closes the existing
MotionDesk instance.
Note
This will also close a MotionDesk instance that you started manually.
11
May 2024 AutomationDesk Accessing MotionDesk
Basics and Instructions
12
AutomationDesk Accessing MotionDesk May 2024
How to Animate a MotionDesk Scene
Tip
Basics on MotionDesk................................................................................................................. 7
Overview of the MotionDesk Access Library................................................................................ 8
References
CloseMotionDesk..................................................................................................................... 17
CloseProjectAndExperiment...................................................................................................... 20
OpenProjectAndExperiment...................................................................................................... 19
StartAnimation......................................................................................................................... 22
StartMotionDesk...................................................................................................................... 16
StopAnimation......................................................................................................................... 23
13
May 2024 AutomationDesk Accessing MotionDesk
Basics and Instructions
14
AutomationDesk Accessing MotionDesk May 2024
Reference Information
Reference Information
15
May 2024 AutomationDesk Accessing MotionDesk
Reference Information
Automation Blocks
Introduction The Signal-MotionDesk Access library is a custom library. It is write-protected to
prevent modifications to its blocks.
Using MotionDesk Access You can use functions and other definitions of the MotionDesk Access library
library features in Python in Python scripts after you imported the audmotiondeskaccess module to the
scripts current namespace.
Application.............................................................................................. 16
ProjectAndExperiment............................................................................. 18
WindowManagement.............................................................................. 21
SimulationManagement.......................................................................... 22
Application
Introduction The Application folder in the MotionDesk Access library provides blocks to
access the MotionDesk application.
StartMotionDesk..................................................................................... 16
To start MotionDesk.
CloseMotionDesk.................................................................................... 17
To close MotionDesk.
StartMotionDesk
Graphical representation
16
AutomationDesk Accessing MotionDesk May 2024
Automation Blocks
Note
Data objects This automation block provides the following data object:
Basics on MotionDesk................................................................................................................. 7
HowTos
References
CloseMotionDesk..................................................................................................................... 17
CloseMotionDesk
Graphical representation
17
May 2024 AutomationDesk Accessing MotionDesk
Reference Information
Description This block exits MotionDesk. You can specify whether to save the
modifications made during automated access. If MotionDesk is already closed,
AutomationDesk starts the MotionDesk application in invisible mode to close it
correctly afterwards.
Data objects This automation block provides the following data object:
Basics on MotionDesk................................................................................................................. 7
HowTos
References
StartMotionDesk...................................................................................................................... 16
ProjectAndExperiment
Introduction The ProjectAndExperiment folder in the MotionDesk Access library provides
blocks to access MotionDesk's projects and experiments.
OpenProjectAndExperiment..................................................................... 19
To load a project and activate an experiment.
CloseProjectAndExperiment..................................................................... 20
To close a MotionDesk project.
18
AutomationDesk Accessing MotionDesk May 2024
Automation Blocks
OpenProjectAndExperiment
Graphical representation
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 MotionDesk, any already loaded project is closed,
even if it is identical to the one to be started. You can specify whether to save
the project before it is closed.
Data objects This automation block provides the following data objects:
Basics on MotionDesk................................................................................................................. 7
HowTos
19
May 2024 AutomationDesk Accessing MotionDesk
Reference Information
References
CloseProjectAndExperiment...................................................................................................... 20
CloseProjectAndExperiment
Graphical representation
Description This block closes the active MotionDesk 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:
Basics on MotionDesk................................................................................................................. 7
HowTos
References
OpenProjectAndExperiment...................................................................................................... 19
20
AutomationDesk Accessing MotionDesk May 2024
Automation Blocks
WindowManagement
Introduction The WindowManagement folder in the MotionDesk Access library provides
blocks to control the appearance of MotionDesk's animations.
SelectViewMode
Graphical representation
Description This block lets you specify whether an animation is displayed in a window or in
full screen.
Before you execute this block, the related project and experiment must be
activated by using the OpenProjectAndExperiment block and the experiment's
scenes must be loaded.
Data objects This automation block provides the following data object:
OpenProjectAndExperiment...................................................................................................... 19
Sleep (AutomationDesk Basic Practices )
StartAnimation......................................................................................................................... 22
21
May 2024 AutomationDesk Accessing MotionDesk
Reference Information
SimulationManagement
Introduction The SimulationManagement folder in the MotionDesk Access library provides
blocks to control the execution of MotionDesk's animations.
StartAnimation........................................................................................ 22
To start an animation.
StopAnimation........................................................................................ 23
To stop a running animation.
StartAnimation
Graphical representation
Description This block starts the animation of the experiment that you opened before by
using the OpenProjectAndExperiment block.
References
StopAnimation......................................................................................................................... 23
22
AutomationDesk Accessing MotionDesk May 2024
Automation Blocks
StopAnimation
Graphical representation
Description This block stops an animation that you started by using the StartAnimation
block.
References
StartAnimation......................................................................................................................... 22
23
May 2024 AutomationDesk Accessing MotionDesk
Reference Information
24
AutomationDesk Accessing MotionDesk May 2024
Automation
Automation
Related information The AutomationDesk COM API provides no specific objects for accessing
MotionDesk. 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.
25
May 2024 AutomationDesk Accessing MotionDesk
Automation
26
AutomationDesk Accessing MotionDesk May 2024
Limitations
Limitations
Required MotionDesk version It is recommended to use MotionDesk 3.5 or later when you want to
remote‑control it via the MotionDesk Access library.
27
May 2024 AutomationDesk Accessing MotionDesk
Limitations
28
AutomationDesk Accessing MotionDesk May 2024
Index
Index
A
accessing MotionDesk
animating a scene 10
basics 7
libary overview 8
AutomationDesk library
MotionDesk Access 8
C
CloseMotionDesk 17
CloseProjectAndExperiment 20
closing
MotionDesk project 10
Common Program Data folder 6
D
Documents folder 6
L
libraries
MotionDesk Access 8
limitations
MotionDesk access 27
Local Program Data folder 6
M
MotionDesk access
limitations 27
MotionDesk Access library 8
animating a scene 10
closing MotionDesk 10
starting MotionDesk 10
MotionDesk project
closing 10
opening 10
O
opening
MotionDesk project 10
OpenProjectAndExperiment 19
S
SelectViewMode 21
StartAnimation 22
StartMotionDesk 16
StopAnimation 23
29
May 2024 AutomationDesk Accessing MotionDesk
Index
30
AutomationDesk Accessing MotionDesk May 2024