Siemens SINUMERIK 840D sl Operating Manual page 343

Integrate create myconfig - diff, expert, topo
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Scripts library-specific syntax
For the definition of procedures and functions, the command scope has been extended by the
keywords "proc" and "func".
When you create a new definition, start the line with one of the keywords. This is followed by
a procedure name or function name, transferred arguments and on opening curly bracket. The
definition is completed with a closing curly bracket.
Example
Example of a procedure with the name "MyProcedure" and without transferred arguments
proc MyProcedure() {
;User script
}
Example
If a procedure or function is to have transferred arguments, then use a "$" as identifier.
The arguments defined in this way have no type, i.e. they can assume every data type known
to the scripting.
A maximum of 9 arguments can be transferred per definition. The query in the procedure or
function is performed by the construct Up.$1 to Up.$9.
The arguments therefore correspond to a UP variable and can be used directly in queries,
assignments or used again as function arguments.
Example of a function with the name "MyFunction" and two arguments
func MeineFunktion($, $) {
Up.Arg1 = Up.$1
Up.Arg2 = Up.$2
;User script
If Up.Result == true
Else
Endif
}
Note that functions must have a return value. The return value is transferred by the return
function and can be represented by numerical values, character strings and UP variables.
However, procedures must not return a value.
Optional specifications
The example listed above completely describes a function defined by the user. You can add
optional specifications which facilitate later use.
Through a comment with the keyword "Description:", you can add a brief description of the
procedure or function.
SINUMERIK Integrate Create MyConfig - Diff, Expert, Topo
Operating Manual, 12/2017, A5E36537479B-AE
Return(0)
Return(-1)
Create MyConfig - Expert
4.6 Script language
343

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828d

Table of Contents