Danfoss Scripting Toolbox API Design guide

Page 1
Design Manual
PLUS+1® Service Tool
Scripting Toolbox API
www.danfoss.com
Page 2
Design Manual
Revision history Table of revisions
Date Changed Rev
November 2019 Updated to support 12.0 and later 0601
March 2019 Updated to support 11.1.x. and later 0502
November 2018 Updated to support 11.0.x. and later 0501
November 2017 Updated to support 10.0.x. and later 0401
May 2017 Updated to support 9.1.x. and later 0301
January 2016 Converted to DITA CMS and Danfoss layout. Supports 8.0.x and later. 0201
September 2013 New edition 0101
2 | © Danfoss | November 2019 AJ00000002en-000601
Page 3
Design Manual

Contents

Introduction
Overview..............................................................................................................................................................................................6
Script design in Service Tool
Important advisory...........................................................................................................................................................................7
Creating a script................................................................................................................................................................................7
Managing script files....................................................................................................................................................................... 8
Registration of JavaScript functions in the P1J file...............................................................................................................8
Hyperlink to a script in Advanced Pages..................................................................................................................................9
Adding resource files to a P1D file...........................................................................................................................................10
Accessing P1D resource files in scripts...................................................................................................................................10
Creating Service Tool signals for use in scripts................................................................................................................... 12
General API Information
Supported Internet media types (MIME) in HTML dialogs..............................................................................................15
PLUS+1 return codes.................................................................................................................................................................... 15
ECU Address Parameter...............................................................................................................................................................15
Index Parameter............................................................................................................................................................................. 15
Ranges................................................................................................................................................................................................16
Access rights.................................................................................................................................................................................... 16
PLUS+ 1 parameter Ranges........................................................................................................................................................16
Node Address..................................................................................................................................................................................17
Online mode requirements........................................................................................................................................................17
Script error handling.....................................................................................................................................................................18
Miscellaneous API functions
St_MessageBox...............................................................................................................................................................................19
St_Delay.............................................................................................................................................................................................19
St_CurrentErrorCode.................................................................................................................................................................... 19
St_CurrentErrorString...................................................................................................................................................................19
St_ConsoleLog................................................................................................................................................................................19
St_ConsoleError..............................................................................................................................................................................20
St_SetExitCode................................................................................................................................................................................20
St_FileDialog....................................................................................................................................................................................20
Gateway API functions
St_GetActiveGateway...................................................................................................................................................................21
St_GetActiveGatewayDevice.....................................................................................................................................................21
St_GetGatewayCount...................................................................................................................................................................21
St_GetGatewayInfo....................................................................................................................................................................... 21
St_GetGatewayDeviceCount.....................................................................................................................................................21
St_GetGatewayDeviceInfo..........................................................................................................................................................22
St_SetGatewayBaudrate..............................................................................................................................................................22
ECU API functions
St_ScanSystem................................................................................................................................................................................23
St_GetNodeCount......................................................................................................................................................................... 23
St_GetNodeAddress......................................................................................................................................................................23
St_LoadNodeData..........................................................................................................................................................................23
St_GetNodeInfo..............................................................................................................................................................................24
St_GetParameterCount................................................................................................................................................................25
St_GetParameterData...................................................................................................................................................................25
St_ControlNode..............................................................................................................................................................................26
St_RecoverEcu.................................................................................................................................................................................26
Read Parameter API functions
St_ReadParameter.........................................................................................................................................................................27
St_ClearReadParameterList........................................................................................................................................................27
St_AddReadParameterList..........................................................................................................................................................27
St_ReadParameterList..................................................................................................................................................................27
St_GetReadParameterListValue................................................................................................................................................27
St_ClearExpectedSignalValueList............................................................................................................................................ 28
©
Danfoss | November 2019 AJ00000002en-000601 | 3
Page 4
Design Manual
Contents
St_AddExpectedSignalValueList.............................................................................................................................................. 28
St_WaitForExpectedSignalValues............................................................................................................................................28
St_ClearCanXplorerSignalError.................................................................................................................................................28
Write Parameter API functions
St_WriteParameter........................................................................................................................................................................ 29
St_ClearWriteParameterList.......................................................................................................................................................29
St_AddWriteParameterList.........................................................................................................................................................29
St_WriteParameterList................................................................................................................................................................. 29
Parameter files API functions
St_CreateP1tFromFile...................................................................................................................................................................30
St_CreateP1tFromString............................................................................................................................................................. 30
St_OpenP1tFile...............................................................................................................................................................................30
St_GetP1tFileEcuData.................................................................................................................................................................. 31
St_GetP1tFileParameterCount..................................................................................................................................................31
St_GetP1tFileParameterData.....................................................................................................................................................31
CAN message API functions
St_SendCan......................................................................................................................................................................................32
File download API functions
St_OpenApplication......................................................................................................................................................................33
St_GetDownloadData.................................................................................................................................................................. 33
St_SetDownloadParameterValue.............................................................................................................................................34
St_DownloadFile............................................................................................................................................................................34
St_DownloadPackage.................................................................................................................................................................. 34
Service application API functions
St_GetScreenNodeCount............................................................................................................................................................35
St_GetScreenNodeAddress .......................................................................................................................................................35
St_GetScreenParameterCount..................................................................................................................................................35
St_GetScreenParameterData.....................................................................................................................................................35
St_SetScreenParameterData......................................................................................................................................................36
St_ReloadScreen............................................................................................................................................................................ 36
St_UpdateScreenLogValues.......................................................................................................................................................36
St_IsLogging....................................................................................................................................................................................36
St_ActivateDocument..................................................................................................................................................................36
St_GetResourceFileCount...........................................................................................................................................................36
St_GetResourceFileData..............................................................................................................................................................37
St_SelectResourceFileDialog..................................................................................................................................................... 37
St_GetGenericEcuDefinitionCount..........................................................................................................................................37
St_GetGenericEcuDefinitionData.............................................................................................................................................37
St_GetGenericEcuCount..............................................................................................................................................................38
St_GetGenericEcuData.................................................................................................................................................................38
Report API functions
St_EnableAutoReport...................................................................................................................................................................39
St_AddReportLine......................................................................................................................................................................... 39
St_SaveScriptReport..................................................................................................................................................................... 39
St_ClearScriptReport.....................................................................................................................................................................39
Hyperlink API functions
Hyp_ScanSystem............................................................................................................................................................................40
Hyp_UnitHistory.............................................................................................................................................................................40
Hyp_ViewNavigator......................................................................................................................................................................40
Hyp_StartLog...................................................................................................................................................................................40
Hyp_StopLog...................................................................................................................................................................................40
Hyp_ParamUpload........................................................................................................................................................................ 40
Hyp_ParamDownload..................................................................................................................................................................40
Hyp_ReplaceMissingEcu............................................................................................................................................................. 40
Hyp_ReplaceExistingEcu.............................................................................................................................................................41
4 | © Danfoss | November 2019 AJ00000002en-000601
Page 5
Design Manual
Contents
Hyp_Close.........................................................................................................................................................................................41
Progress API functions
Ui_ClearModalProgressList........................................................................................................................................................ 42
Ui_AddModalProgressItem........................................................................................................................................................42
Ui_UpdateModalProgressItem................................................................................................................................................. 42
Ui_ModalProgressStepIt..............................................................................................................................................................42
Ui_ModalSetProgressText...........................................................................................................................................................42
Ui_InitModalSequence.................................................................................................................................................................43
Ui_EndModalSequence............................................................................................................................................................... 43
User interface API functions
Ui_ShowUI........................................................................................................................................................................................44
Service Tool events
_ServiceTool_BeforeScanSystem.............................................................................................................................................45
_ServiceTool_AfterScanSystem................................................................................................................................................45
_ServiceTool_BeforeParameterUpload..................................................................................................................................45
_ServiceTool_AfterParameterUpload.....................................................................................................................................45
_ServiceTool_BeforeParameterDownload........................................................................................................................... 45
_ServiceTool_AfterParameterDownload...............................................................................................................................45
_ServiceTool_AfterStartLog....................................................................................................................................................... 46
_ServiceTool_AfterStopLog....................................................................................................................................................... 46
_ServiceTool_BeforeLoadScreen..............................................................................................................................................46
_ServiceTool_AfterLoadScreen.................................................................................................................................................46
_ServiceTool_AfterFileOpen......................................................................................................................................................46
Appendix A: Return codes
©
Danfoss | November 2019 AJ00000002en-000601 | 5
Page 6
Design Manual

Introduction

Overview

Use the Scripting Toolbox to develop script sequences written in JavaScript/HTML. Scripts are started using Advanced Page hyperlinks or triggered on a range of service tool events.
This is a PLUS+1® Service Tool upgrade feature. A Service Tool Professional Add-on License (Danfoss part
11179527) enables the design functionality of this feature. Using service application files containing scripts does not require any additional license and can be used with the built-in license supplied with the PLUS+1® Service Tool installation.
Features and benefits:
Develop calibration sequences and troubleshooting wizards
Read and write access to tuning parameters
Download of application files to microcontrollers
Access to any ECU supported by PLUS+1® Service Tool
6 | © Danfoss | November 2019 AJ00000002en-000601
Page 7
C
Design Manual

Script design in Service Tool

Important advisory

Caution
It is not possible to cancel execution of a service tool script function. It is recommended to save your service application file before running scripts.

Creating a script

A Service Tool script contain of Script Interface file and a Script file. The Script Interface File is stored in a .P1U file and uses HTML format and the Script file is stored in a .P1J file and uses JavaScript format.
1. Right-click on the Scripts node under Design in the System Navigator and select New Script to
create template script files.
This will create a ScriptInterface and ScriptFunctions node under Scripts.
2. Double-click on ScriptFunctions to open file ScriptFunctions.P1J in the associated editor.
There is no file association for P1U and P1J files by default when installing the PLUS+1 Service Tool. Use the select default program dialog that appears to associate the text files with your favorite text editor.
©
Danfoss | November 2019 AJ00000002en-000601 | 7
Page 8
Design Manual
Script design in Service Tool
3. Save the changes in the editor and select Reload after right-clicking on the ScriptFunctions node to
reload the file with the changes.
Changes in the P1U and P1J file will be automatically saved when saving the P1D file.
Before you release your service application, you must test the service application file following your usual test procedures to verify that it works as intended.

Managing script files

The menu items Add Script Interface file and Add Script file accessible by right-clicking on the Scripts node can be used to add P1U and P1J files from disk.
It is only possible to add a single P1U and P1J file.
It is also possible to save or delete exiting script files from the Scripts popup menu.

Registration of JavaScript functions in the P1J file

The JavaScript functions in the P1J file that shall be accessible in the Service Tool needs to be registered in the top of the P1J file.
Add a line with the text //PLUS+1-reg: followed by the name of the JavaScript function.
//PLUS+1-reg: MyFunction
function MyFunction() { //JavaScript code }
JavaScript is case sensitive. Watch your capitalization closely when you write JavaScript statements.
8 | © Danfoss | November 2019 AJ00000002en-000601
Page 9
Design Manual
Script design in Service Tool

Hyperlink to a script in Advanced Pages

Each registered JavaScript function will be accessible using Advanced Page hyperlink. The following Advanced Page components support hyperlinks:
Button
Text
Image
Input Value
The tooltip of the component will indicate the P1J and JavaScript function that will be started when clicking the component.
©
Danfoss | November 2019 AJ00000002en-000601 | 9
Page 10
Design Manual
Script design in Service Tool

Adding resource files to a P1D file

It is possible to include resource files and access these files from scripts, i.e. PLUS+ 1 downloadable file (.hex/.lhx), images and JavaScript libraries.
1. Select in the System Navigator > Resources > Add Resource File.
2. Browse to the file.

Accessing P1D resource files in scripts

The example how to include a JavaScript library in a script: P1D Design
P1U file
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="plus1://core.js"></script> <script type="text/javascript" src="p1d://ScriptFunctions.P1J"></script> <script type="text/javascript" src="p1d://jquery-1.6.4.js"></script> </head> </html>
10 | © Danfoss | November 2019 AJ00000002en-000601
Page 11
Design Manual
Script design in Service Tool
The example how to display an image resource file in a HTML dialog: P1D Design
P1U file
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="plus1://core.js"></script> <script type="text/javascript" src="p1d://ScriptFunctions.P1J"></script> </head>
<body> <img src="p1d://DanfossLogo.png" width="200" height="100"> </body> </html>
P1J file
//PLUS+1-reg: AccessResourceFileFromP1D
function AccessResourceFileFromP1D() { Ui_ShowUI("HTML Dialog Test", 0, 0, 400, 200); }
HTML Dialog Test displayed when running the script
©
Danfoss | November 2019 AJ00000002en-000601 | 11
Page 12
Design Manual
Script design in Service Tool

Creating Service Tool signals for use in scripts

The Service Signal protocol included the Service Tool can be used to create Service Tool defined signals. These signals can be read and written from scripts and Service pages and can be used to save configuration and states in different pages or scripts in the P1D file.
Changed signal values will be restored to default values if the P1D file is closed or if the DLL protocols are reloaded (occurs during Reset Gateway, Manage Protocols menu and when changing Online/Offline mode).
The Service Tool signals are defined in a XML file with the following format:
XML file example
<?xml version="1.0" encoding="UTF-8"?> <System xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ServiceSignals.xsd"> <FileFormat>001A</FileFormat> <ServiceNetwork>
<Node Name="Service1" Address="1"/> <Node Name="Service2" Address="0x01F1"/>
<SignalList Node="Service1"> <Signal Name="ServiceToolParameter1" Type="U8" Value="9"/> <Signal Name="ServiceToolParameter2" Type="U32" Value="123"/> <Signal Name="ServiceToolParameter3" Type="BOOL" Value="1"/> </SignalList>
<SignalList Node="Service2"> <Signal Name="TestSignal1" Type="S32" Value="-100"/> </SignalList>
</ServiceNetwork> </System>
Select from the popup menu: System Navigator > Diagnostic Data > Add Diagnostic Data File
12 | © Danfoss | November 2019 AJ00000002en-000601
Page 13
Design Manual
Script design in Service Tool
Select the Service Signals XML file from the popup menu: Add Diagnostic Data > Service Signals > Browse:
The Service Signals ECUs defined in the selected XML file will be displayed in the: System Navigator > ECU list after the System Scan.
©
Danfoss | November 2019 AJ00000002en-000601 | 13
Page 14
Design Manual
Script design in Service Tool
The Signal names defined in the selected XML file are now accessible from Service pages and from script API functions.
Service pages with Service Signals in Run mode
14 | © Danfoss | November 2019 AJ00000002en-000601
Page 15
Design Manual

General API Information

Supported Internet media types (MIME) in HTML dialogs

Scheme File extension MIME type
plus1 .html text/html plus1 .js text/javascript plus1 .css text/css p1d .html, .p1u text/html p1d .js, .p1j text/javascript p1d .css text/css p1d .txt text/plain p1d .xml text/xml p1d .jpg, .jpeg image/jpeg p1d .png image/png p1d .gif image/gif
MIME type text/plain will be used for unlisted file types.

PLUS+1 return codes

ECU Address Parameter

Index Parameter

Functions that return a PLUS+ 1 result code returns the value –1 on success and a positive number on error; see Appendix A: Return codes on page 47.
Parameters named ‘Address’ refers to a node (ECU) address. This information is returned by the St_GetNodeAddress function but is also available in the:
System Navigator > ECU list > Application > Diagnostic ID.
Parameters named Index refers to a zero-based index of the data to target. The value of 0 identifies the first item in the list.
©
Danfoss | November 2019 AJ00000002en-000601 | 15
Page 16
Design Manual
General API Information

Ranges

A range is a set of accessible indexes in an array. Indices in a range are specified either as a comma separated list containing single values or a range separated by a dash ‘-‘.
Example – given an array: int test[30]; //(c-syntax) The following examples are valid:
[1,2,3,23]
[3-17]
[0-5,9,11,12-22]
[29]
The following examples are not allowed:
[-1]
[30]

Access rights

In order to control the level of information shown to the user in the service tool, some API functions provide Access Level information. If the access level in the service tool is equal or higher than the level reported by the protocol, the information should be shown in the service tool. Access Level is provided as information by the protocol DLL and is never enforced. The Service tool is responsible for interpreting and enforcing access levels reported by the protocol.
Read and Write access rights are defined as a single character in the range of [D0-9]. 0-9 indicates the access level and D signifies that the functionality is not supported or not used.

PLUS+ 1 parameter Ranges

Numerical value strings should be presented in decimal form unless stated otherwise and the protocol is responsible for removing leading and trailing white space when converting value strings.
The following numerical ranges are supported:
Type Min Max
BOOL 0 1 U8 0 255 U16 0 65535 U32 0 4294967295 S8 -128 127 S16 -32768 32767 S32 -2147483648 2147483647
16 | © Danfoss | November 2019 AJ00000002en-000601
Page 17
Design Manual
General API Information

Node Address

Address parameters consists of four parts:
Byte 0-1 is the address part, which usually contains basic address and net number. This may also refer
to a protocol internal node ID. Byte 2 is the protocol identifier:
0: PLUS+1 (built-in protocol) 1: uGraph 2: WebGPI PVED-CC 3: WebGPI PVED-CX 4: Fendt KW2kP 5: UDS (built-in protocol) 6: CAN Xplorer (built-in protocol) 7: Service Signals (built-in protocol) 255: Multi-protocol (built-in protocol)
Byte 3 is reserved for future use.

Online mode requirements

Some function calls use only the protocol ID part of the supplied Address. Function calls use the entire Address unless stated otherwise in the documentation for the Address parameter.
The following API functions require online mode:
All API functions in the chapters:
ECU API functions on page 23
Read Parameter API functions on page 27
Write Parameter API functions on page 29
CAN message API functions on page 32
File download API functions on page 33
and these API functions in the chapter Hyperlink API functions on page 40:
Hyp_UnitHistory
Hyp_StartLog
Hyp_StopLog
Hyp_ParamUpload
Hyp_ParamDownload
Functions that require online mode will fail with undefined JavaScript return value and the following text in the log file if called in offline mode: Only supported in Online mode
©
Danfoss | November 2019 AJ00000002en-000601 | 17
Page 18
Design Manual
General API Information

Script error handling

The following error dialog is displayed when an error is detected by the script engine either when the script file is loaded or when running the script:
When the Service Tool load a script file the P1J file is checked for duplicated JavaScript functions. The following error dialog will be displayed if duplicated JavaScript functions are found:
18 | © Danfoss | November 2019 AJ00000002en-000601
Page 19
Design Manual

Miscellaneous API functions

St_MessageBox

This function displays a message box with the supplied text.
Syntax
St_MessageBox(Message:String[, DlgType:String]): Boolean
Input parameters
Message The message to display. DlgType The type of message box to display. (optional) Supported values: Warning, Error and
Result
The function returns true when the user's response is any of the following: Yes, OK, Close.
Confirmation. Default value: Information.

St_Delay

St_CurrentErrorCode

St_CurrentErrorString

This function pause the script for the amount of time (in milliseconds).
St_Delay is only intended to be used in synchronous calls in JavaScript functions. It is recommended to use JavaScript timers to achieve functionality like continuous logging of signal
values.
Syntax
St_Delay(Duration:Number):Void
Input parameter
Duration The number of milliseconds to pause.
This function returns the PLUS+1 return code for the last called API function.
Syntax
St_CurrentErrorCode():Number
This function returns the PLUS+1 return code for the last called API function.
Syntax
St_CurrentErrorString():String

St_ConsoleLog

This function outputs a text to STDOUT.
Syntax
St_ConsoleLog(Text:String):Void
©
Danfoss | November 2019 AJ00000002en-000601 | 19
Page 20
Design Manual
Miscellaneous API functions
Input parameter
Text The text to output.

St_ConsoleError

This function outputs a text to STDERR.
Syntax
St_ConsoleError(Text:String):Void
Input parameter
Text The text to output.

St_SetExitCode

This function allows the designer to signal errors to the calling application/batch file. Exit code 0 by default if the script function is started without errors. Only applicable when using CLI parameter -run-script and -headless.

St_FileDialog

Syntax
St_SetExitCode(ExitCode:Number):Void
Input parameter
ExitCode The exit code to set.
This function displays a modal Windows open or save dialog box for selecting files. Returns the filename of the select file or empty string if no file was selected.
Syntax
St_FileDialog(Type:Number, Caption:String, Extension:String Description:String[, StartFolder:String]):String
Input parameters
Type The dialog type to display
Type number Description
0 Open dialog 1 Save dialog
Caption Specifies the text in the dialog's title bar.
Extension The file extension excluding the period “.”. Supply wildcard “*” to get all files.
Description The description to the display in the file filter selection.
StartFolder Specifies the start folder for the dialog (optional).
20 | © Danfoss | November 2019 AJ00000002en-000601
Page 21
Design Manual

Gateway API functions

St_GetActiveGateway

This function returns the name of the currently active gateway.
Syntax
St_GetActiveGateway():String

St_GetActiveGatewayDevice

This function returns the name of the currently active gateway device.
Syntax
St_GetActiveGatewayDevice():String

St_GetGatewayCount

This function returns the number of available gateways.

St_GetGatewayInfo

Syntax
St_GetGatewayCount():Number
This function returns information for a gateway.
Syntax
St_GetGatewayInfo(GatewayIndex:Number, Item:Number):String
Input parameter
GatewayIndex The index of the gateway. Item The information item to request, see the following table:
Item number Item name Description
0 ID ID of the gateway 1 Name Name of the gateway 2 Capabilities If the gateway supports change of baud rate, recover ECU, etc. 3 Errors 4 Warnings 5 Detailed name

St_GetGatewayDeviceCount

This function returns the number of available gateway devices for a gateway.
Syntax
St_GetGatewayCount(GatewayIndex:Number):Number
©
Danfoss | November 2019 AJ00000002en-000601 | 21
Page 22
Design Manual
Gateway API functions
Input parameter
GatewayIndex The index of the gateway.

St_GetGatewayDeviceInfo

This function returns information for a gateway device.
Syntax
St_GetGatewayDeviceInfo(GatewayIndex:Number, DeviceIndex:Number, Item:Number):String
Input parameter
GatewayIndex The index of the gateway. DeviceIndex The index of the gateway. Item The information item to request, see following table:
Item number Item name Description
1 Name Name of the device 2 Capabilities Supported baud rates, if the device is wireless, etc.

St_SetGatewayBaudrate

This function changes the baud rate for the active gateway. Returns true if the baud rate was set successfully.
Syntax
St_SetGatewayBaudrate(Baudrate:Number):Boolean
Baudrate The desired baud rate (“250000” as example).
Input parameter
Baudrate The desired baud rate (“250000” as example).
22 | © Danfoss | November 2019 AJ00000002en-000601
Page 23
Design Manual

ECU API functions

St_ScanSystem

This function scans the CAN bus and returns the number of found nodes. Any previously loaded node data, parameter lists and opened applications are cleared. Returns a PLUS+1 return code.
Syntax
St_ScanSystem():Number

St_GetNodeCount

This function returns the number of nodes in the connected system.
Syntax
St_GetNodeCount():Number

St_GetNodeAddress

This function returns the full node address for a node.
Syntax
St_GetNodeAddress(Index:Number):Number
Input parameter

St_LoadNodeData

Index The index of the node.
This function loads the diagnostic data from a node. Returns a PLUS+1 return code.
CAN bus communication – Yes. Syntax
St_LoadNodeData(Address:Number):Number
Input parameter
Address Address of the targeted node.
©
Danfoss | November 2019 AJ00000002en-000601 | 23
Page 24
Design Manual
ECU API functions

St_GetNodeInfo

This function retrieves node information read during the system scan or by the St_LoadNodeData function.
Syntax
St_GetNodeInfo(Address:Number, Item:Number):String
Input parameters
Address Address of the targeted node. Item The data item to request, see the table below:
Item No. Item name Description
0 Application ID Name of application, does not have to be unique. 1 Application Type Protocol specific 2 Application Version 3 Node Type
4 Tool Version Version of tool used to make the application 5 OS string Name of operating system used by the application 6 Compile date/time Format: YYYY-MM-DD hh:mm:ss 7 Boot loader version 8 EAN Hardware 9 Serial number Hardware 10 Manufacturing date Format: YYYY-MM-DD 11 Part number 0 Hardware 12 Part number 1 Hardware 13 Part number revision 0 Hardware 14 Part number revision 1 Hardware 15 Programmable status
16 Part number 2 Hardware 17 Application release status
18 SIL2 certified
19 Diagnostic Data filename 20 Global Read Access Right
0 = Controller 1 = Firmware 2 = I/O Module 3 = Joystick 4 = Valve 5 = Sensor 6 = Display 7 = Joystick 8 = Other 9 = Controller 10 = Display 11 = Joystick 12 = Inverter
-1 = Undefined 0 = Not programmable 1 = PLUS+C programmable 2 = GUIDE programmable 3 = Other programmable
0 = Released application 1 = Not released application (Beta)
0 = Not SIL2 certified 1 = SIL2 certified
D = Not used in this ECU 0-9 = Read Access Right to replace the one in the license file for this ECU.
24 | © Danfoss | November 2019 AJ00000002en-000601
Page 25
Design Manual
ECU API functions
Item No. Item name Description
21 Global Write Access Right
22 Tool Name Name of tool used to make the application 23 Software Mode
24 ECU History Supported
25 System ID Only supported by the PLUS+1 protocol 26 Application release status
info

St_GetParameterCount

Retrieves the number of parameters defined for a node.
Syntax
St_GetParameterCount(Address:Number):Number
Input parameter
D = Not used in this ECU 0-9 = Write Access Right to replace the one in the license file for this ECU.
-1 = Undefined 0 = In application 1 = In boot loader
0 = Not supported 1 = Supported
A comma separated list of supported valid values: TRIAL: Application created using a trial license. HWD: Unreleased HWD file. TOOL: Unreleased version of PLUS+1 GUIDE.

St_GetParameterData

Address Address of the targeted node.
This function retrieves information about a parameter from the diagnostic data.
Syntax
St_GetParameterData(Address:Number, Index:Number, Item:Number):String
Input parameters
Address Address of the targeted node. Index The index of the targeted parameter. Item The data item to request, see the table below:
Item No. Item name Description
0 Parameter name 1 Parameter type See Data and Data Types . 2 Writeable Returns “W” if the parameter is writable with
3 Parameter dimension See Ranges on page 16. 4 Parameter Read access level 5 Parameter Write access level
St_WriteParameter or St_WriteParameterList, otherwise an empty string.
See Access rights on page 16.
©
Danfoss | November 2019 AJ00000002en-000601 | 25
Page 26
Design Manual
ECU API functions
Item No. Item name Description
6 Parameter Options
7 Parameter Present in Read List 8 Parameter Present in Write List

St_ControlNode

This function sends a control command to the node. Returns a PLUS+1 return code.
Not all ECUs support this functionality and the ECU may require a System Scan or St_LoadNodeData prior to calling function.
Syntax
St_ControlNode(Address:Number, ControlCode:Number):Number
Input parameters
A comma separated list of supported options for the parameter. When filtering what’s shown when designing pages, these valid options are used:
APP: Parameter defined in application. SYS: System Parameter defined by HWD. ALIAS: ALIAS Parameter. {Deprecated] CHECKPOINT: Parameter is a checkpoint. SETVALUE: Set Value Parameter. SETPULSE: Set Pulse Parameter.
1 = if the parameter is present 0 = if the parameter is not present

St_RecoverEcu

Address Address of the targeted node. ControlCode Command to send to the node, see the table below:
Item No. Item name Description
0 Enter Boot loader Mode ECU goes into boot loader mode. 1 Reset ECU Resets the ECU.
Recovers a node that is in a faulty state where normal program download is no longer possible. If the application on the ECU fails to load recovery has to be performed by catching an ECU in boot mode before it enters application mode, and then keep the ECU in boot mode. Returns true if the recover ECU is successful.
Syntax
St_RecoverEcu(ProtcolId:Number, RecoveryMode:Number, NetNr:Number, NodeNr:Number):Boolean
Input parameters
ProtcolId The protocol identifier for the protocol used by the targeted ECU. See Node Address. RecoveryMode
NetNr Net number of the targeted node. NodeNr Node number of the targeted node.
If the parameter value is 0, the ECU with the address specified by the NetNr and NodeNr parameters.
If the parameter value is 1, the first ECU found will be recovered.
26 | © Danfoss | November 2019 AJ00000002en-000601
Page 27
Design Manual

Read Parameter API functions

St_ReadParameter

This function reads the value of a parameter from a node.
Syntax
St_ReadParameter(Address:Number, Name:String):String
Input parameters
Address Address of the targeted node. Name The name of the parameter to read.
Result
The return value is the parameter value as a string if the parameter is read successfully. If an error occurs while reading the parameter the function will return the text error= following by the PLUS+1 return code.

St_ClearReadParameterList

This function removes all parameters from the list used by St_ReadParameterList.
Syntax
St_ClearReadParameterList():Void

St_AddReadParameterList

This function adds a parameter to the parameter list used by St_ReadParameterList.
Syntax
St_AddReadParameterList(Address:Number, SignalName:String):Void
Input parameters

St_ReadParameterList

This function instructs the protocol to sample the value of each parameter in the read list.
Syntax
St_ReadParameterList():Boolean
Result
The function returns true if all parameters in list are read successfully.

St_GetReadParameterListValue

This function returns the value of a parameter read with St_ReadParameterList.
Syntax
St_GetReadParameterListValue(Address:Number, SignalName:String):String
Input parameters
Address Address of the targeted node SignalName Name of the targeted signal
Address Address of the targeted node SignalName Name of the targeted signal
©
Danfoss | November 2019 AJ00000002en-000601 | 27
Page 28
Design Manual
Read Parameter API functions

St_ClearExpectedSignalValueList

This function removes all signals from the list used by St_WaitForExpectedSignalValues.
Syntax
St_ClearExpectedSignalValueList():Void

St_AddExpectedSignalValueList

This function adds a parameter to the parameter list used by St_WaitForExpectedSignalValues.
Syntax
St_AddExpectedSignalValueList(Address:Number, SignalName:String, Value:String):Void
Input parameters
Address Address of the targeted node SignalName Name of the targeted signal Value The expected signal value

St_WaitForExpectedSignalValues

This function read the signals in list and returns when all signals has the expected value or if the timeout value is reached.
Syntax
St_WaitForExpectedSignalValues(TimeOut:Number):Boolean
Input parameter
TimeOut The number of milliseconds to wait.
Result
The function returns true when all signals in the list has the expected value.

St_ClearCanXplorerSignalError

This function sets the result code for a CAN Xplorer signal to the initial value, which can be used to determine if a CAN message for the CAN Xplorer signal has appeared on the CAN bus.
The signal result code is set to 204 (No answer from node).
Syntax
St_ClearCanXplorerSignalError(Address:Number, Name:String):Boolean
Input parameter
Address Address of the targeted node Name The name of the targeted CAN Xplorer signal
Result
The function returns true if the call is successful.
28 | © Danfoss | November 2019 AJ00000002en-000601
Page 29
Design Manual

Write Parameter API functions

St_WriteParameter

This function writes a parameter in a node. Returns a PLUS+1 return code.
Syntax
St_WriteParameter(Address:Number, Name:String, Value:String):Number
Input parameters
Address Address of the targeted node Name Name of the parameter to read Value Value to write

St_ClearWriteParameterList

This function removes all parameters from the list used by St_WriteParameterList.
Syntax
St_ClearWriteParameterList():Void

St_AddWriteParameterList

St_WriteParameterList

This function adds a parameter to the parameter list used by St_WriteParameterList.
Syntax
St_AddWriteParameterList(Address:Number, SignalName:String, Value:String):Void
Input parameters
Address Address of the targeted node SignalName Name of the targeted signal Value Value String of the value to write
This function writes the values to the parameters in the write parameter list.
Syntax
St_WriteParameterList():Boolean
Result
The function returns true if all parameters in list are written successfully.
©
Danfoss | November 2019 AJ00000002en-000601 | 29
Page 30
Design Manual

Parameter files API functions

St_CreateP1tFromFile

This function creates a parameter transfer file based on a CSV or JSON input file. Returns a PLUS+1 return code.
Syntax
St_CreateP1tFromFile(InputFile:String, OutputFile:String):Number
Input parameters
InputFile Input file in CSV or JSON format. OutputFile Output P1T file.

St_CreateP1tFromString

This function creates a parameter transfer file based on a CSV or JSON input string. Returns a PLUS+1 return code.

St_OpenP1tFile

Syntax
St_CreateP1tFromString(InputString:String, OutputFile:String):Number
Input parameters
InputString Input string with CSV or JSON content. OutputFile Output P1T file.
This function opens a parameter transfer file. Returns a PLUS+1 return code.
Syntax
St_OpenP1tFile(InputFile:String):Number
Input parameters
InputFile Input file in CSV or JSON format.
30 | © Danfoss | November 2019 AJ00000002en-000601
Page 31
Design Manual
Parameter files API functions

St_GetP1tFileEcuData

This function retrieves ECU information from the opened parameter transfer file.
Syntax
St_GetP1tFileEcuData(Item:Number):String
Input parameters
Item The type of data to retrieve, see the table below:
Item no. Description
0 File Application Node Number 1 File Application TimeKey 2 File Application OS family 3 File Application ID 4 File Application Tool version 5 File Hardware Manufacture date 6 File Hardware Bootloader version

St_GetP1tFileParameterCount

St_GetP1tFileParameterData

This function retrieves the number of parameters in the opened parameter transfer file.
Syntax
St_GetP1tFileParameterCount():Number
This function retrieves parameter information from the opened parameter transfer file.
Syntax
St_GetP1tFileParameterData(Index:Number, Item:Number):String
Input parameters
Item The type of data to retrieve, see the table below:
Item No. Item name Description
0 Parameter name 1 Parameter type See Data and Data Types. 2 Parameter value 3 Parameter Read access level See Access rights on page 16. 4 Parameter Write access level
©
Danfoss | November 2019 AJ00000002en-000601 | 31
Page 32
Design Manual

CAN message API functions

St_SendCan

This function sends a CAN message. The length of the CAN message and the supplied CAN data bytes need to match. Returns a PLUS+1 return code.
Syntax
St_SendCan(CanId:Number, Ext:Boolean, Len:Number[, Data0:Number, ]):Number
Input parameters
CanId The identifier of the CAN message to send Ext
Len The length of the message Data0 (optional) Byte 0 in the CAN Frame. Data1 (optional) Byte 1 in the CAN Frame. Data2 (optional) Byte 2 in the CAN Frame. Data3 (optional) Byte 3 in the CAN Frame. Data4 (optional) Byte 4 in the CAN Frame. Data5 (optional) Byte 5 in the CAN Frame. Data6 (optional) Byte 6 in the CAN Frame. Data7 (optional) Byte 7 in the CAN Frame.
If the parameter value is true, a Extended identifier CAN Frame will be sent.
If the parameter value is false, a Standard identifier CAN Frame will be sent.
32 | © Danfoss | November 2019 AJ00000002en-000601
Page 33
Design Manual

File download API functions

St_OpenApplication

This function opens a PLUS+1 downloadable application file for download. The file is checksum verified and matched with the supplied node. Returns a PLUS+1 return code.
Syntax
St_OpenApplication(Address:Number, FileName:String):Number
Input parameter
Address Address of the targeted node FileName The name of the file to download. It is only possible to download files that have been added to the

St_GetDownloadData

This function retrieves information about the opened download file.
Syntax
St_GetDownloadData(Item:Number):String
Input parameter
Design/Script/Resources tree item in the P1D file.
Item The type of data to retrieve, see the table below:
Item No. Description
0 Filename opened for download 1 Application Size number of bytes in hexadecimal notation. 2 Highest used Address in hexadecimal 3 File OS family 4 File OS identity 5 File Application Type 6 File Application TimeKey 7 Node OS family 8 Node OS identity 9 Node Application Type 10 Node Application TimeKey 11 LHX Readme File Size 12 LHX Readme File Binary Data 13 File Application Version 14 Node Application Version 15 File Application ID 16 Node Application ID 17 Disabled Parameter Count 18 Restricted Parameter Count 19 ECU Dynamic Parameters 20 File Dynamic Parameters 21 Read-Only parameter file type 22 File System ID
©
Danfoss | November 2019 AJ00000002en-000601 | 33
Page 34
Design Manual
File download API functions
Item No. Description
23 Node System ID 24 Application release status info. A comma separated list of supported valid values:

St_SetDownloadParameterValue

This function sets a parameter value in non-volatile memory for the currently opened application. The application remains open until downloaded with St_DownloadFile.
Returns a PLUS+1 return code. Depends on St_OpenApplication.
Syntax
St_SetDownloadParameterValue(Name:String, Value:String):Number
Input parameters
Name The name of the parameter Value The value to write when downloading the application.
TRIAL: Application created using a trial license. HWD: Unreleased HWD file. TOOL: Unreleased version of PLUS+1 GUIDE.

St_DownloadFile

St_DownloadPackage

This function downloads the file loaded with the function St_OpenApplication to the node. Returns a PLUS+1 return code.
Parameter Settings will be performed in the same way as if the user clicked OK in the Parameter Settings dialog.
Syntax
St_DownloadFile():Number
This function downloads the applications in the System Download Package. The ECU mapping is done automatically, no attempt to download any file is done if the mapping is
unclear, and returns a PLUS+1® return code.
Syntax
St_DownloadPackage(FileName:String):Number
Input parameter
FileName The full path and file name of the download package file.
34 | © Danfoss | November 2019 AJ00000002en-000601
Page 35
Design Manual

Service application API functions

St_GetScreenNodeCount

This function returns the number of nodes used on the currently selected Advanced Parameter page.
Syntax
St_GetScreenNodeCount():Number

St_GetScreenNodeAddress

This function returns the full node address for a node used on the currently selected Advanced Parameter page.
Syntax
St_GetScreenNodeAddress(Index:Number):Number
Input parameter
Index The index of the targeted node.

St_GetScreenParameterCount

St_GetScreenParameterData

This function returns the number of parameters used on the currently selected Advanced Parameter screen.
Syntax
St_GetScreenParameterCount():Number
This function returns data for a parameter used on the currently selected Advanced Parameter screen.
Syntax
St_GetScreenParameterData(Index:Number, Item:Number):String
Input parameters
Index The index of the targeted parameter. Item The data item to request.
Item No. Item Name Description
0 Address Address of the node 1 Parameter name Name of the parameter 2 Value Edit value of the parameter 3 Return code The PLUS+1® return code for the parameter 4 Error message The PLUS+1® error message for the parameter 5 Comment The comment text for the parameter 6 Download ‘1’ if download checkbox if checked, otherwise ‘0’ 7 Locked ‘1’ if changing edit value is locked, otherwise ‘0’ 8 min The minimum value 9 max The maximum value 10 Default The default value
©
Danfoss | November 2019 AJ00000002en-000601 | 35
Page 36
Design Manual
Service application API functions

St_SetScreenParameterData

This function sets data for a parameter used on the currently selected Advanced Parameter page.
Syntax
St_SetScreenParameterData(Index:Number, Item:Number, Value:String):Number
Input parameters
Index The index of the targeted parameter. Item The item to set, see the table below:
Item No. Item Name Description
0 Value Edit value of the parameter. 1 Download ‘1’ to check download checkbox, ‘0’ to uncheck download checkbox.

St_ReloadScreen

This function reloads the currently select Log/Parameter screen.
Syntax
St_ReloadScreen():Void

St_UpdateScreenLogValues

St_IsLogging

St_ActivateDocument

This function read all log signals on the currently selected screen and updates the screen values.
Values in Parameter components will not be updated.
Syntax
St_UpdateScreenLogValues():Void
This function returns true if logging is currently running.
Syntax
St_IsLogging():Boolean
This function open a document from the Documents tree item in the service application. The document is opened using the associated program in Windows.
Syntax
St_ActivateDocument(FileName:String):Boolean
Input parameter
FileName The name of the file to open.

St_GetResourceFileCount

This function returns the number of resource files available in the Design/Script/Resources tree item in the service application.
Syntax
36 | © Danfoss | November 2019 AJ00000002en-000601
Page 37
Design Manual
Service application API functions
St_GetResourceFileCount():Number

St_GetResourceFileData

This function returns data for a resource file.
Syntax
St_GetResourceFileData(Index:Number, Item:Number):String
Input parameters
Index The index of the resource file. Item The data item to request.
Item No. Description
0 File name of the resource file.

St_SelectResourceFileDialog

This function displays a modal Windows dialog box for selecting resource files. Returns the filename of the select file or empty string if no was selected.
Syntax
St_SelectResourceFileDialog(Caption:String, FilterDescription:String, FileFilter:String):String
Input parameters
Caption Specifies the text in the dialog's title bar. FilterDescription The description to the display in the file filter selection. FileFilter Determines the file mask (filter) available in the dialog.

St_GetGenericEcuDefinitionCount

This function returns the number of generic ECU definitions available in the service application.
Syntax
St_GetGenericEcuDefinitionCount():Number

St_GetGenericEcuDefinitionData

This function returns data for a generic ECU definition.
Syntax
St_GetResourceFileData(Index:Number, Item:Number):String
Input parameters
Index The index of the generic ECU definition. Item The data item to request.
Item No. Description
0 Name of the generic ECU definition. 1 Signal name sorting status. '1' if sorting status is OK, otherwise '0' indicating that the net/node
number sorting was used instead.
©
Danfoss | November 2019 AJ00000002en-000601 | 37
Page 38
Design Manual
Service application API functions

St_GetGenericEcuCount

This function returns the number of generic ECUs assigned to a generic ECU definition.
Syntax
St_GetGenericEcuCount(DefinitionIndex:Number):Number
Input parameters
DefinitionIndex The index of the generic ECU definition.

St_GetGenericEcuData

This function returns data for a generic ECU.
Syntax
St_GetGenericEcuData(DefinitionIndex:Number, EcuIndex:Number, Item:Number):String
Input parameters
DefinitionIndex The index of the generic ECU definition. EcuIndex The index of the generic ECU. Item The data item to request.
Item No. Description
0 Name of the generic ECU. 1 ECU address of the generic ECU. 2 Sorting status. '1' if sorting status is OK, otherwise '0'
38 | © Danfoss | November 2019 AJ00000002en-000601
Page 39
Design Manual

Report API functions

St_EnableAutoReport

This function is used to determine whether calls to API functions will be automatically added to the report.
Syntax
St_EnableAutoReport(Enable:Boolean):Void
Input parameter
Enable If the parameter value is true, each API function call will be automatically added to the report.

St_AddReportLine

This function adds a line to the script report.
Syntax
St_AddReportLine(Line:String):Void
Input parameter

St_SaveScriptReport

St_ClearScriptReport

Line The report line to add.
This function saves the script report to disk.
Syntax
St_SaveScriptReport(FileName:String):Void
Input parameter
FileName The full path and filename of the report file.
This function clears all current lines in the script report.
Syntax
St_ClearScriptReport():Void
©
Danfoss | November 2019 AJ00000002en-000601 | 39
Page 40
Design Manual

Hyperlink API functions

Hyp_ScanSystem

This function hyperlink to the menu item File/Scan System.
Syntax
Hyp_ScanSystem():Void

Hyp_UnitHistory

This function hyperlink to the menu item File/Read ECU History.
Syntax
Hyp_UnitHistory():Void

Hyp_ViewNavigator

This function hyperlink to the menu item: System Navigator > View Syntax
Hyp_ViewNavigator():Void

Hyp_StartLog

Hyp_StopLog

Hyp_ParamUpload

Hyp_ParamDownload

This function hyperlink to the menu item Log/Start Logging.
Syntax
Hyp_StartLog():Void
This function hyperlink to the menu item Log/Stop Logging.
Syntax
Hyp_StopLog():Void
This function hyperlink to the menu item Parameter/Upload.
Syntax
Hyp_ParamUpload():Void
This function hyperlink to the menu item Parameter/Download.
Syntax
Hyp_ParamDownload():Void

Hyp_ReplaceMissingEcu

This function hyperlink to the menu item File/Replace Missing ECU.
Syntax
Hyp_ReplaceMissingEcu():Void
40 | © Danfoss | November 2019 AJ00000002en-000601
Page 41
Design Manual
Hyperlink API functions

Hyp_ReplaceExistingEcu

This function hyperlink to the menu item File/Replace Existing ECU.
Syntax
Hyp_ReplaceExistingEcu():Void

Hyp_Close

This function hyperlink to the menu item File/Exit.
This function will run in Normal View with no pending changes in the P1D file and is performed at the end of the script.
Syntax
Hyp_Close():Void
©
Danfoss | November 2019 AJ00000002en-000601 | 41
Page 42
Design Manual

Progress API functions

Ui_ClearModalProgressList

This function clears the list of items displayed in a modal progress dialog.
Syntax
Ui_ClearModalProgressList():Void

Ui_AddModalProgressItem

This function adds an item to a modal progress dialog.
Syntax
Ui_AddModalProgressItem(Description:String):Void
Input parameter
Description The text to display as description for an item in the progress dialog.

Ui_UpdateModalProgressItem

This function changes the icon for an item in a modal progress dialog.
Syntax
Ui_UpdateModalProgressItem(Index:Number, IconIndex:Number):Void
Input parameters

Ui_ModalProgressStepIt

Index The index of the item in the modal progress dialog. IconIndex The icon to dialog, see the table below:
Item No. Item Description Icon
0 Paused
1 Running
2 Success
3 Error
This function updates the increments the progress bar of a modal progress dialog and updates the text above the progress bar.
Syntax
Ui_ModalProgressStepIt(ProgressText:String):Void
Input parameters
ProgressText The progress text to display.

Ui_ModalSetProgressText

This function updates the text above the progress bar in a modal progress dialog.
Syntax
42 | © Danfoss | November 2019 AJ00000002en-000601
Page 43
Design Manual
Progress API functions
Ui_ModalSetProgressText(ProgressText:String):Void
Input parameter
ProgressText The progress text to display.

Ui_InitModalSequence

This function initializes a modal progress dialog.
Syntax
Ui_InitModalSequence(Caption:String, ProgressMax:Number, NativeProgress:Number, ShowList:Boolean):Void
Input parameters
Caption The caption of the modal progress dialog. ProgressMax The maximum position of the progress bar. NativeProgress If the parameter value is true, the progress dialog will be updated with native progress with
ShowList If the parameter value is true, the item list box will be displayed in the modal progress dialog.
calling API functions that support this. This can for example be used to update the progress bar during a file download. The ProgressMax parameter needs to be increased by 100 for each API supporting native progress.

Ui_EndModalSequence

This function ends a modal script sequence.
Syntax
Ui_EndModalSequence(ShowReport:Boolean, AutoClose:Boolean):Void
Input parameters
ShowReport If the parameter value is true, the Show Report button will be displayed. AutoClose If the parameter value is true, the modal progress dialog will be automatically closed.
©
Danfoss | November 2019 AJ00000002en-000601 | 43
Page 44
Design Manual

User interface API functions

Ui_ShowUI

This function displays the HTML content of the P1U file in a modal dialog. The dialog will be displayed centered on the Service Tool main window if both Left and Top is set to zero.
Syntax
Ui_ShowUI(Caption:String, Left:Number, Top:Number, Width:Number, Height:Number):Void
Input parameters
Caption The caption of the dialog. Left The left position of the dialog. Top The top position of the dialog. Width The width of the dialog. Height The height of the dialog.
44 | © Danfoss | November 2019 AJ00000002en-000601
Page 45
Design Manual

Service Tool events

This chapter specifies how a JavaScript can be executed when certain Service Tool event occurs (triggered by user or from a script).
//PLUS+1-reg: _ServiceTool_BeforeLoadScreen
function _ServiceTool_BeforeLoadScreen(screenName) { if (screenName == "Communication Data”) { St_MessageBox("Parameter Screen"); } }

_ServiceTool_BeforeScanSystem

This event is fired before Scan System is started.
Syntax
_ServiceTool_BeforeScanSystem():Void

_ServiceTool_AfterScanSystem

This event is fired when Scan System is finished.
Syntax
_ServiceTool_AfterScanSystem():Void

_ServiceTool_BeforeParameterUpload

This event is fired before Parameter Upload.
Syntax
_ServiceTool_BeforeParameterUpload():Void

_ServiceTool_AfterParameterUpload

This event is fired when Parameter Upload is finished.
Syntax
_ServiceTool_AfterParameterUpload():Void

_ServiceTool_BeforeParameterDownload

This event is fired before Parameter Download.
Syntax
_ServiceTool_BeforeParameterDownload():Void

_ServiceTool_AfterParameterDownload

This event is fired when Parameter Download is finished.
Syntax
_ServiceTool_AfterParameterDownload():Void
©
Danfoss | November 2019 AJ00000002en-000601 | 45
Page 46
Design Manual
Service Tool events

_ServiceTool_AfterStartLog

This event is fired when logging is started.
Syntax
_ServiceTool_AfterStartLog():Void

_ServiceTool_AfterStopLog

This event is fired when logging is stopped.
Syntax
_ServiceTool_AfterStopLog():Void

_ServiceTool_BeforeLoadScreen

This event is fired before a Service screen is loaded.
Syntax
_ServiceTool_BeforeLoadScreen(ScreenName:String):Void
Input parameter

_ServiceTool_AfterLoadScreen

_ServiceTool_AfterFileOpen

ScreenName The name of the Service screen that is loaded.
This event is fired after a Service screen has been loaded.
Syntax
_ServiceTool_AfterLoadScreen(ScreenName:String):Void
Input parameter
ScreenName The name of the Service screen that is loaded.
This event is fired after the P1D file is opened.
This event will only be triggered when in Normal View.
Syntax
_ServiceTool_AfterFileOpen():Void
46 | © Danfoss | November 2019 AJ00000002en-000601
Page 47
Design Manual

Appendix A: Return codes

Return codes specification
Code Type Description Explanation
-1 Success Function returned without any error or warnings 48 File File Not Found in Packed File The file was unpacked successfully but did not contain the expected file. 53 File Can Not Recognize File Format. The service tool was unable to determine file format. 54 File Checksum Error in System File Head 55 File Checksum error in file The file is corrupt and may not be used in the current function call. 62 User File not found Supplied file could not be found. Verify that a full path and extension is
70 File Invalid format in file File may be generated with a new software version that is unsupported. 90 File Directory not Found The path supplied in the function call does not exist. 105 File File Access Denied Read or write access required for the file. 116 User File Access Denied Read access required for the file.. 126 File Unable to open The file cannot be opened. Make sure that the file is not opened by
138 User Unsupported parameter type Select parameter name is not supported by the API.
151 User Value out of range See PLUS+ 1 parameter type table under GetParameterData for parameter
166 ECU Unknown key value ECU application is invalid and needs to be updated to allow diagnostics. 200 Unable to open gateway 201 User API function already running Call to a function has not finished. Wait until previous call finishes. 202 Invalid node number 203 ECU Invalid answer ECU application answered with an invalid response. 204 User No answer from node Check cabling and make sure that ECU is powered. 205 User Invalid baudrate Selected baudrate is not supported. See Open for a list of valid baudrates. 211 ECU Unsupported infoblock Unsupported ECU application. 212 ECU Unable to load diagnostic data Error occurred while loading the diagnostic data. 213 ECU Unable to restore diagnostic data Error occurred while decoding the diagnostic data. 214 ECU Unable to read diagnostic data Error occurred while uploading the diagnostic data from the ECU. 215 Warning No valid diagnostic data available ECU application does not contain any diagnostic data. May be caused by
216 User No node data retrieved with LoadNodeData LoadNodeData must be successfully executed for the ECU. 218 User Parameter list empty No parameters added with AddReadParameterList or
221 User ParameterName not found Supplied parameter name was not found in the diagnostic data. Use
222 Parameter list not loaded 223 ECU Unable to write parameters Error occurred while writing the parameters to the ECU. 230 Unable to restore parameter list setup 231 User File does not match this node Download file does not match the ECU. Ensure that the correct FullAddress
232 User Download to node aborted 236 User No file opened Open the file to download before calling the download file function. 238 ECU Infoblock checksum error ECU application is invalid and needs to be updated to allow diagnostics. 239 Invalid File Entry 241 ECU Unable to read node data ECU application is invalid and needs to be updated to allow diagnostics. 242 User Incorrect toolkey Access restricted to ECU because the supplied toolkey is incorrect.
supplied to the file.
another application.
See PLUS+ 1 parameter type table under GetParameterData for valid parameter types.
value ranges.
ECU running in boot mode. ECU will start in boot mode if DownloadCancel is used. File Download is still possible.
AddWriteParameterList.
GetParameterData to verify that the parameter name is valid.
is used and read ECU application information with GetNodeInfo.
©
Danfoss | November 2019 AJ00000002en-000601 | 47
Page 48
Design Manual
Appendix A: Return codes
Return codes specification (continued)
Code Type Description Explanation
243 License Invalid LicenseFile Supplied LicenseFile is invalid. 244 File Invalid download file Supplied download file is invalid. 245 ECU Verify failed Write parameter failed because the verify value was different from the
246 Function not started 247 User File not authorized to be downloaded to this node File does not match ECU partnumber or serialnumber 248 ECU Security access denied 249 ECU Unable to start diagnostic session 250 ECU Invalid diagnostic data length ECU answered with a invalid diagnostic data length. 251 ECU Node reset failed 252 ECU Unit history update failed 253 ECU Request of download checksum failed 254 ECU Calculation of download checksum failed 255 ECU Transfer exit failed 256 ECU Erase flash request failed 257 ECU Erase flash failed 258 ECU Download request okay size missing 259 ECU Download request failed 260 ECU Unable to write unit history 261 ECU Unable to start download session 262 File Invalid diagnostic data This error may be returned if a Read Only Parameter download file is
264 File Application ID missing in file 265 User Security access timeout
266 ECU Download transfer timeout 267 ECU Download transfer failed 268 Warning Access denied to application without toolkey
269 OS family keyword missing in file 270 User Invalid data in file 271 ECU Diagnostic Data Error: Index out of range 272 ECU Diagnostic Data Error: Invalid address vector length 273 ECU Diagnostic Data Error: No end tag 274 ECU Diagnostic Data Error: Signal outside struct group 275 ECU Diagnostic Data Error: Invalid data type 276 ECU Diagnostic Data Error: Invalid flag 277 ECU Diagnostic Data Error: Invalid struct format 278 ECU Diagnostic Data Error: Invalid struct group format 279 ECU Diagnostic Data Error: Invalid array range 280 ECU Diagnostic Data Error: Invalid end of data 282 ECU Diagnostic Data Error: Invalid INF tag 283 ECU Diagnostic Data Error: Missing APP log parameters 284 ECU Diagnostic Data Error: Missing ROP file parameters
written value. May indicate a faulty ECU or may occur if the ECU application sets the parameter value.
Error occurred while communicating with the ECU.
File Download failed because of incorrect answer from ECU.
opened with OpenApplication.
Last call to LoadNodeData failed because of incorrect toolkey. Wait 10 seconds before calling LoadNodeData with a different toolkey.
File Download failed because of incorrect answer from ECU.
Toolkey is required for ECU applications developed in GUIDE. File Download is still possible.
Parsing of the file failed since it contains unexpected or invalid data.
48 | © Danfoss | November 2019 AJ00000002en-000601
Page 49
Design Manual
Appendix A: Return codes
Return codes specification (continued)
Code Type Description Explanation
302 Unexpected Error with Message An unexpected error occurred. The error text contains additional
316 ECU Unable to read application log Make sure that a system scan is performed after an ECU has been power
319 ECU Application log file empty 321 ECU Download disabled by node application 322 User Access denied to parameter 323 ECU Unable to initialize parameter read 329 User Node application requires SIL2 certified tool 353 Unsupported File Format The file format or file format version is not supported. 401 Loading DLL Failed The DLL failed to load. 444 Loading Function From DLL Failed The DLL is missing a mandatory function. 500 User API already started Run Close before running Open.
User API not started Open must be successfully executed. 502 User Diagnostic data not loaded LoadNodeData must be successfully executed for the ECU. 503 License Incorrect LicenseFile version Unsupported LicenseFile. 504 User Incorrect API DLL filename API DLL filename needs to be Plus1Diag.dll 505 User Incorrect license key Supplied license key is incorrect. 507 User Invalid gateway selection See Open for a list of valid gateways. 508 User Gateway drivers not found Drivers for the selected gateway was not found. Check that the drivers are
509 User DiagnosticFilePath not found Check that a full path is supplied. 510 User License does not support Customer ID 511 User Invalid Customer ID value See SetCustomerID for valid Customer ID ranges. 512 User No nodes found Check cabling and make sure that ECU is powered. 513 User Invalid node index The node index supplied in the function call is out of range. Valid range is
514 User Invalid Item value The item value supplied in the function call is not supported. See the
515 User Invalid Index value The index supplied in the function call does not exist. See the count
516 User Buffer too small Buffer is too small to contain the result string. 517 ECU Unable to read node type Unsupported ECU application. 518 User Access to node denied See ECU Application Support section for supported ECU applications. 519 ECU Unable to read unit history Error occurred while communicating with the ECU. 520 User Invalid parameter value Supplied parameter value is not a valid number value. 521 User No download started A file download must be started with DownloadApplication before using
522 User Gateway Error Unable to connect to selected gateway. Check driver installation and make
523 User LicenseFile has expired 524 User The parameter has already been added to the list Same parameter cannot be added to the list more than once. 525 Invalid range 526 Access restricted by node The ECU application has denied access to the function. 527 No read only parameter file info available 528 User Parameter Access Denied Access restricted by ECU application 529 Write access level not available Write access level information is not available for non-volatile parameters.
information about the error.
cycled before reading application log data.
properly installed.
from 0 to GetNodeCount -1.
specified function for supported items.
function the function call depends on for valid index range.
this function.
sure it is connected.
©
Danfoss | November 2019 AJ00000002en-000601 | 49
Page 50
Design Manual
Appendix A: Return codes
Return codes specification (continued)
Code Type Description Explanation
531 Invalid parameter format 532 Parameter not assigned 533 Invalid option value Invalid option value in P1_Open options parameter. 534 No data available 535 Unable to read parameter data 536 File does not match target The selected download file does not match the target ECU. 537 Warning Parameter setup changed 538 Unable to find node after download This error can be returned when a ECU application with a different baud
539 Download CRC not calculated 540 Download CRC failed 541 Download CRC algorithm failed 542 Download CRC calculation ongoing 543 Download CRC value missing 544 Unable to verify download CRC 545 No application log data available 546 Read only parameter data structure not matching 547 Read only parameter type not matching 548 Invalid read only parameter checksum 549 Read only parameter size not matching 550 Invalid Option Name 551 Parameter not in Read Parameter List 552 Parameter not in Write Parameter List 558 ECU ECU is in boot loader mode Download a valid ECU application. 567 Value not received within expected rate Reported on CAN Xplorer signals with expected rate attribute defined 600 This protocol does not support Recover ECU Returned if ECU recover is not supported by the protocol when calling
601 This protocol does not support Diagnostic Data Files Returned if installing diagnostic data is not supported by the protocol
602 This protocol does not support Application
Download Files
603 This protocol does not support Parameter Download
Files
605 This protocol does not require a specific Service Tool
Version
606 Invalid Control Code Returned by the protocol if an invalid control code is supplied when calling
607 Invalid Protocol Id The supplied protocol ID is not supported by the DLL 611 Protocol DLL No Result Set The function call did not garner a result. 612 Invalid Protocol DLL The Service tool failed to activate the DLL. 613 INTERNAL: Unable to enter boot loader mode The DLL failed to automatically enter boot loader mode which is required
614 ECU application is disabled. Power cycle the system 657 User Function requires Online mode 658 User Function not allowed Calls to API functions are currently restricted. 660 User Base parameter written, bit value skipped The parameter list contains both the base parameter and bit values.
rate is downloaded.
The file download could not be verified because an error during the CRC calculation.
The Read Only Parameter file does not match the selected ECU.
GetProtocolInfo(HasRecoverEcuSupport).
when calling GetProtocolInfo(DiagnosticDataFileFilter). Returned if downloading application files is not supported by the protocol
when calling GetProtocolInfo(DownloadApplicationFileFilter). Returned by the protocol if downloading parameter files is not supported
when calling GetProtocolInfo(DownloadParameterFileFilter). Returned by the protocol if minimum API level is not specified when
calling GetProtocolInfo(APILevel).
ControlGateway
by the function all
50 | © Danfoss | November 2019 AJ00000002en-000601
Page 51
Design Manual
Appendix A: Return codes
Return codes specification (continued)
Code Type Description Explanation
678 User Unable to verify file download and transfer
parameter values because the correct Tool Key has not been supplied.
1006 User SD API already started The protocol is already initialized. Call close before reinitializing the
1007 User SD API not started 1008 User Unknown Protocol The supplied full node address contains an unsupported protocol ID 1012 String Parameter too long 1013 Unhandled exception 1014 ProgressProc exception An error occurred when updating a progress bar. 1099 Invalid handle 1100 Unable to write to VAR-declared parameter 1500 This function is not supported by the specified node. 1501 File has expired 2000 Function not supported by API 2001 Gateway does not support offline device information 2002 Gateway not on CAN Bus Yet The CAN API has not been activated by the protocol
It is recommended to supply the correct Tool Key and verify parameter values.
protocol.
©
Danfoss | November 2019 AJ00000002en-000601 | 51
Page 52
Danfoss Power Solutions GmbH & Co. OHG
Krokamp 35 D-24539 Neumünster, Germany Phone: +49 4321 871 0
Danfoss Power Solutions ApS
Nordborgvej 81 DK-6430 Nordborg, Denmark Phone: +45 7488 2222
Danfoss Power Solutions (US) Company
2800 East 13th Street Ames, IA 50010, USA Phone: +1 515 239 6000
Danfoss Power Solutions Trading (Shanghai) Co., Ltd.
Building #22, No. 1000 Jin Hai Rd Jin Qiao, Pudong New District Shanghai, China 201206 Phone: +86 21 2080 6201
Products we offer:
Hydro-Gear
www.hydro-gear.com
Daikin-Sauer-Danfoss
www.daikin-sauer-danfoss.com
DCV directional control
valves Electric converters
Electric machines
Electric motors
Gear motors
Gear pumps
Hydrostatic motors
Hydrostatic pumps
Orbital motors
PLUS+1® controllers
PLUS+1® displays
PLUS+1® joysticks and
pedals PLUS+1® operator
interfaces PLUS+1® sensors
PLUS+1® software
PLUS+1® software services,
support and training Position controls and
sensors PVG proportional valves
Steering components and
systems Telematics
Danfoss Power Solutions is a global manufacturer and supplier of high-quality hydraulic and electric components. We specialize in providing state-of-the-art technology and solutions that excel in the harsh operating conditions of the mobile off-highway market as well as the marine sector. Building on our extensive applications expertise, we work closely with you to ensure exceptional performance for a broad range of applications. We help you and other customers around the world speed up system development, reduce costs and bring vehicles and vessels to market faster.
Danfoss Power Solutions – your strongest partner in mobile hydraulics and mobile electrification.
Go to www.danfoss.com for further product information.
We offer you expert worldwide support for ensuring the best possible solutions for outstanding performance. And with an extensive network of Global Service Partners, we also provide you with comprehensive global service for all of our components.
Local address:
Danfoss can accept no responsibility for possible errors in catalogues, brochures and other printed material. Danfoss reserves the right to alter its products without notice. This also applies to products already on order provided that such alterations can be made without subsequent changes being necessary in specifications already agreed. All trademarks in this material are property of the respective companies. Danfoss and the Danfoss logotype are trademarks of Danfoss A/S. All rights reserved.
©
Danfoss | November 2019 AJ00000002en-000601
Loading...