|
|
Variables
5.9 Example 7: Password input mode (asterisk)
5.9
Example 7: Password input mode (asterisk)
Example 7
To implement a field with hidden input, e.g. to enter a password, then display mode DT must be
set to 5. Asterisks are then displayed instead of the entered characters.
Figure 5-3
Password input mode (asterisk)
DEF VAR_SET_PWD=(S//""//DT5)
Variable type:
STRING
Default setting:
Empty string
Attributes:
Display mode DT:
5 (password input mode)
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
91
Variables
5.10 Variable parameters
5.10
Variable parameters
Parameter overview
The following overview provides a brief explanation of the variable parameters. Subsequent
chapters contain a more detailed description.
Parameter
Description
Variable type (Page 98)
The variable type must be specified.
R[x]:
REAL (+ digit for the decimal place)
I:
INTEGER
S[x]:
STRING (+ digit for string length)
C:
CHARACTER (individual character)
B:
BOOL
V:
VARIANT
Limits (Page 85)
Limit value MIN, limit value MAX
Default setting: Empty
The limit values are separated by a comma. Limits can be specified for types I, C and R in
decimal formats or as characters in the form "A", "F".
Optionally, two signal colors SC1 and SC2 can be configured for the display of a progress
bar with color change (variable attribute DT = 1) which are displayed as the respective
foreground color of the bar when the signal value SVAL1 or SVAL2 is exceeded. The signal
values are specified as integer values.
See application example for Progress bar (Page 89).
Default setting (Page 103)
If no default setting has been configured and no system or user variable has been assigned
to the variable, the first element of the toggle field is assigned. If no toggle field has been
defined, there is no default setting, which means the status of the variable is "not calcu-
lated".
Default setting: No default
Toggle field (Page 101)
List with predetermined entries in the IO field: The list is initiated by a *; the entries are
separated by a comma. The entries can be assigned a value.
For the toggle field, the entry for the limit is interpreted as a list. If only one * is entered, a
variable toggle field is created.
Default setting: None
Texts (Page 84)
The sequence is specified. Instead of a short text, an image can also be displayed.
Default setting: Empty
Long text:
Text in the display line
Short text:
Name of the dialog element
Graphic text:
Text refers to the terms in the graphics
Unit text:
Unit of the dialog element
Tooltip
Serves as brief information in a screen form configuration for
the display and toggle fields. The information is configured via
plain text and language text ID.
SINUMERIK Integrate Run MyScreens
92
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.10 Variable parameters
Parameter
Description
Attributes (Page 85)
The attributes influence the following properties:
● Display mode
● Display option
● Update rate
● Toggle symbol
● Tooltip
● Input mode
● Access level
● Alignment of short text
● Font size
● Limits
The attributes are separated by commas and appear in any order. A definition can be made
for each component.
Display mode
dt0: Standard (input/output field or toggle field) (default)
dt1: Progress bar with color change
dt2: Progress bar without color change in the Operate style
dt4: List field
dt5: Password input mode (asterisk)
Display option
Particularly, e.g. for the display modes dt1 and dt2 (progress bars), a
display option may also have to be configured in combination.
do0: From left to right (default)
do1: From right to left
do2: From bottom to top
do3: From top to bottom
Update rate
The attribute UR (update rate) controls the update of the display and
therefore the processing of the associated, configured CHANGE block
of variables or grid columns. Depending on the configuration, the CPU
load can be drastically reduced and therefore shorter response times
achieved on the user interface.
ur0: SlCap::standardUpdateRate() (currently = 200 ms, default value)
ur1: 50 ms
ur2: 100 ms
ur3: 200 ms
ur4: 500 ms
ur5: 1000 ms
ur6: 2000 ms
ur7: 5000 ms
ur8: 10000 ms
Toggle symbol
tg0: Toggle symbol off (default)
tg1: Toggle symbol on
If the attribute TG is set to 1, the toggle symbol also appears in the
tooltip of the input field.
Example:
DEF OFFS = (R//123.456/,,,,"My ToolTip"/TG1)
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
93
Variables
5.10 Variable parameters
Parameter
Description
Tooltip
The tooltip text can also be changed during runtime via the variable
property "TT".
Example:
PRESS(VS1)
MyVar.TT = "My new ToolTip"
END_PRESS
or
DEF MyVar=(R///,,,,"My ToolTip-text")
Input mode
wr0: IO field invisible, short text visible
wr1: Read (no focus possible for input)
wr2: Read and write (line appears in white)
wr3: wr1 with focus
wr4: All variable elements invisible, no focus possible
wr5: The value entered is saved immediately on every keystroke (in
contrast to wr2, where it is only saved when the field is exited or RE-
TURN is pressed).
Default setting: wr2
Access level
Empty: Can always be written
(Page 310)
ac0...ac7: Protection levels
If the access level is not adequate, then the first line is displayed in
gray, default setting: ac7
Alignment of
al0: Left-justified
short text
al1: Right-justified
al2: Centered
Default setting: al0
Font size
fs1: Default font size (8 pt.)
fs2: Double font size
Default setting: fs1
The clearances between the lines is defined. With the default font size,
16 lines will fit into the dialog. Graphics and unit text can only be con-
figured in the default font size.
Limits
Consequently, it is possible to check whether the values of the variable
are within the MIN and MAX limits specified.
Default setting: Determined by specified limits
li0: No check
li1: Check with respect to min.
li2: Check with respect to max.
li3: Check with respect to min. and max.
Behavior when
cb attributes specified for a variable in a variables definition take pri-
opening
ority over the cb default setting in the dialog definition. Multiple attrib-
utes are separated by commas (see also Behavior when opening the
dialog (attribute CB) (Page 314)).
Calling the
CB0: The CHANGE method is triggered when the screen is displayed
CHANGE meth-
if the variable has a valid value at this time (e.g. through default setting
od
or NC/PLC variable).
SINUMERIK Integrate Run MyScreens
94
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.10 Variable parameters
Parameter
Description
CB1: The CHANGE method is not explicitly triggered when the screen
is displayed. If the variable has a configured NC/PLC variable, then the
CHANGE method is of course still called.
Empty Input (EI)
The variable attribute "EI" (= Empty Input) can be used to specify how
the input field is to respond if an empty string is entered.
EI0: Standard, i.e. empty inputs into the input field are accepted.
EI1: Empty inputs lead to an error status for the input field, and the
previous value is set again (Undo).
Help display (Page 84)
Help display file:
Name of the png file
Default setting: Empty
The name of the Help display file appears in double quotation marks. The display appears
automatically (instead of the previous graphic) if the cursor is positioned on this variable.
System or user variable
System or user data from the NC/PLC can be assigned to the variable. The system or user
(Page 86)
variable appears in double quotation marks.
Reference: List Manual System Variables, /PGAsl/
Position of short text (Page 104)
Position of short text (distance from left, distance from top, width)
The positions are entered in pixels and relate to the upper left-hand corner of the main
body of the dialog. The entries are separated by commas.
Position of input/output field
Position of input/output field (distance from left, distance from top, width, height)
(Page 104)
The positions are entered in pixels and relate to the upper left-hand corner of the main
body of the dialog. The entries are separated by commas. If this position changes, the
positions of the short text, graphic text and unit text also change.
Colors (Page 84)
Foreground and backg15round colors for input/output fields, short texts, graphic texts, unit
texts and signal colors for progress bars:
The colors are separated by a comma.
For specification of the color, see Chapter List of colors (Page 311).
Default setting for input/output field: Foreground color: Black, backg15round color: White
The default colors of the input/output field depend on the "wr" write mode:
Default setting for short text, graphic text, unit text: Foreground color: Black, backg15round
color: Transparent.
Optionally, two signal colors SC1 and SC2 can be configured for the display of a progress
bar with color change (variable attribute DT = 1) which are displayed as the respective
foreground color of the bar when the signal value SVAL1 or SVAL2 is exceeded.
See application example for Progress bar (Page 89).
The colors are expected in the following order in the variables definition:
1. Foreground color of the input/output field: FC
2. Background color of the input/output field: BC
3. Foreground color of the short text: FC_ST
4. Background color of the short text: BC_ST
5. Foreground color of the graphic text: FC_GT
6. Background color of the graphic text: BC_GT
7. Foreground color of the unit text: FC_UT
8. Background color of the unit text: BC_UT
9. Signal color 1
10. Signal color 2
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
95
Variables
5.10 Variable parameters
Parameter
Description
Online help file
The name of the online help file appears in double quotation marks.
I/O field with integrated unit se-
You can use the input/output fields with integrated unit selection to toggle between differ-
lection
ent units. If the cursor is moved to the input field, the integrated unit selection is highlighted
(focus does not have to be explicitly placed on it). A tooltip with a toggle symbol is also
displayed with the appropriate reference to this functionality.
Examples:
DEF VarEdit=(R////////200,,100///"VarTgl")
VarTgl=(S/*0="mm",1="inch"/0//WR2////302,,40)
or
DEF VarEdit_2={TYP="R", VAL=1.234, X=200, W=100,
LINK_TGL="vartgl_2"},
VARTgl_2={TYP="S", TGL="* 0=""mm"", 1=""inch""",WR=2, X=302,
W=40}
Variable: Changing properties
The variables are assigned a new value in the notation Identifier.Property = Value when a
change is made. The expression to the right of the equality sign is evaluated and assigned to
the variable or variable property.
Identifier.ac = Access level
(ac: access level)
Identifier.al = Text alignment
(al: alignment)
Identifier.bc = Background color of the input/output field
(bc: back color)
Identifier.bc_gt = Background color of the graphic text
(bc: back color)
(gt: graphic text)
Identifier.bc_st = Background color of the short text
(bc: back color)
(st: short text)
Identifier.bc_ut = Background color of the unit text
(bc: back color)
(ut: unit text)
Identifier.do = Display option
(do: display option)
Identifier.dt = Display mode
(dt: display type)
Identifier.fc = Foreground color of the input/output field
(fc: front color)
Identifier.fc_gt = Foreground color of the graphic text
(fc: front color)
(gt: graphic text)
Identifier.fc_st = Foreground color of the short text
(fc: front color)
(st: short text)
Identifier.fc_ut = Foreground color of the unit text
(fc: front color)
(ut: unit text)
Identifier.fs = Font size
(fs: font size)
Identifier.gt = Graphic text
(gt: graphic text)
Identifier.hlp = Help display
(hlp: help)
Identifier.li = Limit
(li: limit)
Identifier.lt = Long text
(lt: long text)
Identifier.max = MAX limits
(max: maximum)
Identifier.min = MIN limits
(min: minimum)
SINUMERIK Integrate Run MyScreens
96
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.10 Variable parameters
Identifier.sc = Signal color
(sc: signal color)
Identifier.st = Short text
(st: short text)
Identifier.tg = Toggle symbol
(tg: toggle)
Identifier.tt = Tooltip
(tt: tooltip
Identifier .typ = Variable type
(typ: type)
Identifier.ur = Update rate
(ur: update rate)
Identifier.ut = Unit text
(ut: unit text)
Identifier.val = Variable value
(val: value)
Identifier.var = System or user variable
(var: variable)
Identifier.vld = Variable status
(vld: validation)
Identifier.wr = Input mode
(wr: write)
See also
Extended configuration syntax (Page 43)
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
97
Variables
5.11 Details on the variable type
5.11
Details on the variable type
Variable type INTEGER
The following extensions for determining the display in the input/output field and the memory
utilization are possible for the "INTEGER" type:
2nd character in the extension data type
Display format
B
Binary
D
Decimal signed
H
Hexadecimal
No data
Decimal signed
3rd and/or 4th character in the extension data type
Memory utilization
B
Byte
W
Word
D
Double word
BU
Byte, Unsigned
WU
Word, Unsigned
DU
Double word, Unsigned
Sequence of characters in the INTEGER data type
1. "I" Basic INTEGER designation
2. Display format
3. Memory utilization
4. "U" Unsigned
Valid INTEGER type specifications:
IB
Integer variable 32 bits in binary notation
IBD
Integer variable 32 bits in binary notation
IBW
Integer variable 16 bits in binary notation
IBB
Integer variable 8 bits in binary notation
I
Integer variable 32 bits in decimal notation signed
IDD
Integer variable 32 bits in decimal notation signed
IDW
Integer variable 16 bits in decimal notation signed
IDB
Integer variable 8 bits in decimal notation signed
IDDU
Integer variable 32 bits in decimal notation unsigned
IDWU
Integer variable 16 bits in decimal notation unsigned
IDBU
Integer variable 8 bits in decimal notation unsigned
SINUMERIK Integrate Run MyScreens
98
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.11 Details on the variable type
Valid INTEGER type specifications:
IH
Integer variable 32 bits in hexadecimal notation
IHDU
Integer variable 32 bits in hexadecimal notation
IHWU
Integer variable 16 bits in hexadecimal notation
IHBU
Integer variable 8 bits in hexadecimal notation
VARIANT variable type
The VARIANT variable type is determined by the data type of the last value assignment. If the
assigned or entered value starts with '-', '+', '.' or a number ('0'-'9'), then the value is interpreted
as numeric. In all other cases as a string.
It can be scanned using the ISNUM or ISSTR functions. The VARIANT type is mainly suited to
the purpose of writing either variable names or numerical values to the NC code.
Programming
The data type of variables can be checked:
Syntax:
ISNUM (VAR)
Parameter:
VAR
Name of the variable whose data type is to be checked.
The result of the scan can be:
FALSE =
not a numerical variable (data type = STRING)
TRUE =
numerical variable (data type = REAL)
Syntax:
ISSTR (VAR)
Parameter:
VAR
Name of the variable whose data type is to be
checked.
The result of the scan can be:
FALSE =
numerical variable (data type = REAL)
TRUE =
not a numerical variable (data type = STRING)
Example:
IF ISNUM(VAR1) == TRUE
IF ISSTR(REG[4]+2) == TRUE
The display mode of variables can be changed:
● For INTEGER, the display type can be changed.
B
Binary
D
Decimal signed
H
Hexadecimal
unsigned
With the addition of U for Unsigned
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
99
Variables
5.11 Details on the variable type
● For REAL data types, only the number of places after the decimal point can be changed.
Changing the type is illegal and generates an error message in the "easyscreen_log.txt" file.
Example:
Var1.typ = "IBW"
Var2.typ = "R3"
Numerical formats
Numbers can be represented in either binary, decimal, hexadecimal or exponential notation:
Binary
B01110110
Decimal
123.45
Hexadecimal
HF1A9
exponential
-1.23EX-3
Examples:
VAR1 = HF1A9
REG[0]= B01110110
DEF VAR7 = (R//-1.23EX-3)
Note
When codes are generated with the "GC" function, only numerical values in decimal or
exponential notation are evaluated, but not those in binary or hexadecimal notation.
See also
Variable parameters (Page 92)
SINUMERIK Integrate Run MyScreens
100
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.12 Details on the toggle field
5.12
Details on the toggle field
Description
The toggle field extension function displays texts (entries in toggle field) as a function of NC/
PLC variables. A variable, which makes use of a toggle field extension, is read-only. The list of
the toggle field is opened by pressing the ENTER key.
Programming
Syntax:
DEF VAR1=(IB/+ $85000/15////"DB90.DBB5") or
DEF VAR_TGL = (S/* "Hello", "Run", "MyScreens"/"Run")
Description:
When the dialog is opened, the content of text number $85015 is displayed in the IO
field. Default value 15 is entered in system variable DB90.DBB5. If the value saved
in system variable DB90.DBB5 changes, the displayed text number $(85000 +
<DB90.DBB5>) is recalculated in response to every change.
Parameter:
Variable type
Type of variables specified in the system or user variable.
Text number
Number (basis) of the language-specific text valid as the
basis number.
System or user varia-
System or user variable (offset) via which the final text
ble
number (basis + offset) is displayed.
Toggle-field-dependent displays
The toggle field is overlaid with graphics, which change depending on the value of the memory
byte. If the value of the memory byte is 1, "image1.png" will appear. If it is 2, "image2.png" will
appear.
DEF VAR1=(IDB/*1="\\image1.png", 2="\\image2.png"//,$85000/wr1//"MB[130]"//160,40,50,50)
The size and position of the image is defined under "Position of IO field (left, top, width, height)".
Virtual toggle key
There is no list for toggle fields without configured list, e.g. DEF NoTglList=(R/*). The next
element is not generated until the toggle key is actuated or the associated CHANGE() method
of the corresponding variable run through.
For this case, a small virtual keyboard (comprising only a toggle key) is displayed on the right
next to the variable toggle field for operation with a touch panel.
The display of the virtual toggle key can also be forced via the following entry in the
configuration file "slguiconfig.ini" irrespective of a touch panel.
[VirtualKeyboard]
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
101
Variables
5.12 Details on the toggle field
; Forces easyscreen virtual toggle keyboard function
ForceEasyscreenVirtualToggleKey = true
See also
Variable parameters (Page 92)
SINUMERIK Integrate Run MyScreens
102
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.13 Details on the default setting
5.13
Details on the default setting
Overview
A variable can assume various states depending on whether a default value, or a system or
user variable, or both, is assigned to the variable field (input/output field or toggle field), (not
calculated: toggling is only possible if a valid value has been assigned to the variable).
Scope of the default settings
Condition
Reaction of field type
Field type
Default setting
System or user variable
I/O field
Yes
Yes
Write default value to system or user variable
No
Yes
Use system or user variable as default value
Fault
Yes
Not calculated, system or user variable is not written/
used.
Yes
No
Default setting
No
No
Not calculated
Fault
No
Not calculated
Yes
Fault
Not calculated
No
Fault
Not calculated
Fault
Fault
Not calculated
Toggle
Yes
Yes
Write default value to system or user variable
No
Yes
Use system or user variable as default value
Fault
Yes
Not calculated,
system or user variable not written/used
Yes
No
Default setting
No
No
Default = first toggle field element
Fault
No
Not calculated
Yes
Fault
Not calculated
No
Fault
Not calculated
Fault
Fault
Not calculated
See also
Variable parameters (Page 92)
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
103
Variables
5.14 Details on the position of the short text, position of the input/output field
5.14
Details on the position of the short text, position of the input/output field
Overview
The short text and graphic text, as well as the input/output field and unit text, are each treated
like a unit, i.e., position settings for short text apply to the graphic text and data for the input/
output field and to unit text.
Programming
The configured position entry overwrites the default value, i.e., only one value can be changed.
If no position settings have been configured for subsequent screen form elements, then the
position settings for the preceding screen form element are applied.
The default setting is used if positions are not specified for any of the dialog elements. The
column width for the short text and input-output field is calculated as standard for each line from
the number of columns and maximum line width, i.e. column width = maximum line width/
number of columns.
The width of the graphics and unit text is predefined and optimized to suit the requirements of
programming support. If graphics or unit text has been configured, the width of the short text or
I/O field is reduced accordingly.
The order of short text and I/O field can be reversed by position settings.
Distance between the input/output field and unit field and width of the unit field
You can configure the distance between an input/output field and a unit field as well as the width
of the unit field.
In the definition line, in the section for the input/output position, enter the distance from the input/
output field to the unit field, separated by a comma (e.g. 7 pixels) and/or the width of the unit
field (e.g. 60 pixels):
DEF VarDT=(R3//0.000/,"DT",,"s"////0,,24/39,,71,,7,60)
Or:
DEF VarDT={TYP="R3", VAL="0.000", ST="DT", UT="s", TXT_X=0,
TXT_W=24, X=39, W=71, UT_DX=7, UT_W=60}
In this case, the distance between the input/output field/unit field and/or the width of the unit
field have/has been configured and the following points should be taken into account:
● The configured width of the input/output field does not include the fixed width of the unit field
(this is fixed at 50 pixels). This means that you directly configure the width of the input/output
field.
● A 50 pixel width applies as default if a width is not configured for the unit field.
●
0 pixels applies as default if a distance is not configured between the input/output field / unit
field.
SINUMERIK Integrate Run MyScreens
104
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.14 Details on the position of the short text, position of the input/output field
Special feature regarding the associated toggle field
Requirements:
● An associated toggle field is configured for a variable,
● For the variable, a distance is configured between the input/output field and unit field and/or
a width for the unit field, and
● The variable has no unit text.
In this particular case, the associated toggle field is positioned at the configured position of the
unit field of the variable.
A position possibly configured for the input/output component of the associated toggle field is
ignored.
Example
In the following example, the associated toggle field F_Unit is automatically set with a distance
of 7 pixels to the input/output field of variable VarF , and with a width of 59 pixels .
DEF VarF=(R//0.0/,"F",,,////0,,24/39,,85,,7,59///"F_Unit"), F_Unit =
(I/*3="mm/min", 1="mm/U"/3// ////181,,155)
See also
Variable parameters (Page 92)
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
105
Variables
5.15 Use of strings
5.15
Use of strings
Strings
Strings can be used as part of the configuration. These allow text to be displayed dynamically
or different texts to be chained for the purpose of code generation.
Rules
The following rules must be observed with regard to string variables:
● Logic operations are processed from left to right.
● Nested expressions are solved from the inside outwards.
● No distinction is made between uppercase and lowercase type.
● String variables are generally displayed left justified.
Strings can be deleted simply by assigning a blank string.
Strings can be appended after the equality sign using the operator "<<". Quotation marks (") in
the string are represented by two successive quotation mark symbols. Strings can be checked
for equality in IF instructions.
Example
Default settings for the following examples:
VAR1.VAL = "This is an"
VAR8.VAL = 4
VAR14.VAL = 15
VAR2.VAL = "Error"
$85001 = "This is an"
$85002 = "Alarm text"
Editing strings:
● Chaining of strings:
VAR12.VAL = VAR1 << " Error."
;Result: "This is an error"
● Deleting a variable:
VAR10.VAL = ""
;Result: Blank string
● Setting a variable with a text variable:
VAR11.VAL = VAR1.VAL
;Result: "This is an"
● Data type matching:
VAR13.VAL ="This is the " << (VAR14 - VAR8) << ". error"
;Result: "This is the 11th error"
SINUMERIK Integrate Run MyScreens
106
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.15 Use of strings
● Treatment of numerical values:
VAR13.VAL = "Error" << VAR14.VAL << ": " << $85001 << $85002
;Result: "Error 15: "This is an alarm text"
IF VAR15 == "Error"
;Strings in IF statement
VAR16 = 18.1234
;Result: VAR16 equals 18.1234,
;if VAR15 equals "Error".
ENDIF
● Quotation marks within a string:
VAR2="Hello, this is a " Test""
;Result: Hello, this is a " Test"
● System or user-variable strings dependent on variable content:
VAR2.Var = "$R[" << VAR8 << "]"
;Result: $R[4]
See also
STRING functions (Page 182)
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
107
Variables
5.16 CURPOS variable
5.16
CURPOS variable
Description
The CURPOS variable calls or manipulates the position of the cursor in the active input field of
the current dialog. The variable shows how many characters are in front of the cursor. If the
cursor is located at the start of the input field, then CURPOS assumes the value of 0. If the value
of CURPOS is changed, then the cursor is positioned at the appropriate location in the input
field.
In order to be able to respond to changes in the variable value, it is possible to monitor for
changes using a CHANGE method. If the value of CURPOS changes, then a jump is made to
the CHANGE method and the instructions contained there are executed.
SINUMERIK Integrate Run MyScreens
108
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.17 CURVER variable
5.17
CURVER variable
Description
The CURVER (CURrent VERsion) property allows the programming to be adapted in order to
handle different versions. The CURVER variable is read-only.
Note
Even if previously recompiled with an older version, the code is automatically generated with
the most recent version. The "GC" command always generates the most recent version. An
additional identifier indicating the generated version is inserted in the user comment of the
generated code in versions > 0.
Rules
The most recent dialog with all its variables is always displayed.
● Variables used previously may not be changed.
● New variables are inserted in the existing (cycle) programming in arbitrary order.
● It is not permissible to delete variables from a dialog from one version to the next.
● The dialog must contain all variables of all versions.
Example
(IF CURVER==1 ...)
; When the code is recompiled, CURVER is automat-
ically assigned the version of the recompiled
code.
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
109
Variables
5.18 ENTRY variable
5.18
ENTRY variable
Description
The ENTRY variable can be used to check by what method a dialog has been called.
Programming
Syntax:
ENTRY
Description:
The ENTRY variable is a read only variable.
Return Value:
The result of the scan can be:
0 =
No programming support
1 =
Start of a screen via softkey; no code has been generated yet (default
as configured)
2 =
Start of a screen via softkey; code has been generated
(default from the code generated last by this screen)
3 =
Recompilation with user comment (# lines)
4 =
Code_type = 0: NC code with user comment (# lines)
5 =
Code_type = 1: NC code without user comment (# lines)
Example
IF ENTRY == 0
DLGL ("The dialog was not called under programming")
ELSE
DLGL ("The dialog was called under programming")
ENDIF
SINUMERIK Integrate Run MyScreens
110
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.19 ERR variable
5.19
ERR variable
Description
Variable ERR checks whether the preceding line has been executed correctly.
Programming
Syntax:
ERR
Description:
The ERR variable is read-only.
Return value:
The result of the scan can be:
FALSE =
previous line was executed error-free
TRUE =
previous line was not executed error-free
Example
VAR4 = Thread[VAR1,"CDM",3]
; Output value from array
IF ERR == TRUE
; Query whether the value has been found in
the array
VAR5 = "Error accessing array"
; If the value has not been found in the ar-
ray, the value "Error accessing array" is as-
signed to the variables.
ELSE
VAR5 = "All OK"
; If the value has been found in the array,
the value "All OK" is assigned to the varia-
bles.
ENDIF
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
111
Variables
5.20 FILE_ERR variable
5.20
FILE_ERR variable
Description
Variable FILE_ERR can be used to check whether the preceding GC or CP command has been
executed correctly.
Programming
Syntax:
FILE_ERR
Description:
The FILE_ERR variable is read-only.
Return value:
Possible results are:
0 =
Operation okay
1 =
Drive/path not available
2 =
Path/file access error
3 =
Drive not ready
4 =
Incorrect file name
5 =
File is already open
6 =
Access denied
7 =
Target path not available or not permitted
8 =
Copy source same as target
10 =
Internal error: FILE_ERR = 10 means that the error cannot be classified
in the other categories.
Example
CP("D:\source.mpf","E:\target.mpf")
; Copy from source.mpf to E:\tar-
get.mpf
IF FILE_ERR > 0
; Query whether error has occurred
IF FILE_ERR == 1
; Query specific error numbers and
output associated error text
VAR5 = "Drive/path not available"
ELSE
IF FILE_ERR == 2
VAR5 = "Path/file access error"
ELSE
IF FILE_ERR == 3
VAR5 = "incorrect file name"
ENDIF
ENDIF
ENDIF
ELSE
SINUMERIK Integrate Run MyScreens
112
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.20 FILE_ERR variable
CP("D:\source.mpf","E:\target.mpf")
VAR5 = "All OK"
; If no errors have occurred in CP
(or GC), "All OK" is output
ENDIF
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
113
Variables
5.21 FOC variable
5.21
FOC variable
Description
With the variable FOC, the input focus (current active input/output field) is controlled in a dialog.
The reaction of the cursor left, right, up, down as well as PGUP, PGDN are predefined.
Note
The FOC function must not be initiated as a result of a navigation event. The cursor position
may only be changed in softkey PRESS methods, CHANGE methods, etc.
The FOC function cannot be applied to variables with input mode wr = 0 and wr = 4 or to Help
variables.
Programming
Syntax:
FOC
Description:
The variable can be read and written.
Return value:
Read
The result is the name of the variable to which the FOC func-
tion has been applied.
Write
It is possible to assign either a string or a numerical value. A
string is interpreted as a variable name and a numerical value
as a variable index.
Example
IF FOC == "Var1"
; Read focus
REG[1] = Var1
ELSE
REG[1] = Var2
ENDIF
FOC = "Var1"
; The input focus is assigned to variable 1.
FOC = 3
; The input focus is assigned to the 3rd dialog ele-
ment with WR ≥ 2.
See also
FOCUS (Page 129)
SINUMERIK Integrate Run MyScreens
114
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.22 Variable S_ALEVEL
5.22
Variable S_ALEVEL
Description
The current access level can be queried in the configuration with the screen property
S_ALEVEL.
Programming
Syntax:
S_ALEVEL
Description:
Query of the current access level
Return value:
0: System
1: Manufacturer
2: Service
3: User
4: Key switch 3
5: Key switch 2
6: Key switch 1
7: Key switch 0
Example
REG[0] = S_ALEVEL
See also
ACCESSLEVEL (Page 126)
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
115
Variables
5.23 S_CHAN variable
5.23
S_CHAN variable
Description
The S_CHAN variable determines the number of the current channel for display or evaluation
purposes.
Programming
Syntax:
S_CHAN
Description:
Query of the current channel number
Return value:
Channel number
Example
REG[0] = S_CHAN
See also
CHANNEL (Page 128)
SINUMERIK Integrate Run MyScreens
116
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.24 Variable S_CONTROL
5.24
Variable S_CONTROL
Description
The current control name can be queried in the configuration with the screen property
S_CONTROL.
Programming
Syntax:
S_CONTROL
Description:
Query of the current control name
Return value:
The control name is the section name in the "mmc.ini"
Example
REG[0] = S_CONTROL
See also
CONTROL (Page 129)
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
117
Variables
5.25 Variable S_LANG
5.25
Variable S_LANG
Description
The current language can be queried in the configuration with the screen property S_LANG.
Programming
Syntax:
S_LANG
Description:
Query of the current language
Return value:
Language code from resources.xml, e.g. "deu", "eng", etc.
Example
REG[0] = S_LANG
See also
LANGUAGE (Page 130)
SINUMERIK Integrate Run MyScreens
118
Programming Manual, 06/2019, A5E40869575B AC
Variables
5.26 Variable S_NCCODEREADONLY
5.26
Variable S_NCCODEREADONLY
Description
The screen property S_NCCODEREADONLY is only relevant when a cycle is recompiled in the
editor with a "Run MyScreens" dialog. S_NCCODEREADONLY determines whether a
recompiled NC code from the editor can be changed or not.
The following applies for the return value:
● TRUE: The recompiled NC code from the editor can be changed
● FALSE: The recompiled NC code from the editor cannot be changed (read-only), because,
for example, it is already in the preprocessing (= TRUE).
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
119
Variables
5.27 Variables S_RESX and S_RESY
5.27
Variables S_RESX and S_RESY
Description
The current resolution or its X and Y component can be queried in the configuration with the
screen properties S_RESX and S_RESY.
Example
REG[0] = S_RESY
See also
RESOLUTION (Page 135)
SINUMERIK Integrate Run MyScreens
120
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6
6.1
Operators
Overview
The following operators can be used when programming:
● Mathematical operators
● Relational operators
● Logic (Boolean) operators
● Bit operators
● Trigonometric functions
6.1.1
Mathematical operators
Overview
Mathematical operators
Identifier
+
Addition
-
Subtraction
*
Multiplication
/
Division
MOD
Modulo operation
( )
Parentheses
AND
AND operator
OR
OR operator
NOT
NOT operator
ROUND
Round off numbers with decimal places
Example: VAR1.VAL = 45 * (4 + 3)
ROUND
The ROUND operator is used to round off numbers with up to 12 decimal places during
execution of a dialog configuration. The variable fields cannot accept the decimal places in the
display.
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
121
Programming commands
6.1 Operators
Use
ROUND is controlled by the user with two parameters:
VAR1 = 5.2328543
VAR2 = ROUND( VAR1, 4 )
Result:
VAR2 = 5.2339
VAR1 contains the number to be rounded. The parameter “4” indicates the number of decimal
places in the result, which is placed in VAR2.
Trigonometric functions
Trigonometric functions
Identifier
SIN(x)
Sine of x
COS(x)
Cosine of x
TAN(x)
Tangent of x
ATAN(x, y)
Arc tangent of x/y
SQRT(x)
Square root of x
ABS(x)
Absolute value of x
SDEG(x)
Conversion to degrees
SRAD(x)
Conversion to radian
CALC_ASIN(x)
Arc sine of x
CALC_ACOS(x)
Arc cosine of x
Note
The functions operate with radian measure. The functions SDEG() and SRAD() can be used for
conversion.
Example: VAR1.VAL = SQRT(2)
Mathematical functions
Mathematical functions
Identifier
CALC_CEIL(x)
Determines the next highest integer of x (round up)
CALC_FLOOR(x)
Determines the next lowest integer of x (round down)
CALC_LOG(x)
Determines the (natural) logarithm for the base e of x
CALC_LOG10(x)
Determines the logarithm for the base 10 of x
CALC_POW(x, y)
Determines x to the power of y
CALC_MIN(x, y)
Determines the lower number of x and y
CALC_MAX(x, y)
Determines the higher number of x and y
SINUMERIK Integrate Run MyScreens
122
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.1 Operators
Random function: Random number
Syntax:
RANDOM (lower limit value, upper limit value)
Description:
The RANDOM function returns a pseudo random number in a specified range.
Parameters:
Lower limit value
Lower limit value >= -32767,
Lower limit value < upper limit value
Upper limit value
Upper limit value <= 32767
Example
REG[0] = RANDOM(-10,10)
; Possible result = -3
Constants
Constants
PI
3.14159265358979323846
FALSE
0
TRUE
1
Example: VAR1.VAL = PI
Comparison operators
Comparison operators
==
Equal to
<>
Not equal to
>
Greater than
<
Less than
>=
Greater than or equal to
<=
Less than or equal to
Example:
IF VAR1.VAL == 1
VAR2.VAL = TRUE
ENDIF
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
123
Programming commands
6.1 Operators
Conditions
The nesting depth is unlimited.
Condition with one command:
IF
ENDIF
Condition with two commands:
IF
ELSE
ENDIF
6.1.2
Bit operators
Overview
Bit operators
Identifier
BOR
Bit-serial OR
BXOR
Bit-serial XOR
BAND
Bit-serial AND
BNOT
Bit-serial NOT
SHL
Shift bits to left
SHR
Shift bits to right
SHL operator
Bits are shifted to the left using the SHL (SHIFT LEFT) operator. You can specify both the value
to be shifted and the number of shift increments directly or via a variable. If the limit of the data
format is reached, the bits are shifted beyond the limit without displaying an error message.
Use
Syntax:
variable = value SHLincrement
Description:
Shift Left
Parameters:
value
value to be shifted
increment
number of shift increments
Example
PRESS(VS1)
VAR01 = 16 SHL 2
; Result = 64
SINUMERIK Integrate Run MyScreens
124
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.1 Operators
VAR02 = VAR02 SHL VAR04
; Convert content of VAR02 to 32-bit unsigned
, and shift content to left by number of bits specified
in VAR04. Then convert 32-bit value back to format of
variable VAR02.
END_PRESS
SHR operator
Bits are shifted to the RIGHT using the SHR (SHIFT RIGHT) function. You can specify both the
value to be shifted and the number of shift increments directly or via a variable. If the limit of the
data format is reached, the bits are shifted beyond the limit without displaying an error message.
Use
Syntax:
variable = value SHRincrement
Description:
Shift Right
Parameters:
value
value to be shifted
increment
number of shift increments
Example
PRESS(VS1)
VAR01 = 16 SHR 2
; Result = 4
VAR02 = VAR02 SHR VAR04
; Convert content of VAR02 to 32-bit unsigned
, and shift content to right by number of bits
specified in VAR04. Then convert 32-bit value back
to format of variable VAR02.
END_PRESS
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
125
Programming commands
6.2 Methods
6.2
Methods
Overview
Various types of event (exit input field, actuate softkey) can initiate specific actions in dialogs
and dialog-dependent softkey menus (softkey menus that are called from a newly configured
dialog). These actions are configured in methods.
The following table shows the basic principle used to program a method:
Definition block
Comment
Section reference
PRESS(HS1)
;Method start identifier
LM...
;Functions
See Chapter Functions (Page 138)
LS...
Var1.st = ...
;Changing properties
see Section Defining softkey me-
nus (Page 62)
and Section Defining dialog prop-
erties (Page 49).
Var2 = Var3 + Var4
;Calculation with variables
See Chapter Defining variables
(Page 81)
EXIT
END_PRESS
;Method end identifier
6.2.1
ACCESSLEVEL
Description
The ACCESSLEVEL method is run through when the current access level has changed for an
opened screen.
Programming
Syntax:
ACCESSLEVEL
<instructions>
END_ACCESSLEVEL
Description:
Access level
Parameters:
- None -
See also
Variable S_ALEVEL (Page 115)
SINUMERIK Integrate Run MyScreens
126
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.2 Methods
6.2.2
CHANGE
Description
CHANGE methods are executed if a variable value changes, i.e., variable calculations that are
performed as soon as a variable value changes are configured within a CHANGE method.
There are two types of CHANGE method, i.e., element-specific and global:
● The element-specific CHANGE method is executed if the value of a specified variable
changes. If a system or user variable is assigned to a variable, cyclic updating of the variable
value can be configured in a CHANGE method.
● The global CHANGE method is executed if the value of any variable changes and no
element-specific CHANGE method has been configured.
"Element-specific" programming
Syntax:
CHANGE(Identifier)
END_CHANGE
Description:
Changes the value of a specific variable
Parameters:
Identifier
Name of the variable
Example
DEF VAR1=(I//////"DB20.DBB1")
; A system variable is assigned to Var1
CHANGE(VAR1)
IF VAR1.Val <> 1
VAR1.st="Tool OK!"
; If the value of the system variable ≠ 1, the
short text of the variable states: Tool OK!
otto=1
ELSE
VAR1.st="Attention: Error!"
; If the value of the system variable = 1, the
short text of the variable states: Attention:
Error!
otto=2
ENDIF
VAR2.Var=2
END_CHANGE
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
127
Programming commands
6.2 Methods
"Global" programming
Syntax:
CHANGE()
END_CHANGE
Description:
Changes any variable value
Parameters:
- None -
Example
CHANGE()
EXIT
; If any of the variable values change, the di-
alog will be terminated.
END_CHANGE
See also
Behavior when opening the dialog (attribute CB) (Page 314)
6.2.3
CHANNEL
Description
The CHANNEL method is run through when the current channel has changed for an opened
screen, i.e. a channel switchover has been performed.
Programming
Syntax:
CHANNEL
<instructions>
END_CHANNEL
Description:
Channel switchover
Parameters:
- None -
See also
S_CHAN variable (Page 116)
SINUMERIK Integrate Run MyScreens
128
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.2 Methods
6.2.4
CONTROL
Description
The CONTROL method is run through when the current control has changed for an opened
screen, i.e. typically at a 1:n switchover.
Programming
Syntax:
CONTROL
<instructions>
END_CONTROL
Description:
Control switchover
Parameters:
- None -
See also
Variable S_CONTROL (Page 117)
6.2.5
FOCUS
Description
The FOCUS method is executed if the focus (cursor) is positioned on another field in the dialog.
The FOCUS method must not be initiated as a result of a navigation event. The cursor position
may only be changed in softkey PRESS methods, CHANGE methods, etc. The response of
cursor movements is predefined.
Note
Within the FOCUS method, it is not possible to select a different variable, nor can a new dialog
be loaded.
Programming
Syntax:
FOCUS
END_FOCUS
Description:
Positions the cursor
Parameters:
- None -
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
129
Programming commands
6.2 Methods
Example
FOCUS
DLGL("The focus has been placed on variable << FOC << ".)
END_FOCUS
See also
FOC variable (Page 114)
6.2.6
LANGUAGE
Description
The LANGUAGE method is run through when the current language has changed for an opened
screen.
Programming
Syntax:
LANGUAGE
<instructions>
END_LANGUAGE
Description:
Language
Parameters:
- None -
See also
Variable S_LANG (Page 118)
6.2.7
LOAD
Description
The LOAD method is executed after the variable and softkey definitions (DEF Var1= ...,
HS1= ...) have been interpreted. At this time, the dialog is not yet displayed.
SINUMERIK Integrate Run MyScreens
130
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.2 Methods
Programming
Syntax:
LOAD
END_LOAD
Description:
Download
Parameters:
- None -
Example
LOAD
; Start identifier
Screen form1.Hd =
$85111
; Assign text for dialog header from language file
VAR1.Min = 0
; Assign MIN variable limit
VAR1.Max = 1000
; Assign MAX variable limit
END_LOAD
; End code
See also
Line, dividing line, rectangle, circle and ellipse (Page 193)
6.2.8
UNLOAD
Description
The UNLOAD method is executed before a dialog is unloaded.
Programming
Syntax:
UNLOAD
END_UNLOAD
Description:
Unload
Parameters:
- None -
Example
UNLOAD
REG[1] = VAR1
; Save variable in register
END_UNLOAD
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
131
Programming commands
6.2 Methods
6.2.9
OUTPUT
Description
The OUTPUT method is executed if the "GC" function is called. Variables and Help variables
are configured as an NC code in an OUTPUT method. The individual elements in a code line
are linked by means of blanks.
Note
The NC code can be generated in an extra file by means of file functions and transferred to the
NC.
Programming
Syntax:
OUTPUT (Identifier)
END_OUTPUT
Description:
Outputs variables in the NC program.
Parameters:
Identifier
Name of OUTPUT method
Block numbers and skip identifiers
The OUTPUT method must not contain line numbers or skip identifiers if you wish to keep the
line numbers and skip identifiers directly set with active program support in the parts program
in case of recompilations.
Editor changes in the parts program produce the following response:
Condition
Response
Number of blocks remains unchanged.
Block numbers are retained.
Number of blocks is reduced.
The highest block numbers are canceled.
Number of blocks is increased.
New blocks are not numbered.
Example
OUTPUT(CODE1)
"CYCLE82(" Var1.val "," Var2.val "," Var3.val ","Var4.val "," Var5.val ","
Var6.val ")"
END_OUTPUT
SINUMERIK Integrate Run MyScreens
132
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.2 Methods
6.2.10
PRESS
Description
The PRESS method is executed when the corresponding softkey is pressed.
Programming
Syntax:
PRESS(softkey)
END_PRESS
Designation:
Pressing a softkey
Parameter:
Softkey
Name of softkey: HS1 - HS8 and VS1 - VS8
RECALL
<RECALL> key
ENTER
For the <ENTER> key, see PRESS(ENTER) (Page 134)
TOGGLE
For the <TOGGLE> key, see PRESS(TOGGLE) (Page 134)
PU
Page Up
Screen up
PD
Page Down
Screen down
SL
Scroll left
Cursor left
SR
Scroll right
Cursor right
SU
Scroll up
Cursor up
SD
Scroll down
Cursor down
Example
HS1 = ("another softkey menu")
HS2=("no function")
PRESS(HS1)
LS("Menu1")
; Load another softkey menu
Var2 = Var3 + Var1
END_PRESS
PRESS (HS2)
END_PRESS
PRESS(PU)
INDEX = INDEX -7
CALL("UP1")
END_PRESS
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
133
Programming commands
6.2 Methods
6.2.11
PRESS(ENTER)
Description
The PRESS(ENTER) method is always called when the Enter key is pressed for a variable with
input/output field with input mode WR3 or WR5:
● WR3: Navigation to field and pressing of the Enter key
● WR5: In the input mode, transfer of the value with the Enter key
Programming
Syntax:
PRESS(ENTER)
<instructions>
END_PRESS
Description:
Enter key pressed
Parameters:
- None -
6.2.12
PRESS(TOGGLE)
Description
The PRESS(TOGGLE) method is always called when the toggle key is pressed irrespective of
the currently focused variable.
When required, the FOC screen property can be used to determine which variable is currently
in focus.
Programming
Syntax:
PRESS(TOGGLE)
<instructions>
END_PRESS
Description:
Toggle key pressed
Parameter:
- None -
Example
PRESS(TOGGLE)
DLGL("Toggle key pressed at variable " << FOC)
; The FOC screen property determines which
variable is currently in focus
END_PRESS
SINUMERIK Integrate Run MyScreens
134
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.2 Methods
6.2.13
RESOLUTION
Description
The RESOLUTION method is run through when the current resolution has changed for an
opened screen, i.e. typically at a TCU switchover.
Programming
Syntax:
RESOLUTION
<instructions>
END_RESOLUTION
Description:
Resolution
Parameters:
- None -
See also
Variables S_RESX and S_RESY (Page 120)
6.2.14
RESUME
Description
The RESUME method is called when the screen was interrupted, e.g. for an area change, and
is now shown again. The value changes are processed again, if required, the timers started and
the RESUME block executed.
Programming
Syntax:
RESUME
<instruction>
END_RESUME
Description:
Screen active again
Parameters:
- None -
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
135
Programming commands
6.2 Methods
6.2.15
SUSPEND
Description
The SUSPEND method is called when the screen is interrupted and not unloaded. This is the
case, for example, when the screen is exited by a simple area change, but not explicitly
unloaded. The screen is retained in the backg15round, but no value change or timers are
processed. The screen is paused.
Programming
Syntax:
SUSPEND
<instruction>
END_SUSPEND
Description:
Interruption of the screen
Parameters:
- None -
Example
SUSPEND
MyVar1 = MyVar1 + 1
END_SUSPEND
6.2.16
Example: Version management with OUTPUT methods
Overview
Additional variables can be added to existing dialogs when expanding the user interface. A
version identifier in parentheses is appended to the additional variables in the definition
following the variable name: (0 = Original, is not written), 1 = Version 1, 2 = Version 2, etc.
Example:
DEF var100=(R//1)
; Original, corresponds to Version 0
DEF var101(1)=(S//"Hello")
; Extension as of Version 1
When writing the OUTPUT method, you can specify which variables are written, with reference
to a particular version identifier.
Example:
OUTPUT(NC1)
; Only the variables of the original are offered in
the OUTPUT method.
SINUMERIK Integrate Run MyScreens
136
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.2 Methods
OUTPUT(NC1,1)
; The variables of the original and the extensions
with version identifier 1 are offered in the OUTPUT
method.
The OUTPUT method for the original does not need a version identifier, however you can
specify it with 0. OUTPUT(NC1) is equivalent to OUTPUT(NC1,0). Version identifier n in the
OUTPUT method includes all variables of the originals 0, 1, 2, ... up to and including n.
Programming with version identifier
//M(XXX)
Version 0 (default)
DEF var100=(R//1)
DEF var101=(S//"Hello")
DEF TMP
VS8=("GC")
PRESS(VS8)
GC("NC1")
END_PRESS
OUTPUT(NC1)
var100",,"var101
END_OUTPUT
; ************ Version 1, extended definition ***************
//M(XXX)
DEF var100=(R//1)
DEF var101=(S//"Hello")
DEF var102(1)=(V//"HUGO")
DEF TMP
VS8=("GC")
PRESS(VS8)
GC("NC1")
END_PRESS
OUTPUT(NC1)
Original and the new version in addition
var100","var101
END_OUTPUT
OUTPUT(NC1,1)
Version 1
var100","var101"," var102
END_OUTPUT
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
137
Programming commands
6.3 Functions
6.3
Functions
Overview
A variety of functions are available in dialogs and dialog-dependent softkey menus. These can
be activated by specific events (exit input field, actuate softkey) and configured in methods.
Subprograms
Repeatedly used configuring instructions or others, which define the process for a particular
operation can be configured in subprograms. Subprograms can be loaded into the main
program or other subprograms at any time and executed as often as necessary, i.e. the
instructions they contain do not need to be configured repeatedly. The definition blocks of the
dialogs/softkey menu constitute a main program.
External functions
Additional, user-specific functions can be integrated by means of external functions. The
external functions are stored in a DLL file and identified by an entry in the definition lines of the
configuration file.
PI services
The PI_START function starts PI Services (Program Invocation Services) from the PLC in the
NC area.
See also
Function (FCT) (Page 157)
PI services (Page 171)
6.3.1
Reading and writing drive parameters: RDOP, WDOP, MRDOP
Description
You can read and write drive parameters using RDOP, WDOP and MRDOP functions.
Note
Do not read drive parameters faster than in a 1 second cycle, slower is better.
Reason: The communication with the drives can otherwise be extremely disturbed or even
cause failures.
SINUMERIK Integrate Run MyScreens
138
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.3 Functions
Note
If errors occur when reading and writing drive parameters, the screen property ERR is set
appropriately.
Programming
Syntax:
RDOP("Identifier of the drive object", "Parameter number")
Description:
Reading a drive parameter (Drive Object Parameter)
Parameter:
Identifier of the drive object
The identifier of the drive object
can be found in the "DO name"
column in "Drive system diag-
nostics" in the diagnostics oper-
ating area ( > ETC > HSK 8: drive
system) (see diagram below).
Parameter number
Figure 6-1
Identifier of the drive object
Syntax:
MRDOP("Identifier of the drive object", "Parameter number1"*"Pa-
rameter number"[*…], Register index)
Description:
Multi-read of drive parameters.
The MRDOP command transfers several drive parameters or drive
objects in a single register access. This access method is signifi-
cantly faster than reading via individual access attempts.
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
139
Programming commands
6.3 Functions
Parameter:
Identifier of the drive object
The identifier of the drive object
can be taken, for example, from
the root screen of the "Setup" op-
erating area.
Parameter number1 ... n
In the variable names, "*" is the
separator. The values are trans-
ferred to register REG[Register
index] in the order that the varia-
ble names appear
in the command.
Register index
The value of the first variable is
located in REG[Register index].
The value of the second variable
is located in REG[Register index
+ 1]
Syntax:
WDOP("Identifier of the drive object", "Parameter number", Value)
Description:
Writing a drive parameter (Drive Object Parameter)
Parameter:
Identifier of the drive object
The identifier of the drive object
can be taken, for example, from
the root screen of the "Setup" op-
erating area.
Parameter number
Parameter number
Value
Value to be written
Examples
Read motor temperature r0035 of drive object "SERVO_3.3:2":
MyVar=RDOP("SERVO_3.3:2","35")
;
Read motor temperature r0035 and actual torque value r0080 of drive object "SERVO_3.3:2"
and store the respective results as of register index 10:
MRDOP("SERVO_3.3:2","35*80",10)
6.3.2
Subprogram call (CALL)
Description
The CALL function calls a loaded subprogram from any point in a method. Subprogram nesting
is supported, i.e. you can call a subprogram from another subprogram.
SINUMERIK Integrate Run MyScreens
140
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.3 Functions
Programming
Syntax:
CALL("Identifier")
Description:
Subprogram call
Parameter:
Identifier
Name of subprogram
Example
//M(SCREEN FORM1)
DEF VAR1 = ...
DEF VAR2 = ...
CHANGE(VAR1)
CALL("MY_UP1")
; Call subprogram and execute
END_CHANGE
CHANGE(VAR2)
CALL("MY_UP1")
; Call subprogram and execute
END_CHANGE
SUB(MY_UP1)
;Do something
END_SUB
//END
6.3.3
Define block (//B)
Description
In the program file, subprograms are identified by the block identifier //B and terminated with //
END. Several subprograms can be defined under each block identifier.
Note
The variables used in the subprogram must be defined in the dialog in which the subprogram
is called.
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
141
Programming commands
6.3 Functions
Programming
A block is structured in the following way:
Syntax:
//B(Block name)
SUB(Identifier)
END_SUB
[SUB(Identifier)
END_SUB]
//END
Description:
Defines a subprogram
Parameters:
Block name
Name of block identifier
Identifier
Name of subprogram
Example
//B(PROG1)
; Block start
SUB(UP1)
; Start of subprogram
REG[0] = 5
; Assign value 5 to register 0
END_SUB
; End of subprogram
SUB(UP2)
; Start of subprogram
IF VAR1.val=="Otto"
VAR1.val="Hans"
RETURN
ENDIF
VAR1.val="Otto"
END_SUB
; End of subprogram
//END
; Block end
6.3.4
Check Variable (CVAR)
Description
You can use the CVAR (CheckVariable) function to run a scan to ascertain whether all or only
certain variables or Help variables in a screen form are error-free.
It may be useful to check if variables contain a valid value before an NC code with the GC
function.
A variable is error-free if the state of the variable Identifier.vld = 1.
SINUMERIK Integrate Run MyScreens
142
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.3 Functions
Programming
Syntax:
CVAR(VarN)
Description:
Checks variables for valid content
Parameters:
VarN
List of variables to be checked.
Up to 29 variables, each separated by a comma, can be
checked. A character length of 500 must not be exceeded.
The result of the scan can be:
1 =
TRUE (all variables have valid content)
0 =
FALSE (at least one variable has invalid content)
Example
IF CVAR == TRUE
; Check all variables
VS8.SE = 1
; If all variables are error-free, soft-
key VS8 is visible
ELSE
VS8.SE = 2
; If a variable has an invalid value,
softkey VS8 is disabled
ENDIF
IF CVAR(”VAR1”, ”VAR2”) == TRUE
; Check variables VAR1 and VAR2
DLGL ("VAR1 and VAR2 are OK")
; If the values of VAR1 and VAR2 are er-
ror-free, "VAR1 and VAR2 are OK" appears
in the dialog line
ELSE
DLGL ("VAR1 and VAR2 are not OK")
; If the values of VAR1 and VAR2 are in-
valid, "VAR1 and VAR2 are not OK" appears
in the dialog line
ENDIF
6.3.5
CLEAR_BACKGROUND
Description
The CLEAR_BACKGROUND function deletes the LINE, RECT, ELLIPSE, V_SEPARATOR
and H_SEPARATOR graphic elements.
See also
Line, dividing line, rectangle, circle and ellipse (Page 193)
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
143
Programming commands
6.3 Functions
6.3.6
Copy Program file function (CP)
Description
The CP (Copy Program) function copies files within the HMI file system or within the NC file
system.
Programming
Syntax:
CP("Source file", "Target file")
Description:
Copies a file
Parameter:
Source file
Complete path to the source file
Target file
Complete path data of the target file
The return value (VAR1 defined as help variable) queries whether the function was successful:
CP("//NC/MPF.DIR/HOHO.MPF","//NC/MPF.DIR/ASLAN.MPF",VAR1)
Example
Application with return value:
CP("//NC/MPF.DIR/HOHO.MPF","//NC/MPF.DIR/ASLAN.MPF",VAR1)
CP("CF_CARD:/wks.dir/MESS_BILD.WPD/MESS_BILD.MPF","//NC/WKS.DIR/AAA.WPD/HOHO2.MPF",VAR1)
CP("//NC/MPF.DIR/HOHO.MPF","//NC/MPF.DIR/ASLAN.MPF")
; WPD must exist
Application without return value:
CP("//NC/MPF.DIR/HOHO.MPF","//NC/MPF.DIR/ASLAN.MPF")
CP("CF_CARD:/mpf.dir/MYPROG.MPF","//NC/MPF.DIR/HOHO.MPF")
CP("//NC/MPF.DIR/HOHO.MPF","CF_CARD:/XYZ/MYPROG.MPF")
; XYZ must exist
See also
Support of FILE_ERR: FILE_ERR variable (Page 112)
6.3.7
Delete Program file function (DP)
Description
The DP (Delete Program) function deletes a file from the passive HMI or active NC file system.
SINUMERIK Integrate Run MyScreens
144
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.3 Functions
Programming
Syntax:
DP("File")
Description:
Delete file
Parameter:
File
Complete path name of file to be deleted
Example
The following data management syntax is used for this function:
● With return value
DP("//NC/MPF.DIR/MYPROG.MPF",VAR1)
DP("//NC/WKS.DIR/TEST.WPD/MYPROG.MPF",VAR1)
DP("//NC/CMA.DIR/MYPROG.SPF",VAR1)
VAR1 = 0
File was deleted.
VAR1 = 1
File was not deleted.
● Without return value:
DP("//NC/MPF.DIR/MYPROG.MPF")
DP("//NC/WKS.DIR/TEST.WPD/MYPROG.MPF")
DP("//NC/CMA.DIR/MYPROG.SPF")
6.3.8
Exist Program file function (EP)
Description
The EP (Exist Program) function checks whether a particular NC program is stored on the
specified path in the NC or HMI file system.
Programming
Syntax:
EP("File")
Description:
Checks the existence of the NC program
Parameter:
File
Complete path to the file in the NC or HMI file system
Return value:
Name of a variable to which the result of the scan should be assigned
The EP function can handle the new syntax and the old logic (with adapted syntax).
The file is directly addressed using a qualifying name:
//NC/MPF.DIR/XYZ.MPF
or
CF_CARD: /MPF.DIR/XYZ.MPF (points to /user/sinumerik/data/prog)
or
LOC: (corresponds to CF_CARD)
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
145
Programming commands
6.3 Functions
Examples of new syntax:
EP("//NC/WKS.DIR/TEST.WPD/XYZ.MPF",VAR1)
EP("CF_CARD:/mpf.dir/XYZ.MPF",VAR1)
EP("LOC:/mpf.dir/XYZ.MPF",VAR1)
; With return value:
; VAR1 = 0 File exists.
; VAR1 = 1 File does not exist.
Example of old syntax:
EP("/MPF.DIR/CFI.MPF", VAR1)
; With return value:
; VAR1 = M File is located in the HMI file system.
; VAR1 = N File is located in the NC file system.
; VAR1 = B File is located in the HMI and the NC file system.
Example
EP("/MPF.DIR/GROB.MPF",VAR1)
; Old - path now with / instead of \
IF VAR1 == "M"
DLGL("File is located in the HMI file system")
ELSE
IF VAR1 == "N"
DLGL("File is located in the NC file directory")
ELSE
DLGL("File is located neither in the HMI nor in the NC
file system")
ENDIF
ENDIF
6.3.9
Move Program file function (MP)
Description
The MP (Move Program) function copies files within the HMI file system or within the NC file
system.
SINUMERIK Integrate Run MyScreens
146
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.3 Functions
Programming
Syntax:
MP("source", "target")
MP("CF_CARD:/MPF.DIR/MYPROG.MPF","//NC/MPF.DIR")
Description:
Move file
Parameter:
Source file
Complete path data
Target file
Complete path data
Return value
Result of the query
Examples
With return value:
MP("//NC/MPF.DIR/123.MPF","//NC/MPF.DIR/ASLAN.MPF",VAR1)
;Within NC
MP("//NC/MPF.DIR/123.MPF",VAR0,VAR1)
;Target via variable
MP(VAR4,VAR0,VAR1)
;Source and target via variable
MP("CF_CARD:/mpf.dir/myprog.mpf","//NC/MPF.DIR/123.MPF",VAR1)
;From CF card to NC
MP("//NC/MPF.DIR/HOHO.MPF","CF_CARD:/XYZ/123.mpf",VAR1)
;From NC to CF card
; With return value:
; VAR1 = 0 Executed
; VAR1 = 1 Not executed
6.3.10
Select Program file function (SP)
Description
The SP (Select Program) function selects a file in the active NC file system for execution, i.e.
the file must be loaded into the NC beforehand.
Programming
Syntax:
SP("File")
Designation:
Select program
Parameter:
"File"
Complete path name of NC file
Example
The following data management syntax is used for this function:
● With return value
SP("//NC/MPF.DIR/MYPROG.MPF", VAR1)
VAR1 = 0
File was loaded.
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
147
Programming commands
6.3 Functions
VAR1 = 1
File was not loaded without return value.
● Without return value:
SP("//NC/MPF.DIR/MYPROG.MPF")
6.3.11
File accesses: RDFILE, WRFILE, RDLINEFILE, WRLINEFILE
Description
The RDFILE and WRFILE functions are available for read and write access to files with INI
syntax.
The RDLINEFILE and WRLINEFILE functions are available for read and write access to
individual lines of a file.
Programming
Syntax:
RDFILE("File name + path", "Section", "Key")
Description:
Reading from a file
Parameter:
File name + path
Path and file name
Section
Section in the INI file
Key
Key in the INI file
Syntax:
WRFILE(Value, "File name + path", "Section", "Key")
Description:
Writing to a file
Parameter:
Value
Value to be written
File name + path
Path and file name
Section
Section in the INI file
Key
Key in the INI file
Syntax:
RDLINEFILE("File name + path", Line number)
Description:
Reading a line from a file
Parameter:
File name + path
Path and file name
Line number
Line number
Numbering begins at 0 for the
first line.
Syntax:
WRLINEFILE(Value, "File name + path")
Description:
Writing of a line at the end of a file
SINUMERIK Integrate Run MyScreens
148
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.3 Functions
Parameter:
Value
Value to be written
File name + path
Path and file name
Note
● The files must not be in the file system of the NC (data management).
● If the file does not exist, or the end of the file is reached or other errors occur, the variables
FILE_ERR and ERR are set accordingly. You can check whether a file exists first with the
Exist Program (EP) file function.
● The processed file is generated in "UTF-8" coding (without BOM (Byte Order Mask). When
reading a file, it is expected in "UTF-8" coding.
● You can delete the file explicitly when required with the Delete Program (DP) file function.
Examples
Reading from an INI file:
Requirement/assumption:
Content of file "C:/tmp/myfile.ini":
<…>
[MyData]
MyName=Daniel
<…>
MyVar = RDFILE("C:/tmp/myfile.ini", "MyData", "MyName")
Result:
MyVar now contains the value "Daniel".
Writing to an INI file:
Requirement/assumption:
VARS=12
WRFILE(VARS, "C:/tmp/myfile.ini", "MySession", "NrOfSessions")
Result:
Content of file "C:/tmp/myfile.ini":
<…>
[MySession]
NrOfSessions=12
<…>
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
149
Programming commands
6.3 Functions
Reading the 4th line of a file:
Requirement/assumption:
Content of c:/tmp/myfile.mpf:
R[0]=0
F3500 G1
MYLOOPIDX1: X0 y-50 Z0
X150 Y50 Z10
R[0]=R[0]+1
GOTOB MYLOOPIDX1
M30
MyVar = RDLINEFILE("C:/tmp/myfile.mpf", 4)
Result:
MyVar now contains the value " R[0]=R[0]+1"
Writing at the end of a file:
Requirement/assumption:
VARX=123
VARY=456
WRLINEFILE("F100 X" << VARX << " Y" << VARY, "C:/tmp/mypp.mpf")
Result:
Content of c:/tmp/mypp.mpf:
<…>
F100 X123 Y456
6.3.12
Dialog line (DLGL)
Description
It is possible to configure short texts (messages or input tips) for output in the dialog line of the
dialog in response to certain situations.
Possible number of characters in the default font size: approx. 50
SINUMERIK Integrate Run MyScreens
150
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.3 Functions
Programming
Syntax:
DLGL("String")
Description:
Outputs text in the dialog line
Parameter:
String
Text, which is displayed in the dialog line
Example
IF Var1 > Var2
; The text "Value too large!" appears in the dialog
line if variable1 > variable2.
DLGL("Value too large!")
ENDIF
6.3.13
DEBUG
Description
The DEBUG function provides an analysis help during the draft phase of Run MyScreen user
screens. An expression in brackets transferred with the DEBUG function is evaluated during
runtime. The result is attached to the "easyscreen_log.txt" logbook as a separate entry.
Each entry has the current time stamp in square brackets as prefix (see example below).
It is recommended that the DEBUG outputs are removed in time-critical parts when possible.
Particularly after completing the draft phase, it is recommended that you comment out the
DEBUG outputs. The write access to the constantly expanding "easyscreen_log.txt" logbook
may slow down the processing.
Programming
Syntax:
DEBUG(expression))
Description:
Makes an entry in the "easyscreen_log.txt" logbook
Parameter:
Expression to be evaluated from which an entry is generated in the logbook
Example
IF Var1 > Var2
DEBUG("Value of ""Var1"": " << Var1)
; Entry in the "easyscreen_log_txt:
[10:22:40.445] DEBUG: Value of "Var1":
123.456
ENDIF
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
151
Programming commands
6.3 Functions
6.3.14
Exit dialog (EXIT)
Description
The EXIT function is used to exit a dialog and return to the master dialog. If no master dialog
is found, you will exit the newly configured user interfaces and return to the standard application.
Programming (without parameters)
Syntax:
EXIT
Description:
Exits a dialog
Parameters:
- None -
Example
PRESS(HS1)
EXIT
END_PRESS
Description
If the current dialog has been called with a transfer variable, the value of the variables can be
changed and transferred to the output dialog.
The variable values are each assigned to the variables transferred from the output dialog to the
subsequent dialog using the "LM" function. Up to 20 variable values, each separated by a
comma, can be transferred.
Note
The sequence of variables or variable values must be the same as the sequence of transfer
values programmed for the LM function to preclude assignment errors. Any unspecified
variable values will not be changed when the transfer is made. The modified transfer variables
are immediately valid in the output dialog on execution of the LM function.
Programming with a transfer variable
Syntax:
EXIT[(VARx)]
Description:
Exits the dialog and transfers one or more variables
Parameters:
VARx
Label variables
SINUMERIK Integrate Run MyScreens
152
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.3 Functions
Example
//M(Screen form1)
PRESS(HS1)
LM("SCREEN FORM2","CFI.COM",1, POSX,
POSY, DIAMETER)
; Interrupt screen form1 and open screen
form2. In doing this, transfer variables
POSX, POSY and DIAMETER.
DLGL("Screen form2 ended")
; After returning from screen form2, the
following text appears in the dialog line
of screen form1: Screen form2 ended.
END_PRESS
//END
//M(Screen form2)
PRESS(HS1)
EXIT(5, , CALCULATED_DIAMETER)
; Exit screen form2 and return to screen
form1 in the line after LM. In doing
this, assign the value 5 to the variable
POSX and the value of the CALCULATED_DI-
AMETER variable to the DIAMETER variable.
The variable POSY retains its current val-
ue.
END_PRESS
//END
6.3.15
Dynamic manipulation of the lists of toggle fields or list box fields
Description
The LISTADDITEM, LISTINSERTITEM, LISTDELETEITEM and LISTCLEAR functions are
used for the dynamic manipulation of the lists of toggle fields or list box fields.
These functions only have an effect on variables that have their own list, such as:
● "Simple" list
DEF VAR_AC1 = (I/* 0,1,2,3,4,5,6,7,8) or
● "Extended" list
DEF VAR_AC2 = (I/* 0="AC0", 1="AC1", 2="AC2", 3="AC3", 4="AC4",
5="AC5", 6="AC6", 7="AC7", 8="AC8").
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
153
Programming commands
6.3 Functions
If the variable points to an array, e.g. DEF VAR_AC3 = (I/* MYARRAY), these functions are
not available as otherwise the global array would be changed.
At least one value must be defined for the variable in the DEF line. This specifies the "Simple"
or "Extended" list type.
However, the list can then be completely deleted and, if required, completely rebuilt. The
"Simple" or "Extended" type must be retained however, it cannot be changed dynamically.
Programming
Syntax:
LISTINSERTITEM(Variable name, Position, ItemValue[, ItemDisp-
Value])
Description:
Inserts an element at a specific position; reading from a file
Parameter:
Variable name
Position
Position at which an element is
to be inserted in the list
ItemValue
Value of the list entry
ItemDispValue
Value as it is to be displayed in
the list
Syntax:
LISTADDITEM(Variable name, ItemValue[, ItemDispValue])
Description:
Adds an element to the end of the list
Parameter:
Variable name
ItemValue
Value of the list entry
ItemDispValue
Value as it is to be displayed in
the list
Syntax:
LISTDELETEITEM(Variable name, Position)
Description:
Deletes a specific element
Parameter:
Variable name
Position
Position of the element to be de-
leted in the list
Syntax:
LISTCOUNT(Variable name)
Description:
Returns the current number of elements in the list
Parameter:
Variable name
Syntax:
LISTCLEAR(Variable name)
Description:
Deletes the complete list
Parameter:
Variable name
SINUMERIK Integrate Run MyScreens
154
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.3 Functions
Examples
Note
The following examples build upon each other. The sequence of the examples is relevant in
order to understand the respective results.
Requirement/assumption:
DEF VAR_AC = (I/* 0="Off",1="On"/1/,"Switch"/WR2)
Adding an element -1="Undefined" to the end of the list:
LISTADDITEM("VAR_AC", -1, """Undefined""")
Result: 0="Off", 1="On", -1="Undefined"
Inserting an element 99="Maybe" at position 2:
LISTINSERTITEM("VAR_AC", 2, 99, """Maybe""")
Result: 0="Off", 1="On", 99="Maybe", -1="Undefined"
Determining the current number of list elements:
REG[10]=LISTCOUNT("VAR_AC")
Result: REG[10] = 4
Deleting the element at position 1:
LISTDELETEITEM("VAR_AC", 1)
Result: 0="Off", 99="Maybe", -1="Undefined"
Deletion of the complete list:
LISTCLEAR("VAR_AC")
Result: List is empty
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
155
Programming commands
6.3 Functions
6.3.16
Evaluate (EVAL)
Description
The EVAL function evaluates a transferred expression and then executes it. With this function,
expressions can be programmed during runtime. This can be useful, for example, for indexed
access operations to variables.
Programming
Syntax:
EVAL(exp)
Description:
Evaluates an expression
Parameters:
exp
Logic expression
Example
VAR1=(S)
VAR2=(S)
VAR3=(S)
VAR4=(S)
CHANGE()
REG[7] = EVAL("VAR"<<REG[5])
; The expression in parentheses produces VAR3 if the
value of REG[5] is equal to 3. The value of VAR3 is,
therefore, assigned to REG[7].
IF REG[5] == 1
REG[7] = VAR1
ELSE
IF REG[5] == 2
REG[7] = VAR2
ELSE
IF REG[5] == 3
REG[7] = VAR3
ELSE
IF REG[5] == 4
REG[7] = VAR4
ENDIF
ENDIF
ENDIF
ENDIF
END_CHANGE
SINUMERIK Integrate Run MyScreens
156
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.3 Functions
6.3.17
Exit Loading Softkey (EXITLS)
Description
You can use the EXITLS function to exit the current user interface and load a defined softkey
menu.
Programming
Syntax:
EXITLS("Softkey menu"[, "Path"])
Description:
Exits dialog and loads a softkey menu
Parameters:
Softkey menu
Name of the softkey menu to be loaded
Path name
Directory path of the softkey menu to be loaded
Example
PRESS(HS1)
EXITLS( "Menu1", "AEDITOR.COM" )
END_PRESS
6.3.18
Function (FCT)
Description
The external functions are stored in a DLL file and identified by an entry in the definition lines
of the configuration file.
Note
The external function must have at least one return parameter.
Programming
Syntax:
FCTFunction name = ("File"/Type of return/Types of permanent parameters/
Types of variable parameters)
FCT InitConnection = ("c:\tmp\xyz.dll"/I/R,I,S/I,S)
Description:
An external function can, for example, be called from the LOAD method or exe-
cuted in the PRESS method.
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
157
Programming commands
6.3 Functions
Parameters:
Function name
Name of external function
File
Complete path to DLL file
Type of return
Data type of the return value
Type of fixed parame-
Value parameter
ter
Type of variable pa-
Reference parameter
rameter
The data types are separated by commas.
The external function can, for example, be called from the LOAD method or executed in the
PRESS method.
Example:
press(vs4)
RET = InitConnection(VAR1,13,"Servus",VAR2,VAR17)
end_press
Structure of the external function
The external function must take into account a certain, specific signature:
Syntax:
extern "C" dllexport void InitConnection (ExtFctStructPtr FctRet, ExtFctStructPtr
FctPar, char cNrFctPar)
Description:
DLL export, only when implemented in Windows
Specifiers and transfer parameters are strictly defined. The actual call parameters
are transferred using the transferred structures.
Parameters:
cNrFctPar
Number of call parameters = number of structure ele-
ments in FctPar
FctPar
Pointer to a field of structure elements, which contain the
particular call parameter with data type.
FctRet
Pointer to a structure for the function value return with
data type.
Definition of the transfer structure
union CFI_VARIANT
(
char
b;
short int
i;
double
r;
char*
s;
)
typedef struct ExtFctStructTag
(
SINUMERIK Integrate Run MyScreens
158
Programming Manual, 06/2019, A5E40869575B AC
Programming commands
6.3 Functions
char
cTyp;
union CFI_VARIANT
value;
)ExtFctStruct;
typedef struct ExtFct* ExtFctStructPtr;
If the external function is to be developed independently of the platform (Windows, Linux), then
it is not permissible to use the keyword __declspec(dllexport). This keyword is only required
under Windows. For instance, the following macro can be used under Qt:
#ifdef Q_WS_WIN
#define MY_EXPORT __declspec(dllexport)
#else
#define MY_EXPORT
#endif
The function is declared as follows:
extern "C" MY_EXPORT void InitConnection
(ExtFctStructPtr FctRet, ExtFctStructPtr FctPar,char cNrFctPar)
If the screens, configured with "Run MyScreens", are used on the NCU and PCU/PC, then the
extension of the binary file must be omitted:
FCT InitConnection = ("xyz"/I/R,I,S/I,S)
When the absolute path information is omitted, "Run MyScreens" first searches for the binary
file in the configured directory.
6.3.19
Generate code (GC)
Description
The GC (Generate Code) function generates NC code from the OUTPUT method.
Programming
Syntax:
GC("Identifier"[,"Target file"][,Opt],[Append])
Description:
Generating NC code (the GC function can only be used within the NC)
SINUMERIK Integrate Run MyScreens
Programming Manual, 06/2019, A5E40869575B AC
159
|