TestAutomationPythonModulesQuickReference
TestAutomationPythonModulesQuickReference
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
Introduction 7
General Warning............................................................................................. 7
Basics on the Test Automation Python Modules Quick Reference..................... 8
Naming Conventions....................................................................................... 9
Mapping of Data Types..................................................................... .............. 9
Module Reference 11
matlablib2 Quick Reference........................................................................... 11
3
May 2024 Test Automation Python Modules Quick Reference
Contents
4
Test Automation Python Modules Quick Reference May 2024
About This Reference
Content This reference provides quick access to information on the available objects,
object dependencies, attributes and methods of the Test Automation Python
Modules.
5
May 2024 Test Automation Python Modules Quick Reference
About This Reference
6
Test Automation Python Modules Quick Reference May 2024
Introduction
Introduction
General Warning....................................................................................... 7
Using the dSPACE software can have a direct effect on technical systems
(electrical, hydraulic, mechanical) connected to it.
Naming Conventions................................................................................. 9
General Warning
Danger potential Using dSPACE software can be dangerous. You must observe the following
safety instructions and the relevant instructions in the user documentation.
7
May 2024 Test Automation Python Modules Quick Reference
Introduction
produces a direct effect on the technical system via the controlling application
that uses the automation interface.
§ Only persons who are qualified to use dSPACE software, and who have been
informed of the above dangers and possible consequences, are permitted to
use this software.
§ All applications where malfunctions or operating errors involve the danger
of injury or death must be examined for potential hazards by the user, who
must if necessary take additional measures for protection (for example, an
emergency off switch).
Data loss during operating The shutdown procedure of Microsoft Windows operating systems causes some
system shutdown required processes to be aborted although they are still being used by dSPACE
software. To avoid data loss, the dSPACE software must be terminated manually
before a PC shutdown is performed.
Introduction This Test Automation Python Modules Quick Reference presents every dSPACE-
specific Python module of dSPACE Test Automation in tabular form. Object
information contained in the Test Automation Python Modules Reference is
summarized in a set of compact tables, each of which provides a quick overview
of the available objects, object dependencies, attributes and methods.
For detailed information on attributes and methods, refer to the Test Automation
Python Modules Reference .
Naming conventions An overview of the symbols used in this quick reference can be found under
Naming Conventions on page 9.
Data types For a mapping of the data types as used in this quick reference to the Python
data types, see Mapping of Data Types on page 9.
8
Test Automation Python Modules Quick Reference May 2024
Naming Conventions
Overview The table gives an overview of the object model provided by the Test Automation
Python Modules:
Purpose See
To exchange data between MATLAB and the Python Interpreter, invoke MATLAB matlablib2 Quick Reference on page 11
functions or access the MATLAB file format (MAT files).
Note
Obsolete functions and attributes are not described in this quick reference.
These functions and attributes are described in the Test Automation Python
Modules Reference for compatibility reasons. We strongly recommend
you do not use obsolete functions, because they will not be available in
future versions.
Packaging and licences For more information on packages and licences, refer to Introduction to
the Python Modules for Test Automation (Test Automation Python Modules
Guide ).
Naming Conventions
Naming conventions The following symbols are used in this quick reference:
Symbol Description
Method, function
Attribute (property, class)
Level of dependency (0 … 9)
Data types The following data types are used in the quick reference:
9
May 2024 Test Automation Python Modules Quick Reference
Introduction
10
Test Automation Python Modules Quick Reference May 2024
Module Reference
Module Reference
Overview For the usage of the matlablib2 module, refer to Examples of Using matlablib2
(Test Automation Python Modules Reference ).
matlablib2
CellArray
CellArray(list ListOfDimensionSizes) or (int N1, int N2, int N3)
int_list GetDimensions()
various1) GetItem(int_list IndexList) or (int I1, int I2, int I3)
int GetNumberOfDimensions()
None SetItem(int_list IndexList, various1) Value) or (int I1, int I2, int I3, various1)
Value)
Matfile
Matfile()
None Close()
None DeleteArray(string NameOfArray)
various1) GetArray(string NameOfArray)
string_list GetDir()
None Load()
None Open(string FileName, string Mode, boolean ConvertToDouble)
None PutArray(string NameOfArray, various1) Value)
None PutArrayAsGlobal(string NameOfArray, various1) Value)
string Whos()
Matlab
Matlab()
tuple_list (string, int) ConnectedMATLABInstallations
string ExecutablePath
tuple (int, string, string) IsMUMatlabOpen
11
May 2024 Test Automation Python Modules Quick Reference
Module Reference
matlablib2
int ProcessArchitecture
int ProcessID
string Version
int WatchdogMethod
None Close(boolean DisconnectOnly)
None Execute(string Command)
various1) GetArray(string ArrayName)
string GetOutputs()
boolean IsAlive()
None Open(boolean ConvertToDouble, int StartNewMLInst, int OpenFlags, string
StartCommands, string MLStartupDir, string MLInstallDir)
None PutArray(string ArrayName, various1) Value)
1) The mapping between the MATLAB array class and the Python type is described in
Interfacing MATLAB (matlablib2) (Test Automation Python Modules Reference ).
12
Test Automation Python Modules Quick Reference May 2024