Scripting in Puma Open Avl Puma Open 201 PDF [PDF]

  • 0 0 0
  • Gefällt Ihnen dieses papier und der download? Sie können Ihre eigene PDF-Datei in wenigen Minuten kostenlos online veröffentlichen! Anmelden
Datei wird geladen, bitte warten...
Zitiervorschau

03/2015 AT4105E, Rev. 24

User´s Guide

SCRIPTING IN PUMA OPEN AVL PUMA OPEN 2012 PUMA Open v1.5.3

Copyright 2015 AVL List GmbH, Graz - Austria The contents of this document may not be reproduced in any form or communicated to any third party without the prior written consent of AVL. While every effort is made to ensure its correctness, AVL assumes no responsibility neither for errors and omissions which may occur in this document nor for damage caused by them. All mentioned trademarks or registered trademarks are owned by their respective owners. All rights reserved.

Table of Contents

Table of Contents 1 What You Should Know.................................................................................................... 7 1.1

Safety Instructions .................................................................................................................... 7

1.2

Intended Application ................................................................................................................. 7

1.3

Product Version ........................................................................................................................ 8

1.4

Product-specific Information ..................................................................................................... 8

1.5

About this Documentation ........................................................................................................ 8 1.5.1 Abbreviations and Glossary Terms..................................................................................... 9 1.5.2 Typographic Conventions ................................................................................................... 9 1.5.3 Online Help ....................................................................................................................... 10 1.5.4 We Want to Hear from You............................................................................................... 10

2 Scripting in BSQ/SSQ ..................................................................................................... 11 2.1

Script Context Elements in Detail ........................................................................................... 11

2.2

Standard Elements of a Script Context .................................................................................. 12 2.2.1 Editing Scripts ................................................................................................................... 14

2.3

Creating and Setting Up Script Contexts................................................................................ 16

2.4

Activating Scripts in BSQ/SSQ ............................................................................................... 17 2.4.1 Via Script Context ............................................................................................................. 17 2.4.2 Via Script Activation Command ........................................................................................ 19

2.5

Copying Script Contexts ......................................................................................................... 20

2.6

Modifying Scripts .................................................................................................................... 20 2.6.1 Delete Script Context ........................................................................................................ 20 2.6.2 Delete Script Function from a Script Context.................................................................... 20 2.6.3 Modify Signature of a Script.............................................................................................. 21

3 Activating Scripts via Other Components .................................................................... 23 3.1

Defining Script Contexts in the TFP, SYS and UUT Parameters ........................................... 23

3.2

Activating Scripts via POI ...................................................................................................... 23 3.2.1 Execute Script in Default Context .................................................................................... 24 3.2.2 Execute Script In User-Defined Context ........................................................................... 25

3.3

Using Script Functions to React to Limit Violations ............................................................... 25 3.3.1 Contents of the Script Context .......................................................................................... 26 3.3.2 Contents of the Script Functions....................................................................................... 27 3.3.3 Define Limit Monitoring ..................................................................................................... 27

4 Application Example ....................................................................................................... 29 4.1

Excel File ................................................................................................................................ 29

AVL PUMA Open 2012 — Scripting in PUMA Open

3

4

Table of Contents

4.2

Test Procedure ....................................................................................................................... 31

4.3

Script Context ......................................................................................................................... 31

4.4

Contents of the Script Functions ............................................................................................ 32

4.5

Contents of the Script Context................................................................................................ 33

5 Testing and Debugging................................................................................................... 37 5.1

Interactive Testing via the System Explorer ........................................................................... 37

5.2

Step-by-step Testing in the BSQ ............................................................................................ 39

5.3

Debugging .............................................................................................................................. 40 5.3.1 Use Messages and Tracer Windows ................................................................................40 5.3.2 Use MSTM Script Debugger ..............................................................................................41 5.3.3 Open Script Debugger ......................................................................................................42 5.3.4 Debugging of the Script Context's Setup Function ...........................................................44 5.3.5 Set Breakpoints .................................................................................................................44 5.3.6 Values of Variables ...........................................................................................................45

6 Functions of the PUMA Open Script API....................................................................... 49 6.1

Operator Interface .................................................................................................................. 49 6.1.1 Operator Interface .............................................................................................................49 6.1.2 Managed Dialogs ..............................................................................................................61 6.1.3 Manual Data Entry ............................................................................................................62

6.2

Dataflow.................................................................................................................................. 63 6.2.1 Filter Functions..................................................................................................................63 6.2.2 Flexible Parameters ..........................................................................................................67 6.2.3 Formula Calculator ............................................................................................................68 6.2.4 Lookup Table ....................................................................................................................69 6.2.5 Multi Function Generator...................................................................................................79

6.3

General Purpose Control........................................................................................................ 80 6.3.1 PID Control........................................................................................................................81 6.3.2 Test Cell Controller ...........................................................................................................83 6.3.3 Test Cell Devices ..............................................................................................................87 6.3.4 Two/Three Point Control ...................................................................................................88

6.4

I/O Sub-System ...................................................................................................................... 90 6.4.1 ASAP2 CAN ......................................................................................................................90 6.4.2 CanOpen-PressureiN ........................................................................................................94 6.4.3 FEM-AnalogIn ...................................................................................................................94 6.4.4 FEM-CounterIn..................................................................................................................94 6.4.5 FFEM-AnalogIn .................................................................................................................95 6.4.6 FFEM-CounterIn ...............................................................................................................95 6.4.7 FFEM-FastAnalogIn ..........................................................................................................95 6.4.8 GSS-AnalogIn ...................................................................................................................95 6.4.9 EMC-AccService ...............................................................................................................95

6.5

Channel Access...................................................................................................................... 95 6.5.1 System Channel ................................................................................................................95

AVL PUMA Open 2012 — Scripting in PUMA Open

Table of Contents

6.6

Measurement Device............................................................................................................ 113 6.6.1 Emission bench 1/2/3 (VDOS) ........................................................................................ 113 6.6.2 KMA 4000 ....................................................................................................................... 121 6.6.3 Fuel balance S730 (VDOS) ............................................................................................ 125 6.6.4 Particle Sampler (VDOS) ................................................................................................ 126 6.6.5 PLU4000 Fuel Meter....................................................................................................... 126 6.6.6 Fuel balance P730 (VDOS) ............................................................................................ 128 6.6.7 Indicating device I670 (VDOS)........................................................................................ 128 6.6.8 AVL403S......................................................................................................................... 129 6.6.9 CVS (CDH) ..................................................................................................................... 135 6.6.10 AVL415, AVL415S (CDH)............................................................................................... 141 6.6.11 AVL 442 (CDH) ............................................................................................................... 146 6.6.12 AVL 439 (CDH) ............................................................................................................... 150 6.6.13 AVL 472 (CDH) ............................................................................................................... 159 6.6.14 AVL733S......................................................................................................................... 165 6.6.15 AVL 734 (CDH) ............................................................................................................... 170 6.6.16 AVL 735 (CDH) ............................................................................................................... 175 6.6.17 AVL740 (CDH) ................................................................................................................ 182 6.6.18 AVL753C (CDH) ............................................................................................................. 184 6.6.19 AVL CGM-CVS (CDH) .................................................................................................... 190 6.6.20 AVL CGS-CVS (CDH)..................................................................................................... 196 6.6.21 CGM-PTS (CDH) ............................................................................................................ 202 6.6.22 DEGUFLOW (CDH) ........................................................................................................ 205 6.6.23 Horiba CVS-7000 Standard (CDH) ................................................................................. 210 6.6.24 Horiba CVS-7000 for Bosch (CDH) ................................................................................ 216 6.6.25 Horiba CVS-9000 (CDH)................................................................................................. 222 6.6.26 Horiba PMU-7100 (CDH) ................................................................................................ 227 6.6.27 DiGas4000 ...................................................................................................................... 232 6.6.28 Configurable Device Handler .......................................................................................... 234 6.6.29 CVS Device..................................................................................................................... 236 6.6.30 Emission Bench Handler................................................................................................. 240 6.6.31 IndiCom .......................................................................................................................... 243 6.6.32 MCD3D ........................................................................................................................... 244 6.6.33 Combustion Analysis System ......................................................................................... 248 6.6.34 GDI ................................................................................................................................. 250 6.6.35 Power Analyzer............................................................................................................... 255 6.6.36 OCSPS ........................................................................................................................... 257

6.7

Measurement........................................................................................................................ 258 6.7.1 Drive ............................................................................................................................... 258 6.7.2 Magic Evaluation............................................................................................................. 259 6.7.3 Recorder ......................................................................................................................... 261 6.7.4 Steady State Measurement ............................................................................................ 271 6.7.5 External Recorder ........................................................................................................... 278

6.8

Online Analysis..................................................................................................................... 278 6.8.1 Concerto ......................................................................................................................... 278 6.8.2 Gem Open Offline ........................................................................................................... 280 6.8.3 Legal Cycle Services ...................................................................................................... 280 6.8.4 Regression Analysis ....................................................................................................... 280 6.8.5 Result Access ................................................................................................................. 281

6.9

Parameter Access ................................................................................................................ 311 6.9.1 Parameters ..................................................................................................................... 311 AVL PUMA Open 2012 — Scripting in PUMA Open

5

6

Table of Contents

6.10 UUT Control.......................................................................................................................... 317 6.10.1 EMCON Support .............................................................................................................317 6.10.2 Advanced UUT support ...................................................................................................317 6.10.3 Engine Electronic Interface .............................................................................................318 6.10.4 Testrun Executor .............................................................................................................343 6.10.5 Step Sequence Commands ............................................................................................345 6.10.6 EC-Recorder ...................................................................................................................346 6.10.7 MCD3D ...........................................................................................................................346 6.11 Chassis Dyno Control........................................................................................................... 348 6.11.1 Driver´s Aid .....................................................................................................................348 6.11.2 VECON ...........................................................................................................................351 6.12 Scripting................................................................................................................................ 355 6.12.1 Script Activation ..............................................................................................................355 6.13 Service.................................................................................................................................. 359 6.13.1 Dyno Access ...................................................................................................................359 6.14 Miscellaneous....................................................................................................................... 361 6.14.1 Common Commands ......................................................................................................361 6.14.2 CameoAgentConnection .................................................................................................372 6.14.3 Global resources .............................................................................................................372 6.14.4 Central Data ....................................................................................................................372 6.15 Monitoring............................................................................................................................. 373 6.15.1 Limit Monitoring ...............................................................................................................373 6.15.2 Operational Data Monitoring ...........................................................................................375 6.15.3 PostMortem .....................................................................................................................377 6.15.4 Reference Cycle Monitoring ............................................................................................377

7 Important Changes Since PO 1.2 ................................................................................. 379 Index............................................................................................................................................................ 381

AVL PUMA Open 2012 — Scripting in PUMA Open

What You Should Know

1

What You Should Know PUMA Open offers the possibility to use scripting also in automation systems. This enables users to access a selected set of functions of the automation system via these scripting components. The scripting components can also be accessed from the automation system (test run definition BSQ/SSQ and test cell control definition TCC). This allows users to extend the capabilities of the automation system on their own.

1.1

Safety Instructions This documentation contains important warnings and safety instructions that must be observed by the user. Smooth operation can only be ensured if the requirements are met and the safety instructions are followed. Information Scripting is based on functions provided by Microsoft in the MS Windows operating system.

NOTICE Script execution can seriously affect the performance of the test bed system by: 

lengthy mathematical operations



blocking requests via the network



intensive access to the file system



access to third-party software components that are not compatible with the test bed system, etc.

Thus it is recommended that scripts are developed by trained users only. Any damage is within the responsibility of the user!

NOTICE As the performance of the automation system can be affected seriously by scripting, administrator privileges are required to create, modify or delete script contexts. The use of existing script contexts in the BSQ, SSQ, etc., however, is not restricted by user rights.

1.2

Intended Application The product is only intended for the area of application which is described in the documentation. If used contrary to its intended purpose or if the requirements and safety measures mentioned are not observed, no guarantee and/or liability shall be assumed.

AVL PUMA Open 2012 — Scripting in PUMA Open

7

8

What You Should Know

1.3

1.4

Product Version Product version

AVL PUMA Open 2012

Internal version

PUMA Open v1.5.3

Product-specific Information Information Scripting is based on functions provided by Microsoft in the MS WindowsTM operating system. The MS Script Debugger can be found on Vendor CD1: 

VBScript documentation (part of the 'Microsoft WindowsTM Script 5.6 Documentation'):

MS\Scripting\scrdoc56en.exe

Information Part of the automation system's functionality is excluded from use in scripts, e.g: 

Steady-state step sequences



Dynamic step sequences

Road profiles

Information For information on the functions that may be used in scripts, refer to the documentation "Activation Objects".

1.5

About this Documentation Target group

This manual has been written to assist users (test run preparators, application engineers, test bed operators) in creating scripts and script contexts in PUMA Open. Simple examples are given which illustrate and describe the procedures clearly and in detail.

Contents and scope

The manual provides information on the following topics:

Secondary literature



Scripting in BSQ/SSQ on page 11.



Activating Scripts via Other Components on page 23.



Application Example on page 29



Testing and Debugging on page 37

For information on the functions that may be used in scripts, refer to the documentation BSQ and Toolbox

AVL PUMA Open 2012 — Scripting in PUMA Open

What You Should Know

1.5.1

1.5.2

Abbreviations and Glossary Terms AO

Activation Object

BSQ

Block Sequence Editor

POI

PUMA Open Interface

TCC

Test Cell Control

SSQ

Step Sequence Editor

SOX

System Explorer

Typographic Conventions The following symbols and standard text styles are used within this document: NOTICE This text indicates situations or operation errors which could result in property damage or data loss.

Information This text indicates important information or operating instructions. Not observing these instructions could inhibit or impede you from successfully completing the tasks described in this documentation. Example This text gives an example. Standard text styles: Bold

Parameters; control elements in windows and dialog boxes; important text

Italics

Cross-references; foreign-language or new terms; wild-card for elements that need to be entered by the user, i.e. characters or text. If you read, for example, macro name, you are required to type the name of a macro.

UPPERCASE LETTERS

Operating modes

Courier

Programming examples; source code

Times New Roman

Formulas

Menu | Option

Description of how to select a menu item from a given menu

Lists: 1.

Step-by-step procedures with a given sequence

2. •

One-step instructions



Unordered series of concepts, items or options



– –

AVL PUMA Open 2012 — Scripting in PUMA Open

9

10

What You Should Know

1.5.3

Online Help This printed manual is also available as online Help. To access online Help: 

open the PUMA Open Help menu

or press the [F1] key for context-sensitive help.

1.5.4

We Want to Hear from You Your comments and suggestions help us to improve the quality and practical relevance of our manuals. If you have any suggestions for improvement, please send them to: [email protected] We look forward to hearing from you!

AVL PUMA Open 2012 — Scripting in PUMA Open

Scripting in BSQ/SSQ

2

Scripting in BSQ/SSQ Scripts for customer-defined applications are provided by means of individual "script contexts" in PUMA Open. These contexts are embedded into the PO Script API and constitute a separate execution environment with its separate thread (i.e. script contexts can operate in parallel), variable space (context-local variables) and function space (context-local helper functions and subroutines). Based on the definition of such a context, the customer can define scripts that can directly be invoked within the BSQ or SSQ.

2.1

Script Context Elements in Detail 

Any execution context has its own individual "context-local" variables. They can neither be seen from other contexts nor from the global PUMA Open "variable space" that is formed by all of the normnames. Although these variables are referred to as "context-local" variables, they are "global" for all scripts that are defined for that context. Variables in the context are defined using the statement "Dim": Dim A Dim B Dim C .....



A default "Initialize" and "Terminate" sub-routine can be defined to initialize and release global variables. "Initialize" is executed before the system enters the state that is capable of running a test (MANUAL). "Terminate" is executed shortly before MANUAL mode is about to be left for MONITOR mode. Sub Initialize ( ) .... End Sub Sub Terminate ( ) End Sub



Any execution context can have its own set of individual "helper scripts" that are organized in functions and sub-routines. These user-defined helpers can be accessed from script functions in addition to the functions of the PUMA Open Script API. Function xyz (...) .... End Function Sub uvw (...) .... End Sub

AVL PUMA Open 2012 — Scripting in PUMA Open

11

12

Scripting in BSQ/SSQ

2.2

Standard Elements of a Script Context The figure below shows the script context editor:

Fig. 1 Name

Description

Range

Name

Name of script context

Up to 32 characters

Description

Purpose of script context

-

Edit Context...

Opens an editor for the base script, which contains global variable definitions, Initialize and Terminate subroutines as well as user-defined help functions.

-

Add new script function to context

Up to 32 characters

Remove script function

-

Description of currently selected script function

Up to 1000 characters

Box "Context"

Box "Scripts"

Description Box "Parameters" Tab. 1

AVL PUMA Open 2012 — Scripting in PUMA Open

Scripting in BSQ/SSQ

Name

Description

Range

Add new parameter in the Name box

-

Remove parameter in the Name box

-

Define parameter sequence

-

Name

Shows the names of the arguments of the selected script function.

Up to 32 characters

Default Value

Values for the arguments are entered. However, there is no checking of types or values.

-

Note: The values and value types are interpreted according to the script definitions. For example, type "String" parameters can be interpreted as normnames internally in the script and, with the relevant functions, be used to access normnames. Monitor Timeout

Script execution time-out in seconds can be entered in the input box. The valid range is 1 ") If UBound(ChannelPair,1) > 0 Then TheMappingTable(i,0) = ChannelPair(0) TheMappingTable(i,1) = ChannelPair(1) Else TheMappingTable(i,0) = ChannelPair(0) TheMappingTable(i,1) = ChannelPair(0) End If TheMappingTable(i,2) = -1 TheMappingTable(i,3) = 0 Next

For i = 0 To UBound(TheMappingTable, 1) For j = 0 To UBound(ChannelList,1) If TheMappingTable(i,0) = ChannelList(j) Then TheMappingTable(i,2) = j Exit For End If Next Next

'DebugMappingTable End Sub

Private Sub ChangeMappingTableIndex(ChannelList) '''' ' If the list of measurement changes dynamically their indices ' have to be reconfigured. '''' Dim i,j For i = 0 To UBound(TheMappingTable, 1)

AVL PUMA Open 2012 — Scripting in PUMA Open

291

292

Functions of the PUMA Open Script API

TheMappingTable(i,2) = -1 TheMappingTable(i,3) = 0 For j = 0 To UBound(ChannelList,1) If TheMappingTable(i,0) = ChannelList(j) Then TheMappingTable(i,2) = j Exit For End If Next Next

'DebugMappingTable End Sub

Private Sub ChangeMappingTableValue(ValueList) '''' ' According to the specified indices, entries in the value list ' are taken and stored in the mapping table. '''' Dim i For i = 0 To UBound(TheMappingTable, 1) If TheMappingTable(i,2) >= 0 Then TheMappingTable(i,3) = ValueList(TheMappingTable(i,2)) Else TheMappingTable(i,3) = Empty End If Next

'DebugMappingTable End Sub

Private Sub DebugMappingTable() Dim i, str For i = 0 To UBound(TheMappingTable, 1) str = str & TheMappingTable(i,0) & " -> " & _ TheMappingTable(i,1) & " (" & TheMappingTable(i,2) & "): " If IsEmpty(TheMappingTable(i,3)) Then str = str & "Empty" & vbCrLf ElseIf TheMappingTable(i,3) >= 1E10 Then str = str & "1E10" & vbCrLf Else str = str & TheMappingTable(i,3) & vbCrLf End If Next MsgBox str End Sub

Private Sub OutputMappingTable() Dim i For i = 0 To UBound(TheMappingTable, 1) If TheMappingTable(i,2) >= 0 Then

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

If IsEmpty(TheMappingTable(i,3)) Or TheMappingTable(i,3) >= 1E10 Then ChnSetStatus TheMappingTable(i,1), 4 'ePoOverFlow Else ChnSetStatus TheMappingTable(i,1), 0 'ePoOk ChnSet TheMappingTable(i,1), TheMappingTable(i,3) End If End If Next

' Just give the replication to VDOS some time CmnWait 0.250 End Sub End Class

6.8.5.9

ResAccessAttach Includes a specified measurement in the database and assigns an ID to it that iterates in the measurement recording later on. Parameters

Description

Key

Identifies the iterator in subsequent operations. 

MeasurementName

String.

Name of the measurement in the database for which you want to attach an iterator. If no structured name is specified, the following naming conventions apply: 



It is assumed that the referenced measurement is part of the current test run and the current test series (Note: The current project is implicitly determined by the test series). If there are different versions of the same measurement, the current version is automatically selected.

Valid structured measurement names include: Measurement[.MeasurementVersion]Test[.TestVersion]\Measurement[.MeasurementVersion] TestSeries\Test[.TestVersion]\Measurement[.MeasurementVersion] Project\TestSeries\Test[.TestVersion]\Measurement[.Mea surementVersion] 

String.

Script function/command: Sub ResAccessAttach(Key, MeasurementName)

6.8.5.10

ResAccessDetach Launches a predefined iterator.

AVL PUMA Open 2012 — Scripting in PUMA Open

293

294

Functions of the PUMA Open Script API

Parameters

Description

Key

Identifies the iterator in subsequent operations. 

String.

Script function/command: Sub ResAccessDetach(Key)

6.8.5.11

ResAccessSetPosition Positions the iterator within the measurement records. Parameters

Description

Key

Identifies the iterator. 

Position

String.

Positions the iterator within the measurement record. 

Numeric value.



0…start



-1…end of file

Script function/command: Sub ResAccessSetPosition(Key, Position)

6.8.5.12

ResAccessGetPosition Retrieves the current position of the iterator within the measurement records. If the iterator points to the beginning, it will return "0", if it points to the end, it will return "-1". Parameters

Description

Key

Identifies the iterator. 

String.

Script function/command: Function ResAccessGetPosition(Key)

6.8.5.13

ResAccessNext Retrieves a number of records from the measurement. The result is given as a two-dimensional array. After being called up, the iterator points to the position in the record that follows the last returned record. If no further record exists, the iterator points to "EOF".

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Parameters

Description

Key

Identifies the iterator. 

NumberOfRecords

String.

Number of records to be returned. If there are actually fewer records than specified here, the number of records will automatically be reduced. 

Numeric value.

Script function/command: Function ResAccessNext(Key, NumberOfRecords)

6.8.5.14

ResAccessGetRecordCnt Retrieves the specified number of records within the measurement. Parameters

Description

Key

Identifies the iterator. 

String.

Script function/command: Function ResAccessGetRecordCnt(Key)

6.8.5.15

ResAccessGetChannelList Retrieves the list of measurement channel names. The result is given as a one-dimensional array. Parameters

Description

Key

Identifies the iterator. 

String.

Script function/command: Function ResAccessGetChannelList(Key)

6.8.5.16

Example of ResStorage The set of functions below allows measurement structures to be created in the AODS database: ResStorageOpen(Key, DiaryType, ResultName) ResStorageAppend(Key, DiaryType, ResultName) ResStorageClose(Key) ResStorageDefine(Key, ByVal NameList, ByVal SystemNameList, ByVal DataTypeList) ResStorageStore(Key, DoNotCache, ByVal ValueList, ByVal StatusList) ResStorageFlush(Key) ResStorageGetResultName(Key) ResStorageGetDiaryType(Key) ResStorageGetNameList(Key) ResStorageGetSystemNameList(Key) ResStorageGetDataTypeList(Key) ResStorageAttach(Key)

AVL PUMA Open 2012 — Scripting in PUMA Open

295

296

Functions of the PUMA Open Script API

ResStorageDetach(Key)

This is what a typical sequence of a store operation looks like: ResStorageOpen(…) ResStorageDefine(…) ResStorageStore(…) : ResStorageStore(…) ResStorageClose(…)

Alternative sequences may be: ResStorageOpen(…) ResStorageDefine(…) ResStorageStore(…) : ResStorageFlush(…) : ResStorageStore(…) ResStorageClose(…)

or: ResStorageOpen(…) ResStorageDefine(…) ResStorageStore(…) : ResStorageDefine(…) : ResStorageStore(…) ResStorageClose(…)

6.8.5.17

ResStorageOpen Opens a new version of the specified measurement structure in the database within the specified diary and creates an access object for it. Parameters

Description

Key

Identifies the storage access object.

DiaryType

Specifies whether the measurement is to be associated with the 'unit under test' (e.g. engine diary), the test bed (e.g. test bed diary) or the test. Admissible values: eRATest = 0 eRAUnitUnderTest = 1 eRATestbed = 2

ResultName

Name of the measurement in the database.

Script function/command: Sub ResStorageOpen(Key, DiaryType, ResultName)

Example ResStorageOpen "MyStorage", eRAUnitUnderTest, "MyUUTLogBook"

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

6.8.5.18

ResStorageAppend If a measurement has not been stored ("sealed") in the database yet (i.e. the 'iCompleteFlag' not yet set to '1'), this request re-opens the database and allows further data to be stored in it. Information If the measurement has already been stored, a new version of the measurement will be created. Parameters

Description

Key

Identifies the storage access object.

DiaryType

Specifies whether the measurement is to be associated with the 'unit under test' (e.g. engine diary), the test bed (e.g. test bed diary) or the test. Admissible values: eRATest = 0 eRAUnitUnderTest = 1 eRATestbed = 2

ResultName

Name of the measurement in the database.

Script function/command: Sub ResStorageAppend(Key, DiaryType, ResultName)

Example ResStorageAppend "MyStorage", eRAUnitUnderTest, "MyUUTLogBook"

6.8.5.19

ResStorageClose Closes the selected measurement and sets the 'iCompleteFlag' attribute for that measurement in the database, i.e. it "seals" the measurement. Parameters

Description

Key

Identifies the storage access object.

Script function/command: Sub ResStorageClose(Key)

Example ResStorageClose "MyStorage"

6.8.5.20

ResStorageDefine Specifies the channels that are to be stored in the selected measurement with subsequent 'ResStorageStore' requests.

AVL PUMA Open 2012 — Scripting in PUMA Open

297

298

Functions of the PUMA Open Script API

Parameters

Description

Key

Identifies the storage access object.

NameList

List of channel names.

SystemNameList

List of system names given in the same sequence as the channel list. Important: The system names of system channels can be retrieved using the 'ChnGetSystemName' function.

DataTypeList

List of data types given in the same sequence as the channel list. Valid data types: · eSCTLong = &H0003 · eSCTFloat = &H0004 · eSCTDouble = &H0005 · eSCTString = &H0006 Important: The data type of system channels can be retrieved using the 'ChnGetDataType' function.

Script function/command: Sub ResStorageDefine(Key, NameList, SystemNameList, DataTypeList)

Example Dim i, MyChannelList(2), MySystemNameList(2), MyDatatypeList(2) MyChannelList(0) = "SPEED" MyChannelList(1) = "TORQUE" MyChannelList(2) = "ALPHA" For i = 0 To 2 MySystemNameList(i) = ChnGetSystemName(MyChannelList(i)) MyDatatypeList(i) = ChnGetDataType(MyChannelList(i)) Next ResStorageDefine "MyStorage", MyChannelList, MySystemNameList, MyDatatypeList

6.8.5.21

ResStorageStore Stores the specified list of values along with the associated status information in the database. Information In the case of values with status = 'NotOk', a value of 1e10 is stored in the database.

Information Since the 'ResStorageStore' request stores a given result record directly in the database, the system load increases significantly if this function is used regularly. To reduce the load, use the internal Cache Option and store all accumulated records from time to time using the 'RecStorageFlush' function.

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Parameters

Description

Key

Identifies the storage access object.

DoNotCache

Specifies whether or not the values are to be stored immediately in the database. Admissible values: 

eRADoCache = 0



eRADoNotCache = 1

ValueList

Array of values in the same order as the channel list that has been defined in the 'ResStorageDefine' request.

StatusList

Array of values in the same order as the channel list that has been defined in the 'ResStorageDefine' request. Admissible values: 

Ok = 0



NotOk 0

Script function/command: Sub ResStorageStore(Key, DoNotCache, ValueList, StatusList)

Example Dim ValueList(2), StatusList(2) For i = 0 To 2 ValueList(i) = ChnGet(MyChannelList(i)) StatusList(i) = ChnGetStatus(MyChannelList(i)) Next ResStorageStore "MyStorage", eRADoCache, ValueList, StatusList

6.8.5.22

ResStorageFlush In the case of storage requests that do not have set the 'DoNotCache' attribute it is necessary to finally store them in the database. Information An implicit 'ResStorageFlush' request should be made before the 'ResStorageClose' request, if necessary Parameters

Description

Key

Identifies the storage access object.

Script function/command: Sub ResStorageFlush(Key)

Example ResStorageFlush "MyStorage"

AVL PUMA Open 2012 — Scripting in PUMA Open

299

300

Functions of the PUMA Open Script API

6.8.5.23

ResStorageGetResultName Retrieves the name of the measurement that has been specified for the specified storage access object in the last 'RecStorageOpen' or 'RecStorageAppend' request. Information If the request is issued before the RecStorageOpen' or 'RecStorageAppend' request, the string "not yet specified" will be returned. Parameters

Description

Key

Identifies the storage access object.

Script function/command: Function ResStorageGetResultName(Key)

Example Dim ResultName ResultName = ResStorageGetResultName("MyStorage") MsgBox "ResultName:" & vbCrLf & ResultName

6.8.5.24

ResStorageGetDiaryType Retrieves the type of diary to which the measurement belongs that has been specified for the storage access object with the last 'RecStorageOpen' or 'RecStorageAppend' request. Information If the request is issued before the RecStorageOpen' or 'RecStorageAppend' request, the value -1 will be returned Parameters

Description

Key

Identifies the storage access object.

Script function/command: Function ResStorageGetDiaryType(Key)

Example Dim Diary, DiaryType DiaryType = ResStorageGetDiaryType("MyStorage") Select Case DiaryType Case eRATest Diary = "TST" Case eRAUnitUnderTest Diary = "UUT" Case Else 'eRATestbed Diary = "SYS" End Select MsgBox "Diary:" & vbCrLf & Diary

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

6.8.5.25

ResStorageGetNameList Retrieves the list of all channel names from the selected access object that were specified in the last 'ResStorageDefine' request. Parameters

Description

Key

Identifies the storage access object.

Script function/command: Function ResStorageGetNameList(Key)

Example Dim ChannelList, I, ListString ChannelList = ResStorageGetNameList("MyStorage") For i = 0 to Ubound(ChannelList,1) ListString = ListString & vbCrLf & ChannelList(I) Next MsgBox "NameList:" & vbCrLf & ListString

6.8.5.26

ResStorageGetSystemNameList Retrieves the list of all system names for all channels from the selected access object that were specified in the last 'ResStorageDefine' request. Parameters

Description

Key

Identifies the storage access object.

Script function/command: Function ResStorageGetSystemNameList(Key)

Example Dim ChannelList, I, ListString ChannelList = ResStorageGetSystemNameList("MyStorage") For i = 0 to Ubound(ChannelList,1) ListString = ListString & vbCrLf & ChannelList(I) Next MsgBox "SystemNameList:" & vbCrLf & ListString

6.8.5.27

ResStorageGetDataTypeList Retrieves the list of all data type identifiers for all channels from the selected access object that were specified in the last 'ResStorageDefine' request. Parameters

Description

Key

Identifies the storage access object.

Script function/command: Function ResStorageGetDataTypeList(Key)

AVL PUMA Open 2012 — Scripting in PUMA Open

301

302

Functions of the PUMA Open Script API

Example Dim DataTypeList, i, ListString DataTypeList = ResStorageGetDataTypeList("MyStorage") For i = 0 to Ubound(ChannelList,1) ListString = ListString & vbCrLf & DataTypeList(i) Next MsgBox "DataTypeList:" & vbCrLf & ListString

6.8.5.28

ResStorageAttach Creates a new storage access object. Information If an access object with the same key already exists, a new object is created. Parameters

Description

Key

Identifies the storage access object.

Script function/command: Sub ResStorageAttach(Key)

Example DResStorageAttach "MyStorage"

6.8.5.29

ResStorageDetach Releases the specified access object. Information Releasing the access object neither 'flushes' any pending result record nor does it close the measurement in the database. Parameters

Description

Key

Identifies the storage access object.

Script function/command: Sub ResStorageDetach(Key)

Example ResStorageDetach "MyStorage"

6.8.5.30

ResStorageDSTs Retrieves the number of defined data storage tables and a list of their names.

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Parameters

Description

DSTList

Contains the names of the defined data storage tables.

ReturnValue

Number of data storage tables.

Script function/command: Function ResStorageDSTs(DSTList)

Example Dim NumberOfDSTs Dim DSTList() Dim i

NumberOfDSTs = ResStorageDSTs(DSTList) For i = 0 To NumberOfDSTs -1 MsgBox DSTList(I) Next

6.8.5.31

ResStorageDSTChannels Retrieves the number of defined channels as well as their channel names, system names and data types. Parameters

Description

Index

Index of data storages tables or of their names.

ChannelList()

Contains all channel names included in the data storage table.

SystemNameList()

Contains all system names included in the data storage table.

DataTypeList()

Contains all data types of the channels included in the data storage table.

Script function/command: Function ResStorageDSTChannels(Index, ChannelList, _ SystemNameList, DataTypeList)

AVL PUMA Open 2012 — Scripting in PUMA Open

303

304

Functions of the PUMA Open Script API

Example Dim NumberOfChannels Dim ChannelList() Dim SystemNameList() Dim DataTypeList() Dim i

NumberOfChannels = ResStorageDSTChannels(4, ChannelList, SystemNameList, DataTypeList) For i = 0 To NumberOfChannels-1 MsgBox ChannelList(i) & "/" & SystemNameList (i) & "/" & DataTypeList(i) Next

NumberOfChannels = ResStorageDSTChannels("ENGINMAP", ChannelList, SystemNameList, DataTypeList) For i = 0 To NumberOfChannels-1 MsgBox ChannelList(i) & "/" & SystemNameList (i) & "/" & DataTypeList(i) Next

Application example

During a test run, additional information on the environmental conditions under which the test is run is to be stored in a separate measurement in the database. This measurement is associated to the Test Diary. The solution is provided by means of a specific script context that can be used from BSQ/SSQ or even interactively from SOX and POI. This script context includes the following three functions: 

Open



Snapshot



Close

Script function "Open"

Opens a new measurement with the name "Name" within the diary ["TST", "SYS", "UUT"] and with a list of specific channels that are defined via the "Channels" attribute. The channels in the channel list are separated by ",". With the "StorageMode" attribute you determine that the snapshots will be stored in the database [0...upon "Close", 1...immediately].

Script function "Snapshot" Script function "Close" Contents of the script context

Takes a snapshot of all channels specified in the channel list. Closes (and saves) the measurement. Dim MyStorage Const MyKey = "MyStorage"

Public Sub Initialize() Set MyStorage = New Storage End Sub

Public Sub Terminate() Set MySTorage = Nothing End Sub

Class Storage

Dim MyStorageMode Dim MyMaxIndex

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Dim MyChannelList Dim MySystemNameList() Dim MyDatatypeList()

Private Sub Class_Initialize() End Sub

Private Sub Class_Terminate() End Sub

Sub Open(Diary, Name, Channels, StorageMode) ' ' Keep the storage mode for later usage ' MyStorageMode = StorageMode ' ' Create a storage access object ' ResStorageAttach MyKey ' 'Determine diary type and open the measurement within it ' Dim DiaryType Select Case Diary Case "TST" DiaryType = eRATest Case "UUT" DiaryType = eRAUnitUnderTest Case Else '"SYS" DiaryType = eRATestbed End Select ResStorageOpen MyKey, DiaryType, Name ' ' Create the channel list, and retrieve ' system names And data types For all of them ' MyChannelList = Split(Channels, ",") MyMaxIndex = UBound(MyChannelList,1)

ReDim MySystemNameList(MyMaxIndex) ReDim MyDatatypeList(MyMaxIndex)

Dim i For i = 0 To MyMaxIndex MySystemNameList(i) = ChnGetSystemName(MyChannelList(i)) MyDatatypeList(i) = ChnGetDataType(MyChannelList(i)) Next ' ' Configure the already existing measurement

AVL PUMA Open 2012 — Scripting in PUMA Open

305

306

Functions of the PUMA Open Script API

' ResStorageDefine MyKey, MyChannelList, MySystemNameList, MyDatatypeList End Sub

Sub Snapshot() ' ' Retrieve values and status information for all channels ' Dim MyValues Dim MyStatus ReDim MyValues(MyMaxIndex) ReDim MyStatus(MyMaxIndex) Dim i For i = 0 To MyMaxIndex MyValues(i) = ChnGet(MyChannelList(i)) MyStatus(i) = ChnGetStatus(MyChannelList(i)) Next ResStorageStore MyKey, MyStorageMode, MyValues, MyStatus End Sub

Sub Close() ' ' Store any unstored data and close the measurement ' ResStorageFlush MyKey ResStorageClose MyKey ' ' Release the access object ' ResStorageDetach MyKey End Sub End Class

Information The functions described below are not designed to be used via script contexts. However, they can be used internally from the PUMA Open system.

6.8.5.32

Mounting a 'Unit Under Test' Selects the specified unit under test and identifies it as "mounted on this test bed" in the database. Parameters

Description

UnitUnderTest

Identifies the unit under test. String.

Script function/command: Sub ResMountUnitUnderTest(UnitUnderTest)

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Example ResMountUnitUnderTest "MB104C44"

6.8.5.33

Dismounting a 'Unit Under Test' Cancels the identification as "unit under test" in the database. Parameters

Description

UnitUnderTest

Identifies the unit under test. String.

Script function/command: Sub ResDismountUnitUnderTest(UnitUnderTest)

Example ResDismountUnitUnderTest "MB104C44"

6.8.5.34

Get Mounted 'Unit Under Test' Retrieves the name of the unit under test that is used for the current test bed in the database. Script function/command: Function ResGetMountedUnitUnderTest()

Example Dim UnitUnderTest UnitUnderTest = ResGetMountedUnitUnderTest() MsgBox UnitUnderTest

6.8.5.35

Attach file to result Appends the specified file to the current test result at the defined position. Parameters

Description

FileLocation

Path of the file to be saved with the result.

FileName

Name of the file to be appended to the test result

Script function/command: Function ResAttachFileToResult(FileLocation, FileName)

6.8.5.36

Restore file from result Saves the specified file from the current test result at the defined location. Parameters

Description

FileLocation

Path under which the file is stored after reading it from the test result

FileName

Name of the file read from the test result

Script function/command: AVL PUMA Open 2012 — Scripting in PUMA Open

307

308

Functions of the PUMA Open Script API

Function ResRestoreFileFromResult(FileLocation, FileName)

6.8.5.37

Delete file from result Deletes the specified file from the current test result. Parameters

Description

FileName

Name of the file deleted from the test result

Script function/command: Function ResDeleteFileFromResult(FileName)

6.8.5.38

ResGetFileAttachmentNamesInResult Retrieves the names of all attachments of the current test result. Information Only names of attachments from local results can be retrieved.

Parameters

Description

FileAttachmentNames

After a successful call, this parameter keeps the names of all attached files. Individual names are separated by '|' (i.e. the 'pipe' sign)

Script function/command: Function ResGetFileAttachmentNamesInResult(ByRef FileAttachmentNames)

Example Dim Result Dim FileAttachmentNames Result = ResGetFileAttachmentNamesInResult(FileAttachmentNames) If Not Result = 0 Then MsgBox "The following files are attached to the current result: " & FileAttachmentNames End If

6.8.5.39

ResAttachFileExistsInResult Checks if a specified file (name) already is attached to the current test result. Information Attachments of local results can be checked.

Parameters

Description

FileAttachmentNames

Name of the attachment (along with its extension) that the result is checked for, e.g. "MyResult1.txt"

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Script function/command: Function ResAttachFileExistsInResult(FileAttachmentName)

Example Dim Result Result = ResGetFileAttachmentNamesInResult("MyResult1.txt") If Not Result = 0 Then MsgBox "File 'MyResult1.txt' is already attached to the current result" End If

6.8.5.40

ResGetFileAttachmentNamesInMeasurement Retrieves the names of all attachments of the current version of the selected measurement of current test result. Information Only names of attachments from the current version of the measurement from the local result can be retrieved.

Parameters

Description

MeasurementName

Literal 'String' or 'NormName' Name of the measurement the names of attachments are retrieved from, e.g. "MyRecorderResult"

FileAttachmentNames

Name of the attachment (along with its extension) that the result is checked for, e.g. "MyResult1.txt"

Script function/command: Function ResGetFileAttachmentNamesInMeasurement_| (MeasurementName, ByRef FileAttachmentNames)

Example Dim Result Dim FileAttachmentNames Result = ResGetFileAttachmentNamesInMeasurement("MyRecorderResult", FileAttachmentNames) If Not Result = 0 Then MsgBox "The following files are attached to the measurement: " & FileAttachmentNames End If

6.8.5.41

ResAttachFileExistsInMeasurement Checks if a specified file (name) already is attached to the current version of the selected measurement of the current test result. Information Only attachments from the current version of the measurement from the local result can be checked.

AVL PUMA Open 2012 — Scripting in PUMA Open

309

310

Functions of the PUMA Open Script API

Parameters

Description

MeasurementName

Literal 'String' or 'NormName' Name of the measurement whose attachments are checked for, e.g. "MyRecorderResult"

FileAttachmentNames

'String' Name of the attachment (along with its extension) that the result is checked for, e.g. "MyResult1.txt"

Script function/command: Function ResAttachFileExistsInMeasurement(MeasurementName, FileAttachmentName)

Example Dim Result Result = ResGetFileAttachmentNamesInMeasurement("MyRecorderResult", "MyResult1.txt") If Not Result = 0 Then MsgBox "File 'MyResult1.txt' is already attached to the measurement" End If

6.8.5.42

ResGetFileAttachmentNamesInRecovery Retrieves the names of all attachments of the current version of the recovery measurement of the current test result.

Information Only names of attachments from local results can be retrieved.

Parameters

Description

FileAttachmentNames

After a successful call, this parameter keeps the names of all attached files. Individual names are separated by '|' (i.e. the 'pipe' sign)

Script function/command: Function ResGetFileAttachmentNamesInRecovery(ByRef FileAttachmentNames)

Example Dim Result Dim FileAttachmentNames Result = ResGetFileAttachmentNamesInRecovery(FileAttachmentNames) If Not Result = 0 Then MsgBox "The following files are attached to the current result: " & FileAttachmentNames End If

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

6.8.5.43

ResAttachFileExistsInRecovery Checks if a specified file (name) already is attached to the current version of the recovery measurement of the current test result. Information only attachments of local results can be checked.

Parameters

Description

FileAttachmentNames

Name of the attachment (along with its extension) that the recovery measurement is checked for, e.g. "MyResult1.txt")

Script function/command: Function ResAttachFileExistsInRecovery(FileAttachmentName)

Example Dim Result Result = ResGetFileAttachmentNamesInRecovery("MyResult1.txt") If Not Result = 0 Then MsgBox "File 'MyResult1.txt' is already attached to the current recovery measurement" End If

6.9

Parameter Access

6.9.1

Parameters

6.9.1.1

Save UUT parameter set Saves the entire UUT (Unit Under Test Parameters) loadset. Any change will be saved. Script function/command: Sub PrmSaveUUT()

6.9.1.2

Save SYS parameter set Saves the entire SYS (System Parameters) Loadset. Any change will be saved. Script function/command: Sub PrmSaveSYS()

6.9.1.3

Save SYS parameter Set with comment Saves the entire SYS (System Parameters) Loadset. Any change will be saved.

AVL PUMA Open 2012 — Scripting in PUMA Open

311

312

Functions of the PUMA Open Script API

Parameter

description

comment

Comment to stored parameter set.

Script function/command: Sub PrmSaveSYS(comment)

6.9.1.4

Save DRV parameter set Saves the entire DRV (Driver Parameter) Loadset. Any change will be saved. Script function/command: Function PrmSaveDRV()

6.9.1.5

Save TST Attachments Writes the file attachments from the file system to the database. Script function/command: Sub PrmSaveTSTAttachments()

6.9.1.6

Load TST Attachments Loads the file attachments from the database into the file system. Script function/command: Sub PALSLoadTSTAttachments()

6.9.1.7

Get DRV parameter set Retrieves the specified DRV parameter and writes its value to a system channel that has been specified by its normname. Parameters

Description

Path

Structured parameter access path in the DRV parameter loadset. String.

Script function/command: ChnSet "ResultChannel", PrmGetDRVParameter("Path")

Example of path: 

Path for the name of the driver curve that controls clutch disengagement in a manual shift definition: "Behaviour[0]/MSD[Name=""MyMSD""]/DisengClutchDCVUp/Name"



To obtain the driver curve's x- or y-values: "Behaviour[0]/MSD[Name=""MyMSD""]/DisengClutchDCVUp/xAxis[1]" "Behaviour[0]/MSD[Name=""MyMSD""]/DisengClutchDCVUp/yAxis[1]"



To obtain the driver curves directly (but not via a manual shift definition): "Behaviour[0]/DCVRise[Name=""MyDCV""]/xAxis[1]" "Behaviour[0]/DCVRise[Name=""MyDCV""]/yAxis[1]"

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Information As more than one MSD parameter entity can be defined within a given DRV parameter loadset, you can select the appropriate entity by using the 'Name=""MSDName""' clause as selector. The same applies to driver curves. There are many instances that can be identified by their name or even by their index ("Behaviour[0]/DCVRise[DCVIndex]/yAxis[Index]").

Information All axis indices are zero-based.

Information As the entire path is defined as a string, use two double quotes ("") before and after the string value to mark a string value within the string.

6.9.1.8

Set DRV parameter Sets a DRV parameter entry to a specified value. The changes take effect immediately. Parameters

Description

Path

Structured parameter access path in the DRV parameter loadset. String.

Value

New value for the specified DRV parameter entry. Numeric value or expression string.

Script function/command: ChnSet "StatusChannel" PrmSetDRVParameter("Path", Value)

In cases in which it is necessary to modify a set of parameter entries in a transaction, you can use the functions described below. These functions allow you to open an edit session, then modify some parameters, check these modifications, apply them or cancel them and finally close the edit session again. Sub PrmEditDRVParameter(Path, ByRef EditObjId) Function PrmChangeDRVParameter(EditObjId, ElementName, Value) Function PrmRetrieveDRVParameter(EditObjId, ElementName) Function PrmRetrieveCountDRVParameter(EditObjId, ElementName) Function PrmCheckDRVParameters(EditObjId) Function PrmApplyDRVParameters(EditObjId) Function PrmCancelDRVParameters(EditObjId) Function PrmCloseDRVParameters(EditObjId)

AVL PUMA Open 2012 — Scripting in PUMA Open

313

314

Functions of the PUMA Open Script API

Abb. 53 You can check the result from both sequences easily in the online DRV parameters window in POI (menu Functions | Simulation | Driver Gearshift Definition).

6.9.1.9

Get parameter Gets parameter (specified by path) and write it to specified channel. Parameters

Description

Path

Structured parameter access path in the DRV parameter set. String.

ResultChannel

Name of the system channel on which result is written. String.

Script function/command: ChnSet "", PrmGetParameter(Path, ResultChannel)

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

6.9.1.10

Get Parameter Count Gets the number of elements of the parameter (specified by path) and write it to specified channel. Parameters

Description

Path

Structured parameter access path in the DRV parameter set. String.

ResultChannel

Name of the system channel on which result is written. String.

Script function/command: ChnSet "", PrmGetParameter(Path, ResultChannel

6.9.1.11

PrmEditDRVParameter Opens an edit session that allows parameter access beginning with the parameter entry specified by its structured path. The current edit session is identified by an 'Edit Object ID' that must also be used for the subsequent manipulations. This ID represents a kind of root object that is the basis for further navigation. Parameters

Description

Path

Structured parameter access path in the DRV parameter loadset. String.

EditObjld

Output parameter. Identifies the edit session.

Script function/command: Sub PrmEditDRVParameter(Path, EditObjId)

6.9.1.12

PrmChangeDRVParameter Modifies the specific parameter entry. Parameters

Description

EditObjld

Identifies the edit session.

ElementName

Identifies the parameter entry. String.

Value

Identifies the parameter entry. Numeric value or expression string.

Script function/command: Function PrmChangeDRVParameter(EditObjId, ElementName, Value)

6.9.1.13

PrmRetrieveDRVParameter Retrieves the value of the specified parameter element. Parameters

Description

EditObjld

Identifies the edit session.

ElementName

Identifies the parameter entry. String.

Script function/command: Function PrmRetrieveDRVParameter(EditObjId, ElementName)

AVL PUMA Open 2012 — Scripting in PUMA Open

315

316

Functions of the PUMA Open Script API

6.9.1.14

PrmRetrieveCountDRVParameter Retrieves the number of sub-elements of the specified parameter element. Parameters

Description

EditObjld

Identifies the edit session.

ElementName

Identifies the parameter entry. String.

Script function/command: Function PrmRetrieveCountDRVParameter(EditObjId, ElementName)

6.9.1.15

PrmCheckDRVParameters Checks the consistency of the modified parameters. Parameters

Description

EditObjld

Identifies the edit session.

ReturnValue

Indicates whether OK or Not OK 1...OK 0...NotOK

Script function/command: Function PrmCheckDRVParameters(EditObjId)

6.9.1.16

PrmApplyDRVParameters Activates the modified parameters without closing the edit session. Parameters

Description

EditObjld

Identifies the edit session.

ReturnValue

Indicates whether OK or Not OK 1...OK 0...NotOK

Script function/command: Function PrmApplyDRVParameters(EditObjId)

6.9.1.17

PrmCancelDRVParameters Activates the modified parameters and closes the edit session. Information Every edit session must be closed explicitly. Parameters

Description

EditObjld

Identifies the edit session.

ReturnValue

Indicates whether OK or Not OK 1...OK 0...NotOK

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Script function/command: Function PrmCancelDRVParameters(EditObjId)

6.10

UUT Control

6.10.1

EMCON Support

6.10.1.1

Freeze Alpha Set Value This function is used to Freeze/Unfreeze the Alpha set value. Parameters

Description

aMode

0 = unfreeze 1 = freeze

Script function/command: Sub EmcFreezeAlphaSetValue( aMode )

6.10.1.2

Set Dyno Behavior This function is used to change the dyno behavior between passive and active mode. Parameters

Description

aMode

0 = Passiv 1 = Active

Script function/command: Sub EmcChangeDynoBehavior( aMode )

6.10.2

Advanced UUT support

6.10.2.1

Stall Brake Off Releases the Stall brake. Always possible. If open, no action. Script function/command: AdvUutStallbrakeOff

6.10.2.2

Stall Brake On Aktivates the stall brake. Only possible if UUT is stopped (channel UUTState will be checked), else no action just an error message appears. Script function/command: AdvUutStallbrakeOn

6.10.2.3

Send Command to task BEA Convert a command of typ string into a long value and send this to the system variable SV_BEA_ONEWAY_COMMAND. If the system variable is missing, an error is written to the TbTracer.

AVL PUMA Open 2012 — Scripting in PUMA Open

317

318

Functions of the PUMA Open Script API

Parameters

Description

Command

Command. String.

Script function/command: AdvUutDemandValueRelation "$(Command)"

6.10.2.4

Demand value relation Changes the demand value relation between in- and output side (engine and dyno). The application of this AO is only feasible if UUT is stopped (channel UUTState will be checked), otherwise an error message is reported without further action. Parameters

Description

TorqueSide

Input/Output

Script function/command: AdvUutDemandValueRelationN (Load, Drive)

Information TorqueSide refers to the output side or load side.

6.10.2.5

ChangeDrivingDirection For special purposes it should be possible to redefine the Driving direction already in neutral gear. That ensures that the Emcon can initialize it's controllers in proper way to have smooth transitions at gear changes which reverses the Driving direction. Parameters

Description

Direction

0 = Forward 1 = Reverse

Script function/command: Sub EmcChangeDrivingDirection( aDirection )

6.10.3

Engine Electronic Interface

6.10.3.1

A3Change Changes the name of the binary file. Parameters

Description

ModuleName

Name of EEI module. String.

NewBinaryFile

Name of new binary file. String.

Script function/command: Sub EeiA3ChangeBinFileName(ModuleName, NewBinaryFile)

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

6.10.3.2

A3CopyBinaryFile Copies the binary file to the specified destination. Parameters

Description

ModuleName

Name of EEI module. String.

Target

Destination or normname for the destination. String.

Source

Source or normname for the source. String.

Script function/command: Sub EeiA3CopyBinFile(ModuleName, Target, Source)

6.10.3.3

A3Emergency Performs an emergency shutdown; an emergency event number can be specified. Parameters

Description

ModuleName

Name of EEI module. String.

EmergencyEvent

Event number or normname for the event number.

Script function/command: Sub EeiA3Emergency(ModuleName, EmergencyEvent)

6.10.3.4

A3GetLookupTable Transfers all data of a map from the MC system to PUMA. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

Script function/command: Sub EeiA3GetLookupTable(ModuleName, MapName)

6.10.3.5

A3GetOnlineValue Reads the online value once. The module must be in Offline state. Parameters

Description

ModuleName

Name of EEI module. String.

Script function/command: Sub EeiA3GetOnlineValue(ModuleName)

6.10.3.6

A3GetParameter Transfers parameters from the MC system to PUMA.

AVL PUMA Open 2012 — Scripting in PUMA Open

319

320

Functions of the PUMA Open Script API

Parameters

Description

ModuleName

Name of EEI module. String.

ParameterName

Name of parameter. String.

Script function/command: Sub EeiA3GetParameter(ModuleName, ParameterName)

6.10.3.7

A3Idendify Identifies versions and names and exchanges them between the MC system and PUMA. Parameters

Description

ModuleName

Name of EEI module. String.

Script function/command: Sub EeiA3Identify(ModuleName)

6.10.3.8

A3IncreaseLookupTable Adds an offset to map values. The map area to be changed is defined by a start index and a delta value. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

XIndex

Start index on x-axis or normname containing the start index. String.

YIndex

Start index on y-axis or normname containing the start index. String.

X-Delta

Area in direction of x-axis or normname containing the area. String.

Y-Delta

Area in direction of y-axis or normname containing the area. String.

Offset

Offset value in direction of z-axis or normname containing the offset. String.

Script function/command: Sub EeiA3IncreaseLookupTable(ModuleName, MapName, XIndex, _ YIndex, XDelta, YDelta, Offset)

6.10.3.9

A3Init First command to initialize the MC system. Parameters

Description

ModuleName

Name of EEI module. String.

Script function/command: Sub EeiA3Init(ModuleName)

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

6.10.3.10 A3ParameterForValueAcquisition Transfers the names of the online quantities to be acquired to the MC system. Optionally, a clear list can be sent. Parameters

Description

ModuleName

Name of EEI module. String.

Delete

"0" if you want to send a clear list, otherwise ‘‘‘‘. String.

Script function/command: Sub EeiA3ParForValAcq(ModuleName, Delete)

6.10.3.11 SelectLoadset Selection, in MONITOR mode, from which parameter set the MEI blocks should be taken. Parameters

Description

LoadsetType

Name of loadset ("SYS"/ "UUT"/ "TST"). String.

Script function/command: Sub EeiSelectLoadset(LoadsetType)

6.10.3.12 Disconnect Disconnects all modules from the EEI. Parameters

Description

ModuleName

Name of EEI module. String.

Script function/command: Sub EeiDisconnect(ModuleName)

6.10.3.13 Connect Connects a module to the MC system. Parameters

Description

ModuleName

Name of EEI module. String.

DescriptionFile

Name of description file. String.

BinaryFile

Name of binary file. String. ‘‘‘‘... If the string is empty, the description file name from the MEI parameter block will be used.

Destination

Destination or normname for the destination. String. ‘‘‘‘... If the string is empty, the default destination of the ECU system will be used.

Script function/command: Sub EeiConnect(ModuleName, DescriptionFile, BinaryFile, Destination)

AVL PUMA Open 2012 — Scripting in PUMA Open

321

322

Functions of the PUMA Open Script API

6.10.3.14 Activate Connects a module to an MC system without Init and Identify. Parameters

Description

ModuleName

Name of EEI module. String.

Script function/command: Sub EeiActivate(ModuleName)

6.10.3.15 MapReset Resets all modified maps. Parameters

Description

ModuleName

Name of EEI module. String.

Script function/command: Sub EeiResetAllMaps(ModuleName)

6.10.3.16 ParameterReset Resets all modified parameters. Parameters

Description

ModuleName

Name of EEI module. String.

Script function/command: Sub EeiResetAllParameters(ModuleName)

6.10.3.17 GetParameter Transfers parameters from the MC system to PUMA. Parameters

Description

ModuleName

Name of EEI module. String.

ParameterName

Name of parameter. String.

Normname

Normname that contains the parameter value.

Script function/command: Sub EeiGetParameter(ModuleName, ParameterName, Normname)

6.10.3.18 SetParameter Sets a parameter to the specified value. Parameters

Description

ModuleName

Name of EEI module. String.

ParameterName

Name of parameter. String.

ParameterValue

Value assigned to the parameter or to the normname containing the value. String.

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Script function/command: Sub EeiSetParameter(ModuleName, ParameterName, ParameterValue)

6.10.3.19 SetMap Sets a constant in a map. The map area to be changed is defined by the start values X1 and Y1 and the end values X2 and Y2. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

ZValue

Constant value in direction of z-axis or normname containing the value. String.

X1

Start value on x-axis or normname containing the start value. String.

Y1

Start value on y-axis or normname containing the start value. String.

X2

End value on x-axis or normname containing the end value. String.

Y2

End value on y-axis or normname containing the end value. String.

Script function/command: Sub EeiSetMap(ModuleName, MapName, ZValue, X1, Y1, X2, Y2)

6.10.3.20 SetMapTotal Sets an entire map to a specified value. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

ZValue

Constant value in direction of z-axis or normname containing the value. String.

Script function/command: Sub EeiSetMapTotal(ModuleName, MapName, ZValue)

6.10.3.21 SetMapCurve Sets a constant in a characteristic curve. The curve area to be changed is defined by the start value X1 and the end value X2. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

ZValue

Constant value in direction of z-axis or normname containing the value. String.

X1

Start value on x-axis or normname containing the start value. String.

X2

End value on x-axis or normname containing the end value. String.

AVL PUMA Open 2012 — Scripting in PUMA Open

323

324

Functions of the PUMA Open Script API

Script function/command: Sub EeiSetMapCurve(ModuleName, MapName, ZValue, X1, X2)

6.10.3.22 IncreaseMap Increases part of a map by a specified value. The map area to be changed is defined by the start values X1 and Y1 and the end values X2 and Y2. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

ZOffset

Offset value in direction of z-axis or normname containing the value. String.

X1

Start value on x-axis or normname containing the start value. String.

Y1

Start value on y-axis or normname containing the start value. String.

X2

End value on x-axis or normname containing the end value. String.

Y2

End value on y-axis or normname containing the end value. String.

Script function/command: Sub EeiIncMap(ModuleName, MapName, ZOffset, X1, Y1, X2, Y2)

6.10.3.23 IncreaseMapTotal Increases an entire map by a specified value. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

ZOffset

Offset value in direction of z-axis or normname containing the offset. String.

Script function/command: Sub EeiIncMapTotal(ModuleName, MapName, ZOffset)

6.10.3.24 IncreaseMapCurve Increases part of a curve by a specified value. The curve area to be changed is defined by the start value X1 and the end value X2. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

ZOffset

Offset value in direction of z-axis or normname containing the value. String.

X1

Start value on x-axis or normname containing the start value. String.

X2

End value on x-axis or normname containing the end value. String.

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Script function/command: Sub EeiIncMapCurve(ModuleName, MapName, ZOffset, X1, X2)

6.10.3.25 GetMap Transfers all data of a map from the MC system to PUMA. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

Script function/command: Sub EeiGetMap(ModuleName, MapName)

6.10.3.26 PutMap Transfers all data of a map to the MC system. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

Script function/command: Sub EeiPutMap(ModuleName, MapName)

6.10.3.27 GetDimensionOfMap Retrieves the dimension of a map in the direction of the x- and y-axes. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

XDim

Normname that obtains the dimension of the x-axis. String.

YDim

Normname that obtains the dimension of the y-axis. String.

Script function/command: Sub EeiGetDimOfMap(ModuleName, MapName, XDim, YDim)

6.10.3.28 GetPointOfMap Retrieves the x-, y- and z-value of a map point to obtain the required x,y index. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

XIndex

Index in direction of x-axis or normname containing the index. String.

YIndex

Index in direction of y-axis or normname containing the index. String.

AVL PUMA Open 2012 — Scripting in PUMA Open

325

326

Functions of the PUMA Open Script API

Parameters

Description

XResult

Normname that receives the corresponding x-value. String.

YResult

Normname that receives the corresponding y-value. String.

ZResult

Normname that receives the corresponding z-value. String.

Script function/command: Sub EeiGetPointOfMap(ModuleName, MapName, X, Y, XResult, _ YResult, ZResult)

6.10.3.29 Online Establishes online communication. Parameters

Description

ModuleName

Name of EEI module. String.

Script function/command: Sub EeiOnline(ModuleName)

6.10.3.30 Offline Terminates online communication between the MC system and the ECU. The cyclic transfer of ECU values to PUMA will be stopped. Parameters

Description

ModuleName

Name of EEI module. String.

Script function/command: Sub EeiOffline(ModuleName)

6.10.3.31 Reset Resets all modified parameters and maps. Parameters

Description

ModuleName

Name of EEI module. String.

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Script function/command: Sub EeiReset(ModuleName)

6.10.3.32 A3SelectDesAndBinFile Connects a module to the MC system. Parameters

Description

ModuleName

Name of EEI module. String.

DescriptionFile

Name of description file. String. ‘‘‘‘... If the string is empty, the description file name from the MEI parameter block will be used.

BinaryFile

Name of binary file. String. ‘‘‘‘... If the string is empty, the description file name from the MEI parameter block will be used.

Destination

Destination or normname for the destination. String. ‘‘‘‘... If the string is empty, the default destination of the ECU system will be used.

Script function/command: Sub EeiA3SelectDesAndBinFile(ModuleName, DescriptionFile, _ BinaryFile, Destination)

6.10.3.33 A3SelectLookupTable Selects the look-up table with the specified name. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

Script function/command: Sub EeiA3SelectLookupTable(ModuleName, MapName)

6.10.3.34 A3PutLookupTable Transfers map data from PUMA to the MC system. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

Script function/command: Sub EeiA3PutLookupTable(ModuleName, MapName)

6.10.3.35 A3SetLookupTable Sets a constant in a map. The map area to be changed is defined by a start index and a delta value.

AVL PUMA Open 2012 — Scripting in PUMA Open

327

328

Functions of the PUMA Open Script API

Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

XIndex

Start index on x-axis or normname containing the start index. String.

YIndex

Start index on y-axis or normname containing the start index. String.

X-Delta

Area in direction of x-axis or normname containing the area. String.

Y-Delta

Area in direction of y-axis or normname containing the area. String.

Value

Constant value in direction of z-axis or normname containing the value. String.

Script function/command: Sub EeiA3SetLookupTable(ModuleName, MapName, XIndex, YIndex, _ XDelta, YDelta, Value)

6.10.3.36 A3SetParameter Sets a parameter to the specified value. Parameters

Description

ModuleName

Name of EEI module. String.

ParameterName

Name of parameter. String.

ParameterValue

Value assigned to the parameter or to the normname containing the value. String.

Script function/command: Sub EeiA3SetParameter(ModuleName, ParameterName, ParameterValue)

6.10.3.37 A3SwitchOnOffline Switches communication between PUMA and MC system on-/offline. Parameters

Description

ModuleName

Name of EEI module. String.

OnOff

"0" for Offline, "1" for Online, or normname that contains the value 0 or 1. String.

Script function/command: Sub EeiA3SwitchOnOffline(ModuleName, OnOff)

6.10.3.38 A3ResetDevice Resets device and optionally resets all selected LUNs.

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Parameters

Description

ModuleName

Name of EEI module. String.

ResetAll

"0" to reset all selected LUNs, otherwise ‘‘‘‘. String.

Script function/command: Sub EeiA3ResetDevice(ModuleName, ResetAll)

6.10.3.39 A3SetCaseSensitiveLabels Sets case-sensitive labels. Parameters

Description

ModuleName

Name of EEI module. String.

Script function/command: Sub EeiA3SetCaseSensitiveLabels(ModuleName)

6.10.3.40 A3GetLookupTableValue Returns an indexed z-value of the map. Parameters

Description

ModuleName

Name of EEI module. String.

MapName

Name of map. String.

XIndex

Start index on x-axis or normname containing the start index. String.

YIndex

Start index on y-axis or normname containing the start index. String.

Normname

Normname that receives the z-value. String. ‘‘‘‘...If the string is empty, the defined normname will automatically be used.

Script function/command: Sub EeiA3GetLookupTableValue(ModuleName, MapName, XIndex, YIndex, _ Normname)

6.10.3.41 StoreBinFile Saves a binary file on the MC system. Parameters

Description

ModuleName

Name of EEI module. String.

NewBinFileName

Name of new binary file. String. ‘‘‘‘If the string is empty, the defined binary file name will automatically be used.

Script function/command: Sub EeiStoreBinFile(ModuleName, NewBinFileName)

AVL PUMA Open 2012 — Scripting in PUMA Open

329

330

Functions of the PUMA Open Script API

6.10.3.42 GetAllMapsAndParameter Loads all maps and parameters of the MC system. Parameters

Description

ModuleName

Name of EEI module. String.

Script function/command: Sub EeiGet(ModuleName)

6.10.3.43 A3DefineDesAndBinFile Connects a module to the MC system. The ASAP3 V2.1 command can be used alternatively to the command SELECT DESCRIPTION AND BINARY FILE. Parameters

Description

ModuleName

Name of EEI module. String.

DescriptionFile

Name of description file. String. ‘‘‘‘If the string is empty, the description file name from the MEI parameter block will automatically be used.

ProgramCodeFile

Name of program code file. String. ‘‘‘‘If the string is empty, the program code file name from the MEI parameter block will automatically be used.

CalibrationFile

Name of calibration data file. String. ‘‘‘‘If the string is empty, the calibration data file name from the ECU parameter block will automatically be used.

Destination

Destination or normname for the destination. String. ‘‘‘‘... If the string is empty, the default destination of the MC system automatically will be used.

Mode

Mode or normname for the mode. String. ‘‘‘‘If the string is empty, the default mode from the MC system will automatically be used.

Script function/command: Sub EeiA3DefineDesAndBinFile(ModuleName, DescriptionFile, _ ProgramCodeFile, CalibrationFile, Destination, Mode)

6.10.3.44 A3SetFormat Sets the format of the data received from the MC system. Information The extended commands of ASAP3 are not supported.

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Parameters

Description

ModuleName

Name of EEI module. String.

LogicalDataType

Definition of ASAP3 data type or normname - 0.. all, 1.. map, 2.. parameter, 3..current value

Model

Only for extended commands (which are not supported)! ‘‘‘‘if the string is empty, "0" is sent to the MC system.

Script function/command: Sub EeiA3SetFormat(ModuleName, LogicalDataType, Model)

6.10.3.45 A3InitAsMasterClient Initializes an MC system as the MasterClient of the Asap3Server. An INIT is executed at the MC system (also for multiple clients connected to the Asap3Server). Parameters

Description

ModuleName

Name of EEI module. String.

Script function/command: Sub EeiA3InitAsMasterClient(ModuleName)

6.10.3.46 PutParameter Transfers a parameter from PUMA to the MC system. Parameters

Description

ModuleName

Name of EEI module. String.

ParName

Name of parameter. String.

Script function/command: Sub EeiPutParameter(ModuleName, ParName)

6.10.3.47 EeiA3ExtendedQueryAvailableServices Retrieves a list of all services available in the application system. Parameters

Description

ModuleName

Name of EEI module. String.

Timeout

Timeout in seconds

Services

List of services

ErrorMessage

Error message

Script function/command: Function EeiA3ExtendedQueryAvailableServices(ModuleName, Timeout, Services,_ ErrorMessage)

AVL PUMA Open 2012 — Scripting in PUMA Open

331

332

Functions of the PUMA Open Script API

6.10.3.48 EeiA3ExtendedGetServiceInformation Retrieves a detailed description of the services. Parameters

Description

ModuleName

Name of EEI module. String.

Timeout

Timeout in seconds

Services

List of services

InfoString

Information string to be output

ErrorMessage

Error message

Script function/command: Function EeiA3ExtendedGetServiceInformation(ModuleName, Timeout, Service,_ InfoString, ErrorMessage)

6.10.3.49 EeiA3ParaForValAcquisitionDirect Displays the data type of the online values. Parameters

Description

ModuleName

Name of EEI module. String.

Timeout

Timeout in seconds

ScanTime

Scanning time (in ms)

ValueNames

Information string to be output

DataTypes

List of data types of the online channel names

ErrorMessage

Error message

Script function/command: Function EeiA3ParaForValAcquisitionDirect(ModuleName, Timeout, ScanTime,_ ValueNames, DataTypes, ErrorMessage)

6.10.3.50 EeiA3ExtendedExecuteService This command executes a service on the application system. Parameters

Description

ModuleName

Name of EEI module. String.

Timeout

Timeout in seconds

Services

List of services

ServiceInput

Input parameters for the services

ServiceOutput

Output parameters for the services

ErrorMessage

Error message

Script function/command: Function EeiA3ExtendedExecuteService(ModuleName, Timeout, Service, ServiceInput,_| ServiceOutput, ErrorMessage)

6.10.3.51 EeiAssignOnlineValueToQuantities Creates system channels and assigns normnames to the online values, as previously defined in the activation.

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Parameters

Description

ModuleName

Name of EEI module. String.

ValueNames

List of online channel names

QuantityNames

List of normnames

ErrorMessage

Error message

Script function/command: Function EeiAssignOnlineValueToQuantities(ModuleName, ValueNames, QuantityNames,_ ErrorMessage)

6.10.3.52 EeiRemoveOnlineValues Removes online channels and system channels from the internal online value list. Parameters

Description

ModuleName

Name of EEI module. String.

ValueNames

List of online channel names

ErrorMessage

Error message

Script function/command: Function EeiRemoveOnlineValues(ModuleName, ValueNames, ErrorMessage)

6.10.3.53 EeiA3GetParameterDirect Parameters

Description

ModuleName

Name of EEI module. String.

Timeout

Input as timeout in seconds.

ParameterName

Name of parameter

AddToList

0 = no entry made in internal list 1 = entry made in list

TypeOfValue

Parameter type

Value

Parameter value to be output

MinValue

Lower range of parameter

MaxValue

Upper range of parameter

MinInc

Minimum increment of parameter

ErrorMessage

Error message

Script function/command: Function EeiA3GetParameterDirect(ModuleName, Timeout, ParameterName, _ AddToList, TypeOfValue, Value, MinValue, MaxValue, MinInc, ErrorMessage)

6.10.3.54 EeiA3SetParameterDirect Parameters

Description

ModuleName

Name of EEI module. String.

Timeout

Input as timeout in seconds.

ParameterName

Name of parameter

AVL PUMA Open 2012 — Scripting in PUMA Open

333

334

Functions of the PUMA Open Script API

Parameters

Description

PutInternalValue

0 = value is transferred to application system 1 = internally stored value is transferred to application system

Value

Parameter value to be output

ErrorMessage

Error message

Script function/command: Function EeiA3SetParameterDirect(ModuleName, Timeout, ParameterName,_ PutInternalValue, Value, ErrorMessage)

6.10.3.55 EeiAssignParameterToQuantity Creates a PUMA system channel and assigns a quantity to this channel. Parameters

Description

ModuleName

Name of EEI module. String.

ParameterName

Name of parameter

QuantityName

Name of quantity

ErrorMessage

Error message

Script function/command: Function EeiAssignParameterToQuantity(ModuleName, ParameterName,_ QuantityName, ErrorMessage)

6.10.3.56 EeiRemoveParameter Deletes a parameter (including system channel) from the internal parameter list. Parameters

Description

ModuleName

Name of EEI module. String.

ParameterName

Name of parameter

ErrorMessage

Error message

Script function/command: Function EeiRemoveParameter(ModuleName, ParameterName, ErrorMessage)

6.10.3.57 EeiSetParameterBit Sets a parameter bit. Parameters

Description

ModuleName

Name of EEI module. String.

ParameterName

Name of parameter

BitNumber

Number of bits from 0 to 16 for parameters of type Float and 32 for parameters of type Double.

BitValue

Value of the bit (0 or1).

ErrorMessage

Error message

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Script function/command: Function EeiSetParameterBit(ModuleName, ParameterName, BitNumber, BitValue,_ ErrorMessage)

6.10.3.58 GetParameterBit Reads a parameter bit directly from the MC system. Bits 0 to 16 for data type Float, bits 0 to 32 for data type Double. Parameters

Description

ModuleName

Name of EEI module. String.

ParameterName

Name of parameter

BitNumber

Number of bits from 0 to 16 for parameters of type Float and 32 for parameters of type Double.

TypeOfValue

Normname for the parameter type.

BitValue

Value of the bit (0 or1).

Script function/command: Sub EeiGetParameterBit(ModuleName, ParameterName, BitNumber, TypeOfValue,_ BitValue)

6.10.3.59 SetParameterBit Sets a parameter bit directly at the MC system. Bits 0 to 16 for data type Float, bits 0 to 32 for data type Double. Parameters

Description

ModuleName

Name of EEI module. String.

ParameterName

Name of parameter

BitNumber

Number of bits from 0 to 16 for parameters of type Float and 32 for parameters of type Double.

BitValue

Value of the bit (0 or1).

Script function/command: Sub EeiSetParameterBit(ModuleName, ParameterName, BitNumber, BitValue)

6.10.3.60 GetParameter (Synchronous) This AO allows the synchronous get of a parameter. No specified normname will result in a BSQ exception. Parameters

Description

ModuleName

Name of the module

Parametername

Name of the parameter. String as input

Normname

Name of parameter.

AVL PUMA Open 2012 — Scripting in PUMA Open

335

336

Functions of the PUMA Open Script API

Parameters

Description

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command: Sub EeiGetParameterSynchronous(ModuleName, ParameterName, NormName, ErrorCodeNormname, BsqException)

6.10.3.61 SetParameter (Synchronous) This AO allows the synchronous set of a parameter. No specified normname will result in a BSQ exception. Parameters

Description

ModuleName

Name of the module

ParameterName

Name of the parameter. String as input

ParameterValue

Name of parameter.

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command: Sub EeiSetParameterSynchronous(ModuleName, ParameterName, ParameterValue, ErrorCNormName, BsqException)

6.10.3.62 GetMap (Synchronous) This AO allows the synchronous get of a lookup table. No specified normname will result in a BSQ exception. Parameters

Description

ModuleName

Name of the module

MapName

Name of the lookup table. String as input

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Script function/command: Sub EeiGetMapSynchronous(ModuleName, MapName, ErrorNormName, BsqException)

6.10.3.63 A3GetLookUpTable (Synchronous) Transfers the complete map from MC system to PUMA. The command is executed synchronously. Parameters

Description

ModuleName

Name of the module

MapName

Name of the lookup table. String as input

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command: Sub EeiGetLookUpTableSynchronous(ModuleName, MapName, ErrorNormName, BsqException)

6.10.3.64 A3IncreaseLookUpTable (Synchronous) Add offset to map values. The area within the map is defined by start index (>= 1) and delta value (>= 1). The command is executed synchronously. Parameters

Description

ModuleName

Name of the module

MapName

Name of table. String.

XIndex

Start index on x-axis or normname containing the start index (>= 1). String.

YIndex

Start index on y-axis or normname containing the start index (>= 1). String.

XDelta

Area in direction of x-axis or normname containing the area (>= 1). String.

YDelta

Area in direction of y-axis or normname containing the area (>= 1). String.

Offset

Offset value in direction of z-axis or normname containing the offset. String.

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command: Sub EeiIncreaseLookUpTableSynchronous(ModuleName, MapName, XIndex, YIndex, XDelta, _ YDelta, Offset, ErrorNormName, BsqException)

AVL PUMA Open 2012 — Scripting in PUMA Open

337

338

Functions of the PUMA Open Script API

6.10.3.65 A3ResetDevice(Synchronous) Reset device, optional with reset of all selected LUNs. The command is executed synchronously. Parameters

Description

ModuleName

Name of the module

ResetallLUN

"0" to reset all selected LUNs, otherwise ‘‘‘‘. String.

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command: Sub EeiResetDeviceSynchronous(ModuleName, ResetallLUN, ErrorNormName, _ BsqException)

6.10.3.66 A3SetLookUptable (Synchronous) Set constant value in map. The area within the map is defined by start index (>= 1) and delta value (>= 1). The command is executed synchronously. Parameters

Description

ModuleName

Name of the module

MapName

Name of table. String.

XIndex

Start index on x-axis or normname containing the start index (>= 1). String.

YIndex

Start index on y-axis or normname containing the start index. String.

XDelta

Area in direction of x-axis or normname containing the area (>= 1). String.

YDelta

Area in direction of y-axis or normname containing the area (>= 1). String.

Constant

Constant value in direction of z-axis or normname containing the value (>= 1). String.

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command: Sub EeiA3SetLookupTableSynchronous(ModuleName, MapName, XIndex, YIndex, _ XDelta, YDelta, Constant, ErrorCodeNormname, BsqException)

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

6.10.3.67 Increase Map (Synchronous) Add offset to map values. The area within the map is defined by start values x1, y1 and end values x2, y2. The command is executed synchronously. Parameters

Description

ModuleName

Name of the module

MapName

Name of table. String.

Constant

Offset value in direction of z-axis or normname containing the value. String.

X1

Start value on x-axis or normname containing the start value. String.

Y1

Start value on y-axis or normname containing the start value. String.

X2

End value on x-axis or normname containing the end value. String.

Y2

End value on y-axis or normname containing the end value. String.

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command: Sub EeiIncreaseMapMapSynchronous(ModuleName, MapName, Constant, ErrorCodeNormname, X1, Y1, X2, Y2, ErrorCodeNormname, BsqException)

6.10.3.68 Increase Map Curve (Synchronous) Add offset to a curve. The area within the curve is defined by start value X1 and end value X2. The command is executed synchronously. Parameters

Description

ModuleName

Name of the module

MapName

Name of table. String.

Constant

Offset value in direction of z-axis or normname containing the value. String.

X1

Start value on x-axis or normname containing the start value. String.

X2

End value on x-axis or normname containing the end value. String.

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

AVL PUMA Open 2012 — Scripting in PUMA Open

339

340

Functions of the PUMA Open Script API

Script function/command: Sub EeiIncMapCurve(SynchronousModuleName, MapName, Constant, X1, X2, ErrorCodeNormname, BsqException)

6.10.3.69 Increase Map Total (Synchronous) Add offset to map values in the whole map. The command is executed synchronously. Parameters

Description

ModuleName

Name of the module

MapName

Name of table. String.

Constant

Offset value in direction of z-axis or normname containing the offset. String.

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command: Sub EeiIncMapTotalSynchronous(ModuleName, MapName, Constant, ErrorCodeNormname, BsqException)

6.10.3.70 MapReset (Synchronous) Reset of all changed maps. The command is executed synchronously. Parameters

Description

ModuleName

Name of the module

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command: Sub EeiResetAllMaps(ModuleName, ErrorCodeNormname, BsqException)

6.10.3.71 Parameter Reset (Synchronous) Reset of all changed parameters. The command is executed synchronously.

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Parameters

Description

ModuleName

Name of the module

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command: Sub EeiResetAllParametersSynchronous(ModuleName, ErrorCodeNormname, BsqException)

6.10.3.72 Put Map (Synchronous) Transfer complete map to MC system. The command is executed synchronously. Parameters

Description

ModuleName

Name of the module

MapName

Name of table. String.

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command: Sub EeiPutMap(SynchronousModuleName, MapName, ErrorCodeNormname, BsqException)

6.10.3.73 Put Parameter (Synchronous) Transfer of the parameter to MC system. The command is executed synchronously. Parameters

Description

ModuleName

Name of the module

ParName

Name of parameter. String.

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command:

AVL PUMA Open 2012 — Scripting in PUMA Open

341

342

Functions of the PUMA Open Script API

Sub EeiPutParameterSynchronous(ModuleName, ParName, ErrorCodeNormname, BsqException)

6.10.3.74 Set Map (Syncheronous) Set constant value in map. The area within the map is defined by start values x1, y1 and end values x2, y2. The command is executed synchronously. Parameters

Description

ModuleName

Name of the module

MapName

Name of table. String.

Constant

Constant value in direction of z-axis or normname containing the value. String.

X1

Start value on x-axis or normname containing the start value. String.

Y1

Start value on y-axis or normname containing the start value. String.

X2

End value on x-axis or normname containing the end value. String.

Y2

End value on y-axis or normname containing the end value. String.

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command: Sub EeiSetMapSynchronous(ModuleName, MapName, Constant, X1, Y1, X2, Y2, ErrorCodeNormname, BsqException)

6.10.3.75 SetMap Total(Synchronous) Set constant value in the whole map. The command is executed synchronously. Parameters

Description

ModuleName

Name of the module

MapName

Name of table. String.

Constant

Offset value in direction of z-axis or normname containing the offset. String.

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command:

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Sub EeiSetMapTotalSynchronous (ModuleName, MapName, Constant, ErrorCodeNormname, BsqException)

6.10.3.76 SetMapCurve (Synchronous) Set constant value in a curve. The area within the curve is defined by start value X1 and end value X2. The command is executed synchronously. Parameter

Beschreibung

ModuleName

Name of the module

MapName

Name of table. String.

Constant

Offset value in direction of z-axis or normname containing the offset. String.

X1

Start value on x-axis or normname containing the start value. String.

X2

Start value on y-axis or normname containing the start value. String.

ErrorCodeNormname

Optional normname 0 = no error, unequal 0 = mistake in execution of AO

BsqException

Choice for a BSQ exception "Unspecified Fault" 0 = no exception 1 = exception in case of an error

Script function/command: Sub EeiSetMapCurveSynchronous (ModuleName, MapName, ZValue, X1, X2, ErrorCodeNormname, BsqException)

6.10.3.77 EEIActivateChangePropagation With this AO the change propagation mechanism can be activated/deactivated for the specified module (mode: on/off). When activated, any change of the value of the NormName that is associated with a parameter or lookup table for the module will be propagated to the application system and further to the electronic control unit. The result is the same as if the SetParameter or SetMapTotal command is used. Parameter

Beschreibung

ModuleName

Name of the module

Mode

on/off

Script function/command: Sub EeiActivateChangePropagation(ModuleName, Mode)

6.10.4

Testrun Executor

6.10.4.1

Position Testrun Script function/command: Not supported by the PO Script API!

AVL PUMA Open 2012 — Scripting in PUMA Open

343

344

Functions of the PUMA Open Script API

6.10.4.2

Reset testrun Script function/command: Not supported by the PO Script API!

6.10.4.3

Execution log Script function/command: Not supported by the PO Script API!

6.10.4.4

Start routine Script function/command: Not supported by the PO Script API!

6.10.4.5

Reset This activation resets the point of execution of the current testrun to the very beginning. Parameter

Description

Device

Name of the Device. If an empty name is specified, then the actual BSQ testrun is reset.

Script function/command: Sub TrxReset(DeviceName)

6.10.4.6

Set single-step mode Script function/command: Not supported by the PO Script API!

6.10.4.7

Single Step Script function/command: Not supported by the PO Script API!

6.10.4.8

Position to record Script function/command: Not supported by the PO Script API!

6.10.4.9

Position to time Script function/command: Not supported by the PO Script API!

6.10.4.10 Position to revolutions Script function/command: Not supported by the PO Script API!

6.10.4.11 Position to record with reset Script function/command: Not supported by the PO Script API!

6.10.4.12 Position to time with reset Script function/command: Not supported by the PO Script API!

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

6.10.4.13 Position to revolutions with reset Script function/command: Not supported by the PO Script API!

6.10.5

Step Sequence Commands

6.10.5.1

Start Script function/command: Not supported by the PO Script API!

6.10.5.2

Stop Script function/command: Not supported by the PO Script API!

6.10.5.3

Set Position Script function/command: Not supported by the PO Script API!

6.10.5.4

Reset Script function/command: Not supported by the PO Script API!

6.10.5.5

Set denormalization mode Script function/command: Not supported by the PO Script API!

6.10.5.6

Start single step Script function/command: Not supported by the PO Script API!

6.10.5.7

Enable Look-Ahead Driver Script function/command: Not supported by the PO Script API!

6.10.5.8

Disable Look-Ahead Driver Script function/command: Not supported by the PO Script API!

6.10.5.9

Select Continuation Mode Script function/command: Not supported by the PO Script API!

6.10.5.10 Set default gearshift profile Script function/command: Not supported by the PO Script API!

6.10.5.11 Sert gearshift profile Script function/command: Not supported by the PO Script API!

6.10.5.12 Pause Script function/command: Not supported by the PO Script API! AVL PUMA Open 2012 — Scripting in PUMA Open

345

346

Functions of the PUMA Open Script API

6.10.5.13 Interrupts Script function/command: Not supported by the PO Script API!

6.10.5.14 Choose demand value type Script function/command: Not supported by the PO Script API!

6.10.6

EC-Recorder

6.10.6.1

Start Starts recording. Script function/command: Sub EcrStart()

6.10.6.2

Stop Stops recording. Script function/command: Sub EcrStop()

6.10.7

MCD3D

6.10.7.1

Connect D-System Establish connection to the D-System. That means, the server is connected and initialized and a project is selected. Parameter

Description

Device

Name of the Device

Script function/command: Sub mcd3d_ConnectDSystem(DeviceName)

6.10.7.2

Disconnect D-System The connection to the D-System to which the device belongs is released. If any devices (modules) of this D-System are connected, all cyclic services are stopped and the modules are disconnected. Parameter

Description

Device

Name of the Device

Script function/command: Sub mcd3d_DisconnectDSystem(DeviceName)

6.10.7.3

Connect Module Establish connection to the module (Logical link). That means, the Logical link is opened and the communication with the ECU module is established.

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Parameter

Description

Device

Name of the Device

Script function/command: Sub mcd3d_ConnectModule(DeviceName)

6.10.7.4

Disconnect Module The connection to the module (Logial link) is released. All cyclic services are stopped and the modules are disconnected. Parameter

Description

Device

Name of the Device

Script function/command: Sub mcd3d_DisconnectModule(DeviceName)

6.10.7.5

Execute Service A diagnostic script is activated. Parameter

Description

Device

Name of the Device

ServiceName

Name of the Service

Script function/command: Sub mcd3d_ExecuteService(DeviceName,ServiceName,ServiceParam)

6.10.7.6

Start Service A diagnostic service is marked for periodic activation. Parameter

Description

Device

Name of the Device

ServiceName

Name of the Service

Frequency

Frequency ID

ServiceParam

Parameters of the service

Script function/command: Sub mcd3d_StartService(DeviceName,ServiceName,Frequency,ServiceParam)

6.10.7.7

Stop Service The cyclic activation of a diagnostic service is stopped, that means the service execution is stopped after the next cycle. Parameter

Description

Device

Name of the Device

ServiceName

Name of the Service

Script function/command: Sub mcd3d_StopService(DeviceName, ServiceName)

AVL PUMA Open 2012 — Scripting in PUMA Open

347

348

Functions of the PUMA Open Script API

6.10.7.8

Start All Services All diagnostic services of one device are marked for periodic activation. Parameter

Description

Device

Name of the Device

Script function/command: Sub mcd3d_StartAllServices(DeviceName)

6.10.7.9

Stop All Services The cyclic activation of all diagnostic services is stopped. Parameter

Description

Device

Name of the Device

Script function/command: Sub mcd3d_StopAllServices(DeviceName)

6.10.7.10 Set Service Frequency The frequency property of the service is changed. Parameter

Description

Device

Name of the Device

ServiceName

Name of the service

ServiceFrequency

Frequency ID

Script function/command: Sub mcd3d_SetServiceFrequency(DeviceName,ServiceName,ServiceFrequency)

6.10.7.11 Set Service Acquisition Flag The acquisition flag for the service is set to yes/no. Parameter

Description

Device

Name of the Device

ServiceName

Name of the service

On/Off

State of acquisition flag to set.

Script function/command: Sub mcd3d_SetServiceAcquisitionFlag (DeviceName,ServiceName,OnOff)

6.11

Chassis Dyno Control

6.11.1

Driver´s Aid

6.11.1.1

Load Driving Cycle Load Driving Cycle to Driver's Aid

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Parameter

Description

Device

Name of the Device

Driving Cycle

Name of the cycle

Script function/command: DriversAidSADAXPSetDrivingCycle "$(DEVICE)","$(Cycle)"

6.11.1.2

Release Drivers´s Aid Release Driver's Aid. Parameter

Description

Device

Name of the Device

Script function/command: DriversAidSADAXPRelease "$(DEVICE)"

6.11.1.3

Request Driver´s Aid Request Driver's Aid Parameter

Description

Device

Name of the Device

Script function/command: DriversAidSADAXPRequest "$(DEVICE)"

6.11.1.4

Reset Reset Driver's Aid: End and Unload Driving Cycle Parameter

Description

Device

Name of the Device

Script function/command: DriversAidSADAXPReset "$(DEVICE)"

6.11.1.5

Retrieve Driving Cycle Retrieves Driving Cycle from Driver's Aid. Parameter

Description

Device

Name of the Device

Script function/command: DriversAidSADAXPGetDrivingCycle "$(DEVICE)"

6.11.1.6

Retrieve Status Retrieves Status from Driver's Aid.

AVL PUMA Open 2012 — Scripting in PUMA Open

349

350

Functions of the PUMA Open Script API

Parameter

Description

Device

Name of the Device

Script function/command: DriversAidSADAXPRtrvStatus "$(DEVICE)"

6.11.1.7

Send Command Sends a command to Driver´s Aid. Parameter

Description

Device

Name of the device

Full Command

AkCmdString

Script function/command: DriversAidSADAXPSendCmdString "$(DEVICE)","$(CmdString)"

6.11.1.8

Send Displaying Text Sends a displaying text to Driver´s aid. Parameter

Description

Device

Name of the device

Displaying Text

Text

Script function/command: DriversAidSADAXPSendUserString "$(DEVICE)","$(UserString)"

6.11.1.9

Start Driver´s Aid Starts Driver´s Aid. Parameter

Description

Device

Name of the Device

Script function/command: DriversAidSADAXPStartTest "$(DEVICE)"

6.11.1.10 Stopp Driver´s Aid Stops Driver´s Aid. Parameter

Description

Device

Name of the Device

Script function/command: DriversAidSADAXPStopTest "$(DEVICE)"

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

6.11.2

VECON

6.11.2.1

Adjust wheel base Allows checking and adjusting the wheel base setting either in the VEH parameters or on the testbed. AK command: SBAS Parameters

Description

ModelName

Name of the model. String.

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_AdjustWheelBase "ModelName", "WaitForCompletion"

6.11.2.2

Break curerent activities Breaks all current activities and sets the VECON to Standby. AK command: SBRE Parameters

Description

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_BreakCurrentActivities "WaitForCompletion"

6.11.2.3

Cancel Standby Switches the testbed from standby into active mode. AK command: STGO Parameters

Description

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_CancelStandby "WaitForCompletion"

6.11.2.4

Coastdown with vehicle Starts a coastdown procedure with vehicle using the selected version. AK command: SASL Parameters

Description

Version

Name of the version

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_CoastDownSASL "Version", "WaitForCompletion"

6.11.2.5

Coastdown without vehicle Starts a coastdown procedure without vehicle using EPA limits or limits as defined in the section “Coastdown” of the VEH parameters. AK command: SRAL

AVL PUMA Open 2012 — Scripting in PUMA Open

351

352

Functions of the PUMA Open Script API

Parameters

Description

Limits

EPA/Definable

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_CoastDownSRAL "Limit", "WaitForCompletion"

6.11.2.6

Control mode force Runs a testbed in control mode “Force constant” with the defined force in [N]. AK command: SKZK Parameters

Description

DemandForce

Value (N) of the force

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_ForceConstantMode "DemandForce", "WaitForCompletion"

6.11.2.7

Control mode road load sim Runs a testbed in control mode “Road load simulation”. AK command: SSIM Parameters

Description

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_RGSimulationMode "WaitForCompletion"

6.11.2.8

Control mode velocity Runs a testbed in control mode “Velocity constant” with the defined velocity in [km/h]. AK command: SMTR Parameters

Description

Demand velocity

Value (km/h) of the velocity

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_SpeedConstantMode "DemandVelocity", "WaitForCompletion"

6.11.2.9

Enter Standby Switches the testbed into standby mode. AK command: STBY Parameters

Description

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_CancelStandby "WaitForCompletion"

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

6.11.2.10 Get coastdown results Gets the results of a previously performed coastdown run and stores them in the VEH parameters in the section “Coastdown results”. AK command: ARAL Script function/command: Cdh_AVLCDC_GetCoastDownResultsARAL

6.11.2.11 Get vehicle velocity limits Gets the velocity limit from the vehicle and stores it in the VEH parameters in the section “Vehicle and Driveline Parameters”. AK command: AVMA Script function/command: Cdh_AVLCDC_GetVehicleVMaxLimit

6.11.2.12 Head wind blower Starts or stops the vehicle cooling fan. AK command: SGEI / SGAU Parameters

Description

Blower

On/Off

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_HeadWindBlower "Blower", "WaitForCompletion"

6.11.2.13 Inertia reduction Switches the inertia reduction function on or off. AK command: SFTP Parameters

Description

Mode

On/Off

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_InertiaReduction "Mode", "WaitForCompletion"

6.11.2.14 Lifter position Moves vehicle lifter up or down. AK command: SLIH / SLIR Parameters

Description

Lifter

Up/Down

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_Lifter "Lifter", "WaitForCompletion"

6.11.2.15 Load vehicle model One of the stored VECON vehicle models is activated. AK command: SSML

AVL PUMA Open 2012 — Scripting in PUMA Open

353

354

Functions of the PUMA Open Script API

Parameters

Description

ModelName

Name of the model

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_LoadVehicleModel "ModelName", "WaitForCompletion"

6.11.2.16 Roller Locking Activates or deactivates the roller locking. AK command: SBEI / SBAU Parameters

Description

Locking

On/Off

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_RollerLocking "Locking", "WaitForCompletion"

6.11.2.17 Send AK Command Sends the specified AK command to the VECON. Parameters

Description

AKCommand

Name of the AK-Command

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_AKCommand "AKCommand", "WaitForCompletion"

6.11.2.18 Set road gradient Sets the road gradient in [%] for the road load simulation. AK command: EGST Parameters

Description

RoadGradient

Road Gradient in %

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_SetRoadGradient "RoadGradient", "WaitForCompletion"

6.11.2.19 Start distance measurement Starts the distance measurement on the testbed. AK command: SJAW Parameters

Description

Channel

Channel 1-4

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_StartDistanceMeasurement "Channel", "WaitForCompletion"

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

6.11.2.20 Start from zero Enables the testbed to start from zero velocity. AK command: SOVR Parameters

Description

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_StartFromZero "WaitForCompletion"

6.11.2.21 Starts calibration of the testbed Runs static calibration of testbed. AK command: SKAL Parameters

Description

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_StaticCalibrationOfTestbed "WaitForCompletion"

6.11.2.22 Update UUT parameters Reads actual values from VECON and updates stored UUT parameters. Parameters

Description

ModelName

Name of the model

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_UpdateUUTParameters "ModelName", "WaitForCompletion"

6.11.2.23 Update vehicle model Updates the stored vehicle model with the contents of the UUT parameters. AK command: ESES Parameters

Description

ModelName

Name of the model

WaitForCompletion

Yes/No

Script function/command: Cdh_AVLCDC_UpdateVehicleModel "ModelName", "WaitForCompletion"

6.12

Scripting

6.12.1

Script Activation

6.12.1.1

Execute Activates an individual script in a defined script context.

AVL PUMA Open 2012 — Scripting in PUMA Open

355

356

Functions of the PUMA Open Script API

Parameters

Description

Scriptlet

Statements in VBScript syntax. String.

Script function/command: Scriptlet

6.12.1.2

Script All script functions and script context functions declared as "public" cannot only be accessed via scriptlet base functions but also using a DOT-notation based syntax. Activation is synchronized. Information Avoid recursive activation when calling up user defined script functions from other user defined script contexts, e.g. function 'A1' of context 'CtxA' calls up function 'B' of context 'CtxB', which itself tries to call up function 'A2' of context 'CtxA'. Parameters

Description

Name

Name of the script context within which the scriptlet is executed. 

String.

Script function/command: Function Script(Name)

Example Dim Result, C C=99 Result

= Script("CtxB").B(C)

The following list of functions enables the user to access user-defined scripts (which have been defined by means of a special script context) within other user-defined script contexts.

6.12.1.3

ScrExecute Executes the defined scriptlet within an assigned script context. Scriptlet execution is synchronized, i.e. the activation is not returned before the scriptlet has been executed. Parameters

Description

ContextName

Context within which the scriptlet is executed. 

MonitorTimeout

String.

Checks whether or not the script to be executed should monitor execution. 

Enumeration:

0...do not monitor 1...monitor

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Parameters

Description

Timeout

Is active if "MonitorTimeout" has been enabled. This parameter monitors the current time-out [s].

Scriptlet

Set of instructions in the VBScript syntax. 

String.

Script function/command: State = ScrExecute("ContextName", MonitorTimeout, Timeout, "Scriptlet")

6.12.1.4

ScrExecuteEx Similar to function ScrExecute, the only difference being that you can additionally specify a context ID and a module name. Parameters

Description

ContextName

Context within which the scriptlet is executed. 

ContextId

A script context may contain identical execution contexts which are processed separately and are identified by their context ID. Every user-defined context consists of an execution context, which is identified by its ID. 

ModuleName

Long

All coding in a PO script context is subdivided into modules. All of the PO Script API functions are loaded into the main module (default module) and all user-defined scripts are loaded into the user module. 

MonitorTimeout

String.

String.

Checks whether or not the script to be executed should monitor execution. 

Enumeration:

0...do not monitor 1...monitor Timeout

Is active if "MonitorTimeout" has been enabled. This parameter monitors the current time-out [s].

Scriptlet

Set of instructions in the VBScript syntax. 

String.

Script function/command: State = ScrExecuteEx("ContextName", ContextId, "ModuleName" MonitorTimeout, Timeout, "Scriptlet")

6.12.1.5

ScrStartExecute Starts to execute a defined scriptlet within the assigned script context.

AVL PUMA Open 2012 — Scripting in PUMA Open

357

358

Functions of the PUMA Open Script API

Parameters

Description

ContextName

Context within which the scriptlet is executed. 

MonitorTimeout

String.

Checks whether or not the script to be executed should monitor execution. 

Enumeration:

0...do not monitor 1...monitor Timeout

Is active if "MonitorTimeout" has been enabled. This parameter monitors the current time-out [s].

Scriptlet

Set of instructions in the VBScript syntax. 

String.

Script function/command: SyncObj = ScrStartExecute("ContextName", MonitorTimeout, Timeout,_ "Scriptlet")

6.12.1.6

ScrStartExecuteEx Similar to "ScrStartExecute", the difference being that you can also specify a context ID and a module name. Parameters

Description

ContextName

Context within which the scriptlet is executed. 

ContextId

A script context may contain identical execution contexts which are processed separately and are identified by their context ID. Every user-defined context consists of an execution context, which is identified by its ID "0". 

ModuleName

Long

All coding in a PO script context is subdivided into modules. All of the PO Script API functions are loaded into the main module (default module) and all user-defined scripts are loaded into the user module. 

MonitorTimeout

String.

String.

Checks whether or not the script to be executed should monitor execution. 

Enumeration:

0...do not monitor 1...monitor Timeout

Is active if "MonitorTimeout" has been enabled. This parameter monitors the current time-out [s].

Scriptlet

Set of instructions in the VBScript syntax. 

String.

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Script function/command: SyncObj = ScrStartExecute("ContextName", ContextId, "ModuleName" MonitorTimeout,_ Timeout, "Scriptlet")

6.12.1.7

ScrSynchronize Waits until a previously started script activation has been processed. Parameters

Description

SyncObject

The returned value of the function represents a synchronized object that can be used via "ScrSychronize". 

Object

Script function/command: State = ScrSynchronize(SyncObject)

6.12.1.8

Script All script functions and script context functions declared as "public" cannot only be accessed via one of the script-based functions described above but also using a DOT-notation based syntax. Example Avoid recursive activation when calling up user defined script functions from other user defined script contexts, i.e. function 'A1' of context 'CtxA' calls up function 'B' of context 'CtxB' which itself tries to call up function 'A2' of context 'CtxA'. Parameters

Description

ContextName

Name of script context within which the scriptlet is executed. String.

Parameter1..n

List of script function parameters that have been defined within the script context.

Script function/command: Result

6.13

Service

6.13.1

Dyno Access

6.13.1.1

Get parameter

= Script("ContextName").Function(Parameter1, …, ParameterN)

Reads a parameter from the dyno. The returned value is available on EMCON system variable CC_SV_CK_VALUE as soon as the EMCON system variable EMCON Variable CC_SV_CK_TOGGLE changes its value (toggle value 01). Contents of CC_SV_CK_VALUE: Get Success

value of dyno parameter

AVL PUMA Open 2012 — Scripting in PUMA Open

359

360

Functions of the PUMA Open Script API

Get Abort

104aaaaa

aaaaa....abort code

Get Error

1050eeee

eeee......error code

Abort code aaaaa: 

00003... access to Kiwi memory not allowed



00302...time exceeded when waiting for answer after Get or Put

Error code eeee: 

0000...unknown number of parameters



0003...subindex out of range



0004...subindex must be zero



0103...no read access



0104...parameter number belongs to KCT



0105...setting not activated



0108...incompatibility between SW version and parameter action



0120...command not accepted



0199...default value, error cause unknown

Parameters

Description

Dyno

Dyno index (1..5; 0=all dynos)

Index

Index of parameter (0...4000)

SubIndex

Subindex of parameter (0...32767)

Script function/command: Sub DynGetParameter(Dyno, Index, SubIndex)

6.13.1.2

Set parameter Sets a dyno parameter. A result code is available on the EMCON system variable CC_SV_CK_VALUE as soon as the EMCON system variable CC_SV_CK_TOGGLE changes its value (toggle value 01). Contents of CC_SV_CK_VALUE: Get Success

value of dyno parameter

Get Abort

104aaaaa

aaaaa....abort code

Get Error

1050eeee

eeee......error code

Abort code aaaaa: 

00003... access to Kiwi memory not allowed



00302...time exceeded when waiting for answer after Get or Put



00305...time-out when waiting for dyno to get ready



xxx04...value out of range

Error code eeee: 

0000...unknown number of parameters



0001...no write permission



0002...parameter limit exceeded



0003...subindex out of range



0004...subindex must be zero



0005...wrong parameter format

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API



0006...only reset allowed (value 0)



0017... not allowed in current state



0101...saving of parameter during run



0102...no online mode, no write access



0103...no read access



0104...parameter number belongs to KCT



0105...setting not activated



0107...invalid code for factory setting or parameter reset



0108...incompatibility between SW version and parameter action



0120...command not accepted



0199...default value, error cause unknown

Parameters

Description

Dyno

Dyno index (1..5; 0=all dynos)

Index

Index of parameter (0...4000)

SubIndex

Subindex of parameter (0...32767)

Value

Value of dyno parameter

Script function/command: Sub DynSetParameter(Dyno, Index, SubIndex, Value)

6.14

Miscellaneous

6.14.1

Common Commands

6.14.1.1

Start Application Starts the specified application. ‘

Parameters

Description

Application

Name of the application to be started including path. String.

WaitUntilClosed

Halts processing until the application is closed (in BSQ or script only). Counter 0...‘No‘ 1...‘Yes‘

Script function/command: Sub CmnStartApplication(Application, WaitUntilClosed)

Example If the parameter "Application" contains blanks (e.g. because the application's path contains blanks), the entire parameter contents must be put between double quotes.

AVL PUMA Open 2012 — Scripting in PUMA Open

361

362

Functions of the PUMA Open Script API

Abb. 54 Information If 'Common Commands \Start Application' PO Script API function ‘CmnStartApplication‘ is used, 3 double quotes must be put before and after the application string (see the example given below): Example """C:\Program Files\Common Files\Microsoft Shared\PhotoEd\PhotoEd.exe""",0

6.14.1.2

Wait with condition Waits until the condition has been met or the time-out has elapsed during test run execution (in BSQ or script). Information The entire time-out is limited to Tmax < 1000 s. Parameters

Description

Condition

Logical expression that is monitored about 10 times a second. Expression string.

Timeout

Maximum monitoring time-out (s). Numeric value or expression string.

Script function/command: Function CmnSynchronize(Condition, Timeout) AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

6.14.1.3

Wait Halts test run execution (in BSQ or script) until the time-out has elapsed. Information The entire time-out is limited to Tmax < 1000 s. Parameters

Description

Timeout

Maximum monitoring time-out (s). Numeric value or expression string.

Script function/command: Sub CmnWait(Timeout)

6.14.1.4

End exception routine Script function/command: Not supported by the PO Script API!

6.14.1.5

Define 'Return from Exception' point Script function/command: Not supported by the PO Script API!

6.14.1.6

VarEvaluate Evaluates the expression specified in the VBScript syntax. The standard VBScript functions and operators can be used and normnames can be accessed in this expression. Parameters

Description

Expression

Numeric value or formula expression string in VBScript syntax.

Script function/command: Function VarEvaluate(Expression)

Example ChnSet "RESCHA40", VarEvaluate("RESCHA41/RESCHA42+RESCHA43")

6.14.1.7

VarEvaluateEx Evaluates the expression specified in the VBScript syntax according to the 'EvaluationMode' parameter.

AVL PUMA Open 2012 — Scripting in PUMA Open

363

364

Functions of the PUMA Open Script API

Parameters

Description

Expression

Numeric value or formula expression string in VBScript syntax.

EvaluationMode

Determines how to interpret the assigned Expression parameter. 





· eNoEvaluation = 0: Expression is not interpreted and is returned. · eEvaluateChannel = 1: If the expression can also be interpreted as channel name (e.g. RESCHA40), the value of the channel is returned. Otherwise, the expression is not interpreted and is returned. eEvaluateExpression = 2: The expression is interpreted as a mathematical expression (e.g. "12.99+RESCHA40*RESCHA41+R ESCHA42") and the result is returned.

Information Expression parameters of the type string which contain sequences of '$c(ChannelName).v' entries are replaced by the online value of the specified channel during run time, independent of the evaluation mode, and the resulting string is used. If the parameter "Expression" can be interpreted as a numeric value (e.g. 1.33, "5.66"), the numeric value is used immediately. Script function/command: Function VarEvaluateEx(Expression, EvaluationMode)

Example ChnSet "RESCHA40", VarEvaluateEx("RESCHA41/RESCHA42+RESCHA43",_ eEvaluateExpression)

6.14.1.8

VarExecute Executes the expression specified in the VBScript syntax. The standard VBScript functions and operators can be used and normnames can be accessed in this expression. Parameters

Description

Expression

Expression in VBScript syntax.

Script function/command: Function VarExecute(Expression)

Example VarExecute("RESCHA40=RESCHA41/RESCHA42+RESCHA43")

AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Information The difference between 'VarEvaluate' and 'VarExecute' is in the handling of the operator '=': It is interpreted as a relational operator by 'VarEvaluate' and as an 'assignment operator by 'VarExecute'. The expression ChnSet "RESCHA44", VarEvaluate("RESCHA40=RESCHA41/RESCHA42+RESCHA43")

thus returns the result 'True' or 'False'.

6.14.1.9

VarIsVariable Checks whether the specified channel name actually denotes a normname, bitname or temporary name. Parameters

Description

Variable

Name of variable. String.

Script function/command: Function VarIsVariable(Variable)

Example Dim ChannelName ChannelName="Charly" If VarIsVariable(ChannelName) Then ChnSet ChannelName, 123.4 Else PoiSendMessage 4, "Invalid channel Name: " & ChannelName End If

6.14.1.10 DevIsDevice Checks whether the specified device name really denotes a device or device class. Parameters

Description

DeviceName

Name of device or device class. Data type: String. Format 'ClassName.DeviceName' or 'ClassName'. Possible result values: eDQRNotFound = 0 eDQRIsDevice = 1 eDQRIsClass = 2

Script function/command: Function DevIsDevice(DeviceName)

AVL PUMA Open 2012 — Scripting in PUMA Open

365

366

Functions of the PUMA Open Script API

Example Dim DeviceName DeviceName ="LookupTable.ENGMAP" If DevIsDevice(ChannelName) = eDQRIsDevice Then PoiSendMessage 1, "Device '" & DeviceName & "' exists!", 0 Else PoiSendMessage 1, "Device '" & DeviceName & "' does not exist!", 0 End If

6.14.1.11 DevGetClasses Searches for all registered device classes of a given device category and returns them in a string. The individual device class names are separated by ';'. Parameters

Description

Category

Identifies an amount of device classes. The same device class can be used in several categories. Data type: Long Possible categories: eCatAll eCatQuantity

=0 =1

eCatSystemChannel eCatIOSystem

=2

=8

eCatMeasurementDevice= 16 eCatSequenceComponent= 32 eCatVirtualDevice

= 64

eCatUtility

= 128

eCatMiscellaneous

= 4096

Script function/command: Function DevGetClasses(Category)

Example Dim Classes Classes = Split(DevGetClasses(eCatAll), ";") For I = 0 To Ubound(Classes) MsgBox Classes(I) Next

6.14.1.12 Searches for all registered devices of a specified device class. The individual device names are separated by ';'. Parameters

Description

ClassName

Identifies a device class. Data type: String.

Script function/command: AVL PUMA Open 2012 — Scripting in PUMA Open

Functions of the PUMA Open Script API

Function DevGetDevices(ClassName)

Example Dim Devices Devices = Split(DevGetDevices("LookupTable"), ";") For I = 0 To Ubound(Devices) MsgBox Devices(I) Next

6.14.1.13 DevGetChannels Searches for all channels of a device belonging to a given device class. The individual channel names are separated by ';'. Parameters

Description

DeviceName

Identifies a device. Data type: String. Format 'ClassName.DeviceName'

QueryMode

Identifies whether the channel list includes the input channel list, output channel list or both. Data type: Long eDCQModeBoth = 0 eDCQModeInput = 1 eDCQModeOutput = 2

ChannelAttribute

Identifies the channel name. Data type: Long eDCASystemChannelName = 0 eDCADeviceChannelName = 1 eDCASystemName eDCANormName

=2 =3

eDCANormSystemName = 4 eDCADeviceName

=5

If a given name has not been set, the character '*' is returned instead. Script function/command: Function DevGetChannels(DeviceName, QueryMode, ChannelAttribute)

Example Dim Channels Channels = _ DevGetChannels("LookupTable.ENGMAP",eDCQModeBoth,eDCADeviceChannelName) Channels = Split(Channels,";") For I = 0 To Ubound(Channels) MsgBox Channels (I) Next

AVL PUMA Open 2012 — Scripting in PUMA Open

367

368

Functions of the PUMA Open Script API

6.14.1.14 DevGetChannelCount Returns the number of input/output channels of a device. Parameters

Description

DeviceName

Identifies a device. Data type: String. Format 'ClassName.DeviceName'

QueryMode

Identifies whether the input channel list or the output channel list is evaluated. Data type: Long eDCQModeInput = 1 eDCQModeOutput = 2

Script function/command: Function DevGetChannelCount(DeviceName, QueryMode)

Example Dim NumberOfChannels NumberOfChannels = DevGetChannelCount("LookupTable.ENGMAP",eDCQModeInput) MsgBox "Number of input channels: " & NumberOfChannels NumberOfChannels = DevGetChannelCount("LookupTable.ENGMAP",eDCQModeOutput) MsgBox "Number of output channels: " & NumberOfChannels

6.14.1.15 DevGetChannelInfo Returns one of the many name attributes of a device channel. Parameters

Description

DeviceName

Identifies a device. Data type: String. Format 'ClassName.DeviceName'

Index

Identifies an entry in the input or output channel list. Data type: Long 0