24 38 Joos Siemens Introduction To SimTalk 2 0
24 38 Joos Siemens Introduction To SimTalk 2 0
24 38 Joos Siemens Introduction To SimTalk 2 0
Michael Joos
© 2016 Siemens AG
Less is More
© 2016 Siemens AG
If-Then-Else
© 2016 Siemens AG
While-Loop
© 2016 Siemens AG
For-Loop
© 2016 Siemens AG
© 2016 Siemens AG
Switch-Statement
© 2016 Siemens AG
© 2016 Siemens AG
Example:
param n: integer := 18
Method_2_0 -- prints 18
Method_2_0(19) -- prints 19
© 2016 Siemens AG
3 4 5
A default argument is only allowed for the n last
3 4 parameters. It cannot be used in the middle of a
3.33
declaration.
3 0
3.33
param x:real, s:string, z:integer:=42
0 0
3.33 O.K.
param x:real, s:string:=“Hello”, z:integer:=42
© 2016 Siemens AG
O.K.
Page 12 Michael Joos
© 2016 Siemens AG
New operators += , –= , *=
Example:
i := i + 1 –> i += 1
x += y is short for x := x + y
x –= y is short for x := x – y
x *= y is short for x := x * y
x /= y is “unequal” as in SimTalk 1.0
Page 14
The new operators also increase performance. Michael Joos
About-Equal-Operator
© 2016 Siemens AG
Reading CardFiles
SimTalk 1.0:
When reading the contents of a cell of a CardFile or
stack with the bracket operator, Plant Simulation reads
and removes the cell.
The remaining cells move up one position.
SimTalk 2.0:
When reading the contents of a cell of a CardFile or
stack with the bracket operator, Plant Simulation reads
the cell and leaves it in
the CardFile/stack.
© 2016 Siemens AG
© 2016 Siemens AG
© 2016 Siemens AG
Waituntil/Stopuntil
© 2016 Siemens AG
© 2016 Siemens AG
© 2016 Siemens AG
Thank you!
Michael Joos
Tecnomatix Plant Simulation
Weissacher Str. 11
70499 Stuttgart
E-mail: [email protected]
siemens.com
© Siemens AG 2016
Page 22 22.06.2016 Michael Joos