0% found this document useful (0 votes)
165 views79 pages

(5-4) 808D Function Manual 1212 en en-US (208-286) PDF

The document describes how to call standard cycles using M codes or T codes on a SINUMERIK 808D control system. It provides an example of a standard cycle called with M06, and explains how to configure parameters to activate M codes or T codes for calling cycles. It also describes some frequently used system variables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
165 views79 pages

(5-4) 808D Function Manual 1212 en en-US (208-286) PDF

The document describes how to call standard cycles using M codes or T codes on a SINUMERIK 808D control system. It provides an example of a standard cycle called with M06, and explains how to configure parameters to activate M codes or T codes for calling cycles. It also describes some frequently used system variables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 79

Special functions

16.1 Calling an online help

7. Press the "808D data" softkey, and press <INPUT> to access the "HMI data" folder. Then
select the "OEM online help (*.txt; *.png; *.bmp)" folder by using the Up and Down arrow
keys.

8. Press <INPUT> to access the "OEM online help (*.txt; *.png; *.bmp)" folder, and then
enter the "manual" folder, that is, the above-mentioned third-level folder. Press the
"Paste" softkey to paste the copied file(s) under this folder.

9. Press <HELP> and press the right arrow key. Then you can view your own online help,
as shown in following example.

Function Manual
208 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.1 Calling an online help

You can view the help content list by pressing the right arrow key.

10.Directly press <INPUT> or the "Show" softkey to show your online help, or select one
help content and then view it using <INPUT> or the "Show" softkey.

11.If you have created hyperlinks in the online help text, use the "Go to topic" softkey and
then press the "Show" softkey to go to the linked target.

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 209
Special functions
16.1 Calling an online help

12.Press "Exit" to exit the online help or press the "TOC" softkey to return to the online help
main menu.

Uploading an OEM manual using a USB stick


To upload an OEM manual using a USB stick, proceed as follows:
1. Create your own file(s) for an OEM manual and save the file(s) in the USB stick.
The file format must be oemmanual.pdf. Because the OEM online help supports multiple
languages, you need to first create folders for different languages. You can reate, for
example, the following folder structure, in the USB stick.
First level:

Second level:

Third level:

2. Copy the four first-level folders to the "OEM manual (oemmanual.pdf)" folder. For how to
find this folder, see the subsequent steps.
3. Insert the USB stick into the USB interface in the front of the PPU.
4. In the "SYSTEM" operating area, press the "Sys. data" softkey.
5. Press the "USB" softkey.
6. Select the OEM manual file(s) using <INPUT>, and then press the "Copy" softkey.

Function Manual
210 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.1 Calling an online help

7. Press the "808D data" softkey, and press <INPUT> to access the "HMI data" folder. Then
select the "OEM manual (oemmanual.pdf)" folder by using the Up and Down arrow keys.

8. Press <INPUT> to access the "OEM manual (oemmanual.pdf)" folder, and then enter the
"manual" folder, that is, the above-mentioned third-level folder. Press the "Paste" softkey
to paste the copied file(s) under this folder.

9. Press <HELP> and then press the "OEM Manual" softkey. Then you can view your own
OEM manual.
10.Press "Exit" to exit the OEM manual.

NOTICE
Poor performance of the system
Do not upload one or more OEM files of too large size; otherwise, the system performance
will be reduced.

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 211
Special functions
16.2 Calling a standard cycle with auxiliary functions

16.2 Calling a standard cycle with auxiliary functions


For the SINUMERIK 808D control system, you can call user cycles with M codes or T codes.
With this function, you can perform operations such as changing machine tools.

Note
M codes or T codes for calling user cycles must not be in the same program segment.

Calling cycles with "M6"


Configure the parameters shown in the table below to activate an M code for calling a
standard cycle:

No. Name Unit Value Description


22550 TOOL_CHANGE_MODE - 1 Activating tool parameters with an M
code
22560 TOOL_CHANGE_M_CODE - 206 The M code for activating tool
parameters
10715 M_NO_FCT_CYCLE[0] - 6 Calling the standard cycle with M06
10716 M_NO_FCT_CYCLE_NAME[0] - "TOOL" Name of the standard cycle

For the format of a standard cycle, refer to the example shown below:

B1B722/B63)
3$7+ B1B&86B',5
352&722/6$9(',63/2)
,)3B,67(67*272)B(1'
,)3B6($5&+!*272)B(1'
,)3B722/12 3B722/3*272)B12
*'
*= 
6326 01B86(5B'$7$B)/2$7>@
06* ಯ5HDG\WRFKDQJHWRRO 2ULJLQDOWRROQXPEHU7ರ3B722/12
0
67235(
**=)*
06* ಯ5HDG\WRFKDQJHWRRO 2ULJLQDOWRROQXPEHU7ರ3B722/3
*272)B(1'
B12
06* ಯ1RDFWLRQ 5HDVRQSURJUDPPLQJWRROQXPEHU VSLQGOHWRROQXPEHUರ
B(1'
0

Function Manual
212 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.2 Calling a standard cycle with auxiliary functions

Calling cycles using the "T" function


Configure the parameters shown in below table to activate a T code for calling a standard
cycle:

No. Name Unit Value Description


22550 TOOL_CHANGE_MODE - 0 Activating tool parameters with an M
code
10717 T_NO_FCT_CYCLE[0] - "TOOL" Calling the standard cycle with M06

The format of the standard cycle is the same with that of M codes. The tool number for
programming will be saved into system variable $C_T.

Descriptions of frequently used system variables

Variables Descriptions
$P_ISTEST Program testing status; boolean variable
$P_SEARCH Program searching status; boolean variable
$P_SEARCHL Program searching status; real numbers: 1-, 2-, 3-
$P_TOOLNO Tool number in the spindle turret
$P_TOOLP Programming tool number
$C_T Programming tool number.
$P_TOOLP is inactive when the program code T calls a tool
changing cycle that is defined with MD10717. The tool number is
then represented with "$C_T".
$TC_DP1[Tool number, 1] Tool type
$TC_DP3[Tool number, 1] Tool's geometrical parameter: tool length 1
$TC_DP6[Tool number, 1] Tool's geometrical parameter: tool radius
$TC_DP12[Tool number, 1] Tool wear: the direction of length 1
$TC_DP15[Tool number, 1] Tool wear: the direction of radius
$TC_DP24[Tool number, 1] Tool's dimension:
0: normal
1: oversize
$TC_DP25[Tool number, 1] Number of the tool turret
_TM[n] Global user data (integral)
_ZSFR[n] Global user data (float)
NOTE:
Since this data has been used in the Siemens standard technology
cycles, ensure that there is no conflict with the technology cycles
when you are using this data.

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 213
Special functions
16.3 Display function

16.3 Display function

Displaying the part timer


The part timer is available for the SINUMERIK 808D to count the following time periods:

Time Corresponding system variable Description


Run time $AC_OPERATING_TIME Total time for running programs in AUTO
mode
Cycle time $AC_CYCLE_TIME Run time of a selected program
Cutting time $AC_CUTTING_TIME Cutting time (G01, G02, G03) of a selected
program
Setup time 1) $AN_SETUP_TIME Time elapsed since the last power-on with
default values
Power on time 1) $AN_POWERON_TIME Time elapsed since the last normal power-on
Remain time 2) - Remaining time for running the current
program.
1) The remaining time has no corresponding system variable, and can be counted only after a cycle
of a part program has successfully run.
2) Both the setup time and the power on time are counted automatically after the controller has been
powered on.

By default, the run time, the cycle time, the setup time and the power on time are displayed.
The cutting time can only be counted after being activated with MD27860:

No. Name Value Descriptions


27860 PROCESSTIMER_MODE Actual value Activation of counting for following program
runtime:
 Run time
 Cycle time
 Cutting time

In the "OFFSET" operating area, press the horizontal softkey "Sett. data" > Vertical softkey
"Time counter" and you can open the "Times / Counter" window:

Function Manual
214 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.3 Display function

Under the "AUTO" mode in the "MACHINE" operating area, the time counter (vertical softkey
"Time counter") can also be displayed counting following time:
● Cycle time
● Time left

Displaying the part counter


The part counter is available for the SINUMERIK 808D to count the following information:

Time Corresponding system variable Description


Required parts $AC_REQUIRED_PARTS Required parts to be counted.
Activated by setting MD27880 BIT0 = 1:
 BIT 1 = 0: if "Part count" = "Parts required",
alarm or interface DB3300.DBX4001.1 = 1
Parts in total $AC_TOTAL_PARTS Total number of counted parts.
Activated by setting MD27880 BIT 4 = 1:
 BIT 5 = 0: M02/M30 increases "Parts in
total" to "1"
 BIT 5 = 1: the M code defined by MD27882
increases "Parts in total" to "1"
 BIT 6 = 0/1: the counter does not work when
"Program test" in active
Part count $AC_ACTUAL_PARTS Parts actually counted.
Activated by setting MD27880 BIT 8 = 1:
 BIT 9 = 0: M02/M30 increases "Parts in
total" to "1"
 BIT 9 = 1: the M code defined by MD27882
increases "Parts in total" to "1"
 BIT 10 = 0/1: the counter does not work
when "Program test" in active

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 215
Special functions
16.3 Display function

Table 16- 1 Relevant parameters

No. Name Value Descriptions


27880 PART_COUNTER Actual value Configuring and activating the part counter
27882 PART_COUNTER_MCODE Actual value Defining an M code for the counting action:
0 to 99

In the "OFFSET" operating area, the part counter (horizontal softkey "Sett. data" > Vertical
softkey "Time counter") can be displayed counting following information:

Under the "AUTO" mode in the "MACHINE" operating area, the part counter (vertical softkey
"Time counter" > <SELECT> key) can also be displayed counting the following information:

Note
All of the numbers that have been entered must be confirmed using the <INPUT> key.

Function Manual
216 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.4 Prog_Event function

16.4 Prog_Event function


With the Prg_Event function, an asynchronous subroutine program called
"PROG_EVENT.SPF" is triggered to be executed at certain states such as the end of a
program, NC reset, etc.. You must save the PROG_EVENT.SPF file under the cycle
directory (N: \CMA).

Table 16- 2 Relevant parameters

No. Name Value Descriptions


11450 SEARCH_RUN_MODE 7H -
20106 PROG_EVENT_IGN_SINGLE 1FH -
BLOCK
20107 PROG_EVENT_IGN_INHIBIT CH -
20108 PROG_EVENT_MASK Actual value Triggering modes for N:
\CMA\PROG_EVENT.SPF:
 Bit 0: activating the PROG_EVENT.SPF
during the NC commissioning
 Bit 1: activating the PROG_EVENT.SPF
at the end of a NC program
 Bit 2: activating the PROG_EVENT.SPF
using the RESET key
 Bit 3: activating the PROG_EVENT.SPF
after powering up the NC
20109 PROG_EVENT_MASK_PROP 1H -
ERTIES

16.5 Fast I/O

Hardware description
The FAST I/O interface (X21) provides 3 digital inputs and 1 digital output:

Illustration Pin Signal Description Variable


4 DI1 Fast input 1 with address DB2900.DBX0.0 $A_IN[1]
5 DI2 Fast input 2 with address DB2900.DBX0.1 $A_IN[2]
6 DI3 Fast input 3 with address DB2900.DBX0.2 $A_IN[3]
7 DO1 Fast output 1 with address DB2900.DBX4.0 $A_OUT[1]

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 217
Special functions
16.5 Fast I/O

Relevant parameters

MD No. Name Meaning Value


10366 HW_ASSIGN_DIG_FASTIN[0] Hardware assignment for the fast inputs 10101
10368 HW_ASSIGN_DIG_FASTOUT[0] Hardware assignment for the fast outputs 10101

PLC interface addresses

DB2900 Signals from fast inputs and outputs


Byte Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
0 Input 3 Input 2 Input 1
4 Output 1

Applications of the fast inputs/outputs


Fast inputs
In the PLC application program, you can directly read each bit value from the address
DB2900.DBX0.0.
In a part program, you can read each bit value from the address DB2900.DBX0.0 via
corresponding system variable.
Fast outputs
From the address DB2900.DBX4.0 you can not assign a value to the fast output; otherwise,
the PLC application program will stop with an error. However, you can assign a value to the
fast output from address DB2800.DBX5.0 and DB2800.DBX6.0.
In the PLC application program, you can trigger the address DB2800.DBX5.0 with a rising
edge or a negative edge at the address DB2800.DBX6.0, and thus the address
DB2900.DBX4.0 will vary with the address DB2800.DBX6.0.
For example, if you want to use I0.0 to trigger or deactivate the set/reset of the address
DB2900.DBX4.0, you can write as follows in the PLC application program:

In a part program, you can set or reset the fast output via its corresponding variable. The
system variable is $A_OUT[1].

Function Manual
218 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.6 Creating user cycles

For example:

$B287>@  !VHW'%'%; 
0

16.6 Creating user cycles


The SINUMERIK 808D is integrated with standard Siemens cycles. If necessary, you can
also create your own cycles.
To create a customized cycle, you must prepare the files shown below:
● User cycle file
● Extended user text file
● User cycle alarm file
● User cycle softkey index file
● User cycle parameter file
● User cycle bitmap file

16.6.1 Creating the extended user text file


The extended user text file is required for the display of respective screen texts, cycle
messages and softkey texts.

Naming rule
almc_xxx.txt
Here "xxx" refers to the language denotation, for example, eng.

Text definition rules


When defining the texts, you must follow the rule below:
<Identifier> "<Text>" // <# chars & lines>
● <Identifier>: here you define the identifier with a number. The number ranges from 83000
to 84999.
● <Text>: here you define the actual text.
● <# chars & lines>: here you specify the available space for the text in the GUI in number
of characters and lines. You can start a new line by inserting the character of "%n". A
maximum of 2 lines with 9 characters each are available for softkey texts.

Examples
83000 "User%nCycles" // 2*9 ⇒ two lines. Each line with nine characters space
83001 "CYCLE10" // 9 ⇒ one line with nine characters space

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 219
Special functions
16.6 Creating user cycles

16.6.2 Creating the user cycle softkey index file


The user cycle softkey index file (cov.com) file is required to define the softkeys for the user
cycle. You can create the cov.com file with a text editor like the WordPad or Notepad.

Text definition rules


Sx.y.z\$+identifier\bitmap(cycle)

Table 16- 3 Definitions of the parameter

Parameters Value range Significance


X 5 The fifth horizontal key.
Y 1 to 8 The first to eighth vertical key in the first level.
Z 1 to 8 The first to eighth vertical key in the second level.
\$+identifier\ - Defined in the cycle text file.
bitmap(cycle) - The bitmap for the user cycle. The bitmap name must be followed
with name of the user cycle.

Examples
6?? !GHILQHDVRIWNH\ LGHQWLILHU DWWKHKRUL]RQWDONH\
6??&1 &<&/( !GHILQHDVRIWNH\ LGHQWLILHU DWWKHILUVWYHUWLFDONH\RI
0 WKHILUVWOHYHOZKHQSUHVVLQJWKHKRUL]RQWDONH\

16.6.3 Creating the user cycle parameter file


The user cycle parameter file (sc.com) file is required to define the help information and the
parameters for the user cycle. You can create the sc.com file with a text editor like the
WordPad or Notepad.

Text definition rules


The "//" symbol indicates the beginning of a cycle description.
If you have created an image to display on the left of the screen at cycle start, call the image
at the first line. The image is followed by the cycle name written in brackets.
Now define the parameters for the individual variables according to the format shown in the
table below:

Line Description of the parameters Entry


1 Start of variable declaration (
2 Variable type R - REAL
I - INTEGER
C - CHAR
S - STRING

Function Manual
220 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.6 Creating user cycles

Line Description of the parameters Entry


3 Separator /
4  Minimum value + space + maximum  Minimum value + space + maximum value
value  * + different characters (use space to
 * + different values for selection separate the different characters)

Note that you can also define different


pictures for the characters.
5 Separator /
6 Default value Value passed in the cycle if no entry is made.
7 Separator /
8 Help information $ + the identifier defined in the cycle text file
9 End of variable declaration )
10 Start of description [
11 Short text The text displayed in the parameter screen form
(defined in the cycle text file).
12 Separator /
13 Text in the screen Text preceding the input screen. A maximum of
5 characters in length.
14 End of description ]
15 Line-specific image /B name.bmp

Note
Separators, start and end identifiers must always be entered.
The lines 4, 6 and 15 can be left blank.
If no texts are stored with the $identifier, three question marks appear in the associated
fields on the screen.

Example

&1 &<&/(
5 >',$@
5 >',$)@
5 >67$3@
5 >(1'3@
5 >0,'@
5 >8;@
,  >0$&+@%&1
5 >957@

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 221
Special functions
16.6 Creating user cycles

16.6.4 Creating the user cycle file


You can create a user cycle file according to different machining functions. It is a subroutine
program that can be used at calling a cycle.

Naming rule
CYCLExxx.SPF
Here "xxx" refers to the cycle number. It must not exceed four digits.

Note
The name of a user cycle must not be same with that of a standard Siemens cycle. It is
recommend to use a cycle number with the range of 100 to 800.

Programming example
Create the program with a wordpad or notepad.
As a cycle screen always also transfers values as call parameters to the user cycle, the
transfer interface is defined as follows.
PROC CYCLE100(REAL DIA,REAL DIAF,REAL STAP,REAL ENDP,REAL MID,REAL UX,INT MACH,REAL
VRT) SAVE SBLOF DISPLOF

PROC is a keyword followed by the cycle name with the cycle number. All the transfer
parameters for the screen are contained within brackets with the data type and name
separated by commas.

Function Manual
222 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.6 Creating user cycles

352&&<&/( 5($/',$5($/',$)5($/67$35($/(1'35($/0,'5($/
8;,170$&+5($/957 6$9(6%/2)',63/2)
'()5($/9$5
,)3B(3>;@',$*272)//
//
,)',$)!',$*272)(1'
67$57
,)0$&+ *272)528*+,1*
,)0$&+ *272)),1,6+,1*
,)0$&+ *272)528*+,1*
'()5($/9$5
528*+,1*
5 ',$',$) 8;
5 50,'
5 7581& 5
5 
9$5 ',$
,)5 *272)528*+,1*
//
6%/21
**; 9$5= 67$3
*= (1'3
*; 0,'
**; 957= 957
**= 67$3
6%/2)
9$5 9$5 0,'
5 5
,)5 5*272%//
,)5!5*272)528*+,1*
528*+,1*
6%/21
**; ',$)8;
*= (1'3
**; 957= 957
**; ',$
= 67$3
,)0$&+ *272)),1,6+,1*
6%/2)
5(7
),1,6+,1*
6%/21
*; ',$)
*= (1'3
*; ',$957
**; 957= 957
*= 67$3
6%/2)
5(7
//
,)3B(3>=@67$3*272)(1'
*272%//
(1'
6(7$/ 
67235(
0
5(7
(1'
6(7$/ 
67235(
0
5(7

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 223
Special functions
16.6 Creating user cycles

16.6.5 Creating the user cycle alarm file


The user cycle alarm file is required to display alarm numbers and alarm messages for user
cycles.

Naming rule
alc_xxx.txt
Here "xxx" refers to the language denotation, for example, eng.

Text definition rules


When defining the texts, you must follow the rule below:
<AlarmNumber> "<Text>" // <# chars & lines>
● <AlarmNumber>: here you define the alarm number. The number ranges from 65000 to
79999.
● <Text>: here you define the actual alarm text.
● <# chars & lines>: here you specify the available space for the text in the GUI in number
of characters and lines. You can start a new line by inserting the character of "%n".

Examples
65000 "Current tool position is incorrect" // 34 ⇒ one lines with thirty-four characters space
65001 "DIAF is bigger than DIA" // 23 ⇒ one line with twenty-three characters space

16.6.6 Creating the user cycle bitmap file


The cycle icons must be stored as bitmap files (*.bmp) with a maximum size of 224 * 224
pixels in 16 colors.
The icon name must begin with an uppercase/lowercase "C" and its length must not exceed
32 characters including the file extension (e.g. CN1.bmp).

Note
If 16 colors are not sufficient for the display, you can also use 24-bit color depth bitmaps.

Function Manual
224 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.6 Creating user cycles

16.6.7 Transferring the desired files to the control system


Proceed as follows to transfer the required files to the SINUMERIK 808D control system.

Importing the cov.com file and sc.com file


1. Save the required files on a USB flash disk.
2. Insert the USB flash disk into the USB interface at the front of the PPU.

3. Switch to the "SYSTEM" operating area by pressing + .


4. Press the "USB" softkey and multi-select the cov.com file and sc.com file with <SELECT>
and copy them with the "Copy" softkey.
5. Press the "808D data" softkey and access the folder "HMI data" > "User cycle files".

Replace the empty files with the "Paste" softkey.

Importing the user cycle alarm file


1. Press the "USB" softkey and select a user cycle alarm file (for example, alc_eng.txt) with
the <SELECT> key. Press "Copy".
2. Press the "808D data" softkey. Press <INPUT> to access the "HMI data" > "User cycle
files" > "User cycle alarm file (alc....txt)" folder and then press "Paste".

Importing the bitmap file


1. Press the "USB" softkey and select a bitmap file (for example, cn1.bmp) with the
<SELECT> key. Press "Copy".
2. Press the "808D data" softkey. Press <INPUT> to access the "HMI data" > "User cycle
files" > "User cycle bitmap file (*.bmp)" folder and then press "Paste".

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 225
Special functions
16.6 Creating user cycles

Importing the user cycle file


1. Press the "USB" softkey and select a user cycle file (for example, CYCLE100). Press the
"Copy" softkey.
2. Press the "User cycle" softkey and then press "Paste":

Importing the extended user text file


1. Press softkeys "Sys. data" > "USB". Select an extended user text file (for example,
almc_eng.txt) and copy it with the "Copy" softkey.
2. Press the "808D data" softkey. Press <INPUT> to access the "HMI data" > "Extended
user text file (almc....txt)" folder and then press "Paste".

Note
After you press "Paste" to import the cov.com file, sc.com file, alc_xxx.txt file and
almc_xxx.txt file, a system message will appear to prompt you to restart the HMI by pressing
"OK". Then press "OK" to restart the HMI so that the new data will be available.

16.6.8 Call the created user cycle


After you transfer all the files necessary for your own cycle to the control system, the cycle is
created successfully. Then you can use the cycle in the "PROGRAM" operating area.
Proceed as follows to call the created cycle, for example, CYCLE888.
1. Press <PROGRAM> on the PPU, and now the horizontal softkey "user Cycle" appears.
Press "user Cycle".

Function Manual
226 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.6 Creating user cycles

2. Press the vertical softkey "user Cycle888" to open the "CYCLE888" window.

3. Set the parameters according to your own requirements, and then press "OK" to save the
settings. Or, press "Cancel" to quit the cycle.

16.6.9 Editing the user cycle screens


You can edit the softkeys, identifiers, bitmaps or parameters for user cycles.
To do so, export the relevant files and edit them on a PC. After that, import them back to the
respective folders and restart the control system.

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 227
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

16.7 Generating user dialogs using customized EasyXLanguage scripts

16.7.1 Scope of functions

Overview
The "Generate user dialogs" function offers an open structure and enables the user to
develop customer-specific and application-specific HMI interfaces.
The SINUMERIK 808D offers an XML-based script language for generating user dialogs.
This script language makes it possible to display machine-specific menus and dialog forms
in the "CUSTOM" operating area on the HMI.

Use
The defined XML instructions offer the following properties:
1. Display dialogs containing the following elements:
– Softkeys
– Variables
– Texts and help texts
– Graphics and help displays
2. Call dialogs by:
– Pressing the corresponding softkeys
3. Restructure dialogs dynamically:
– Edit and delete softkeys
– Define and design variable fields
– Insert, exchange, and delete display texts (language-dependent or language-neutral)
– Insert, exchange, and delete graphics
4. Initiate operations in response to the following actions:
– Displaying dialogs
– Inputting values (variables)
– Selecting a softkey
– Exiting dialogs
5. Data exchange between dialogs
6. Variables
– Read (NC, PLC and user variables)
– Write (NC, PLC and user variables)
– Combine with mathematical, comparison or logic operators
7. Execute functions:
– Subprograms

Function Manual
228 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

– File functions
– PI services
8. Apply protection levels according to user classes
The valid elements (tags) for the script language are described in Section "XML identifier
(Page 232)".

Note
The following section is not intended as a comprehensive description of XML (Extensible
Markup Language). Please refer to the relevant specialist literature for additional information.

16.7.2 Fundamentals of configuration

Configuration files
The defining data for new user interfaces are stored in configuration files. These files are
automatically interpreted and the result displayed on the screen. Configuration files
(EasyXLanguage scripts) are included in the "...\examples\easyXL" folder of the Toolbox.
An XML editor or another form of text editor can be used to generate the configuration files.

Note
No distinction is made between upper and lower case letters.

Menu tree principle


Several interlinked dialogs create a menu tree. A link exists if you can switch from one dialog
to another. You can use the newly defined horizontal/vertical softkeys in this dialog to call the
preceding or any other dialog.
Configured start softkeys can be used to create a further menu tree behind the start menu:
6WDUWPHQX

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 229
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Start menu
The start menu is defined by the name "main" in the "xmldial.xml" file. The start menu is
used to initiate your own operating sequences.
Loading your own dialogs or additional softkey bars can be linked with the main menu.
Additional actions can be performed using these softkey bars.

Returning to the standard application


You can exit the newly created user interfaces and return to the standard application by
pressing one of the following keys or key combination on the PPU:

, , , , + , , or

16.7.3 Configuration files (EasyXLanguage)

Loading the configuration files


The generated configuration files must be copied from a USB stick to the "SYSTEM"
operating area > "Sys. data" > "808D data" > "HMI data" menu > "EasyXLanguage scripts"
folder. See the screen below:

Files for configuration


The following files in the control system's "EasyXLanguage scripts" folder are needed to
configure the user dialogs:

File type Name of the file Meaning


Script file "xmldial.xml" This script file uses XML tags to control the
process image of the configured softkey
menus and dialog forms in the "CUSTOM"
operating area on the HMI.

Function Manual
230 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

File type Name of the file Meaning


Text file "almc.txt" This text file contains the texts for the
menus and dialog forms for individual
languages.
Bitmaps "*.bmp" (E.g., "text.bmp") Archive with the bitmaps.
"*.png" (E.g., "text.png") The control system supports BMP and
PNG formats.
XML files inserted E.g. "machine_settings.xml" These files also contain programmed
in the "xmldial.xml" instructions for displaying the dialog forms
control file with the and parameters on the HMI.
"INCLUDE" XML
tag.

Note
As soon as there is an "xmldial.xml" script file in in the "EasyXLanguage scripts" folder, you
can start this user dialog in the "CUSTOM" operating area.
After the initial copying process, the control system must be reset via "SYSTEM" operating
area> "Start-up" > "NC" > "Standard power-up".

Example of a user dialog on the HMI


The configured softkey menus are displayed when the "CUSTOM" operating area is called.
This enables the user to operate the dialog forms which have been configured.

Note
If configured and programmed dialogs need to be used at the same time, the script language
must be used to call the programmed dialogs. The functions required for this purpose are
described in Section "Predefined functions (Page 265)".

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 231
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

16.7.4 Structure of configuration file

Overview
A configuration file consists of the following elements:
● Description of the "main" start menu with start softkeys
● Definition of dialogs
● Definition of variables
● Description of the blocks
● Definition of softkey bars

16.7.5 Language dependency


Language-dependent texts are used for:
● Softkey labels
● Headers
● Help texts
● Any other texts
The language-dependent texts are stored in the text file (almc.txt).

16.7.6 XML identifier

16.7.6.1 General structure

Structure and instructions of the script file for dialog configuration


All dialog configurations should be stored in the DialogGui tag.
<DialogGui>

</DialogGui>
Example:
<?xml version="1.0" encoding="utf-8"?>
<DialogGui>

<FORM name ="Hello_World">
<INIT>
<CAPTION>Hello World</CAPTION>
</INIT>
...
</FORM>

</DialogGui>

Function Manual
232 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Instructions
The following instructions can be used for executing conditional instructions and loop
controls:
● For loop
● While loop
● Do with loop
● Conditional processing
● Switch and case instructions
● Operator controls in a dialog form
● Softkey descriptions
● Define variables
For a detailed description of instructions, see Section "Instruction/identifier description
(Page 233)".

16.7.6.2 Instruction/identifier description


The following XML tags are defined for generating dialogs and menus, and for executing
program sequences:

Note
Attribute values that are in quotation marks "<...>" should be replaced by the currently used
expressions.
Example:
<DATA_LIST action="read/write/append" id="<list name>">
is programmed as follows:
<DATA_LIST action="read/write/append" id="my datalist">

Tag identifier Meaning


BREAK Conditional cancellation of a loop.
CONTROL_RESET The tag enables one or more control components to be restarted.
Syntax:
<CONTROL_RESET resetnc="TRUE" />
Attributes:
 RESETNC = "TRUE"

The NC component is restarted

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 233
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


DATA The tag enables the NC, PLC, and GUD data to be directly written to.
The "Addressing components (Page 246)" section contains details on address formation.
Attribute:
 name

Variable address
Tag value:
All alphanumeric terms are approved as tag values. If a value is to be written from a local
variable directly, the $ replacement operator preceding the name of the local variable
should be used.
Syntax:
<DATA name="<variable name>"> value </DATA>
Example:
<DATA name = "plc/mb170"> 1 </DATA>

<LET name = "tempVar"> 7 </LET>
<!— the contents of the local variables "tempVar" are written to
bit memory byte 170 →
<DATA name = "plc/mb170">$tempVar</DATA>
DATA_LIST The tag enables the listed machine data to be saved or restored.
Up to 20 temporary data lists can be created.
Attributes:
 action

read– the values of the listed variables are stored in a temporary memory
append– the values of the listed variables are added to an existing list
write– the backed up values are copied to the relevant machine data
 id

The identifier is used to identify the temporary memory


Syntax:
<DATA_LIST action="<read/write/append>" id="<list name>">
NC/PLC Address compilation
</DATA_LIST>
Example:
<DATA_LIST action ="read" id="<name>">
nck/channel/parameter/r[2]
nck/channel/parameter/r[3]
nck/channel/parameter/r[4]
$MN_USER_DATA_INT[0]

</ DATA_LIST>
<DATA_LIST action ="write" id="<name>" />
ELSE Instruction for situations where the condition has not been met (IF, THEN, ELSE)

Function Manual
234 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


FORM The tag contains the description of a user dialog. The relevant tags are described in the
section on generating menus and dialog forms.
Syntax:
<FORM name="<dialog name>" color="#ff0000">
Attributes:
 color

Background color of the dialog form (color coding, see Section Color coding
(Page 245))
– Default white
 name

Identifier of the form


 xpos

X-position of the top left corner of the dialog box (optional)


 ypos

Y position of the top left corner (optional)


 width

Extension in the X direction (in pixels) (optional)


 height

Extension in the Y direction (in pixels) (optional)


HMI_RESET The tag initiates an HMI restart.
The interpretation is cancelled after this operation.

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 235
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


IF Conditional statement (IF, THEN, ELSE)
The THEN and ELSE tags are enclosed in the IF tag.
The condition that is executed in the CONDITION tag follows the IF tag. The further
processing of the instructions depends upon the result of the operation. If the function
result is true, then the THEN branch is executed and the ELSE branch is skipped. If the
result of the function is false, the parser executes the ELSE branch.
Syntax:
<IF>
<CONDITION> Condition != 7 </CONDITION>
<THEN>
Instruction for the case: Condition fulfilled
</THEN>
<ELSE>
Instruction for the case: Condition not fulfilled
</ELSE>
</IF>
Example:
<IF>
<CONDITION> "plc/mb170" != 7 </CONDITION>
<THEN>
<OP> "plc/mb170" = 7 </OP>

</THEN>
<ELSE>
<OP> "plc/mb170" = 2 </OP>

</ELSE>
</IF>
INCLUDE The instruction includes an XML description.
(see also DYNAMIC_INCLUDE in this table)
Attribute:
 src

Contains the path name.


Syntax:
<?INCLUDE src="<Path name>" ?>

Function Manual
236 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


LET The instruction creates a local variable under the specified name.
Fields:
Using the attribute dim (dimension) single or two-dimensional fields can be created. The
field index is used to address the individual field elements.
For a two-dimensional field, initially the line index is specified and then the column index.
 Single-dimensional field:

Indices 0 to 4
 Two-dimensional field:

Index line 0 to 3 and index column 0 to 5


Attributes:
 name

Variable name
 type

The variable type can be an integer (INT), double (DOUBLE), float (FLOAT) or string
(STRING). If there is no type instruction specified, the system creates an integer
variable.
<LET name = "VAR1" type = "INT" />
 permanent

If the attribute is set to true, then the variable value is saved permanently. This
attribute is only effective for a global variable.
 dim

The following number of field elements must be specified. For a two-dimensional field,
the second dimension is specified after the first dimension separated by a comma.

A field element is accessed via the field index, which is specified in square brackets
after the variable name.

name[index] or name[row,column]
– Single-dimensional field: dim="<Number of elements>"
– Two-dimensional field: dim="<Number of lines>,<number of columns>"
Non-initialized field elements are pre-assigned with "0".

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 237
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


LET Continued Example:
Single-dimensional field:
<let name="array" dim="10"></let>
Two-dimensional field:
<let name="list_string" dim="10,3" type="string"></let>
Pre-assignment:
A variable can be initialized with a value.
<LET name = "VAR1" type = "INT"> 10 </LET>
If values comprising NC or PLC variables are saved in a local variable, the assignment
operation automatically adapts the format to that of the variables which have been loaded.
 Pre-assignment for a string variable:

Texts containing more than one line can be assigned to a string variable if the
formatted text is transferred as a value. If a line is to end with a line feed <LF> , the
characters "\\n" should be added at the end of the line.

<LET name = "text" type = "string"> F4000 G94\\n


G1 X20\\n
Z50\\n
M2\\n
</LET>>
Fields (Arrays):
<let name="list" dim="10,3">
{1,2,3},
{1,20}
</let>

<let name="list_string" dim="10,3" type="string">


{"text 10","text 11"},
{"text 20","text 21"}
</let>
Assignment:
Values made up of the machine data or subroutines can be assigned to a variable using
the assignment operation "=".
A variable remains valid until the end of the higher-level XML block.
Variables which are to be available globally should be created directly after the DialogGUi
tag.
The following must be observed for a dialog box:
 The message processing opens the corresponding tag.
 The tag is closed after the message has been executed.
 All variables within the tag are deleted when closing.
MSG The operator component shows the message which is indicated in the tag.
If an alarm number is used, the dialog box displays the text which is saved for the
number.
Example:
<MSG text ="my message" />

Function Manual
238 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


MSGBOX The instruction opens a message box whose return value can be used for branching.
Syntax:
<MSGBOX text="<Message>" caption="<caption>" retvalue="<variable
name>" type="<button type>" />
Attributes:
 text

Text
 caption

Header
 retvalue

Name of the variables to which the return value is copied:

1 – OK

0 – CANCEL
 type

Acknowledgement options:

"BTN_OK"

"BTN_CANCEL"

"BTN_OKCANCEL"
If an alarm number is used for the "text" or "caption" attribute, the message box displays
the text which is saved for the number.
Example:
<MSGBOX text="Test message" caption="Information"
retvalue="result" type="BTN_OK" />

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 239
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


OP The tag executes the specified operations.
For the purpose of accessing the NC, PLC, and drive data, the complete variable name
should be placed in quotation marks.
PLC: "PLC/MB170"
NC: "NC/Channel/…"
Example:
<LET name = "tmpVar" type="INT"> </LET>
<OP> tmpVar = "plc/mb170" </OP>
<OP> tmpVar = tmpVar *2 </OP>
<OP> "plc/mb170" = tmpVar </OP>
Character string processing:
The operation instruction is able to process character strings and assign the results to the
string variable specified in the equation.
The identifier _T should be placed at the start as a means of identifying text terms.
Formatting of variable values is also possible. The identifier _F should be placed at the
start of the formatting regulation, followed by the format instruction. The address is then
specified for the variable.
Example:
<LET name="buffer" type="string"></LET>



<OP> buffer = _T"unformatted value R0= " +
"nck/Channel/Parameter/R[0]" + _T" and " + _T"$$85051" + _T"
formatted value R1 " + _F%9.3f"nck/Channel/Parameter/R[1]" </OP>
PASSWORD The tag opens a dialog for entering the password.
Once the entry has been confirmed, the character string is available in the specified
reference variable.
Syntax:
<PASSWORD refVar ="<variable name>" />
Attribute:
 refVar

Name of the reference variable


Example:
<PASSWORD refvar="plc/mw107" />
POWER_OFF A message prompts the operator to switch the machine off. The message text is
permanently saved in the system.

Function Manual
240 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


PRINT The tag outputs a text in the dialog line or copies the text to the variable specified.
If the text contains formatting identifiers, the variable values are inserted at the
appropriate places.
Syntax:
<PRINT name="Variable name " text="text %Formatting "> Variable, …
</PRINT>
<PRINT text="text %Formatting"> Variable, … </PRINT>
Attributes:
 name

Name of the variable where the text is to be stored (optional)


 text

Text
Formatting:
The character "%" causes the variable specified as the value to be formatted.
%[Flags] [Width] [.decimal places] type
 Flags:
Optional character for defining output formatting:
– Right-justified or left-justified ("-") for left-justified
– Add leading zeros ("0")
– Fill with blanks
 Width:
The argument defines the minimum output width for a non-negative number. If the
value to be output has fewer places than the argument defined, the missing spaces
are filled with blanks.
 Decimal places:
With floating point numbers, the optional parameter defines the number of decimal
places.
 Type:
The type character defines which data formats are transferred for the print instruction.
These characters need to be specified.
– d: Integer value
– f: Floating point number
– s: String

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 241
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


PRINTContinued Values:
Number of variables whose values are to be inserted into the text.
The variable types must match the corresponding type identifier for the formatting
instruction and must be separated from one another using a comma.
Example:
Output of a text in the information line
<PRINT text="Infotext" />
Output of a text with variable formatting
<LET name="trun_dir"></LET>
<PRINT text="M%d">trun_dir</PRINT>
Output of a text in a string variable with variable formatting
<LET name="trun_dir"></LET>
<LET name="str" type="string" ></LET>
<print name="str" text="M%d ">trun_dir</print>
STOP Interpretation is cancelled at this point.
SWITCH The SWITCH instruction describes a multiple choice. A term is evaluated once and
compared with a number of constants. If the expression matches the constants, the
instructions are executed within the CASE instruction.
The DEFAULT instruction is executed when none of the constants match the expression.
Syntax:
<SWITCH>
<CONDITION> Value </CONDITION>
<CASE value="Constant 1">
Instructions

</CASE>
<CASE value="Constant 2">
Instructions

</CASE>
<DEFAULT>
Instructions

</DEFAULT>
</SWITCH>
THEN Operation, if the condition has been fulfilled (IF, THEN, ELSE)

Function Manual
242 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


FOR For loop
for (initialization; test; continuation) instruction(s)
Syntax:
<FOR>
<INIT>…</INIT>
<CONDITION>…</CONDITION>
<INCREMENT>…</INCREMENT>
Instructions

</FOR>
The For loop is executed as follows:
1. Evaluation of the term initialization (INIT).
2. Evaluation of the term test (CONDITION) as a Boolean term.
If the value is false, the For loop is ended.
3. Execution of the following instructions.
4. Evaluation of the term continuation (INCREMENT)..
5. Continue with 2.
All the variables used within the INIT, CONDITION, and INCREMENT branches should be
created outside the FOR loop.
Example:
<LET name = "count">0</LET>
<FOR>
<INIT>
<OP> count = 0</OP>
</INIT>
<CONDITION> count <= 7 </CONDITION>
<INCREMENT>
<OP> count = count + 1 </OP>
</INCREMENT>
<OP> "plc/qb10" = 1+ count </OP>
</FOR>
WAITING The tag waits for the component to undergo a hot restart after an NC reset.
Attributes:
 WAITINGFORNC = "TRUE" - the system waits for the NC to restart
Syntax:
<WAITING WAITINGFORNC = "TRUE"/>

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 243
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


WHILE WHILE loop
WHILE (Test)
Instruction
Syntax:
<WHILE>
<CONDITION>…</CONDITION>
Instructions

</WHILE>
The While loop is used to execute a sequence of instructions repeatedly while a condition
is met. This condition is tested before the sequence of instructions is executed.
Example:
<WHILE>
<CONDITION> "plc/ib9" == 0 </CONDITION>
<DATA name = "PLC/qb11"> 15 </DATA>
</WHILE>
DO_WHILE Do while loop
DO
Instructions
WHILE (Test)
Syntax:
<DO_WHILE>
Instructions

<CONDITION>…</CONDITION>
</DO_WHILE>
The Do while loop comprises a block of instructions and a condition. The code within the
instruction block is executed first, then the condition is analyzed. If the condition is true,
the function executes the code section again. This is continuously repeated until the
condition is false.
Example:
<DO_WHILE>
<DATA name = "PLC/qb11"> 15 </DATA>
<CONDITIION> "plc/ib9" == 0 </CONDITION>
</DO_WHILE>

Function Manual
244 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

16.7.6.3 Color coding


The color attribute uses the color coding scheme for the HTML language.
In terms of syntax, color specifications consist of the "#" (hash) character and six digits from
the hexadecimal system, with each color represented by two digits.
R – Red
G – Green
B – Blue
#RRGGBB
Example:
color = "#ff0011"

16.7.6.4 Special XML syntax


Characters with special meanings in XML syntax have to be rewritten if they are to be
displayed correctly by a general XML editor.
The following characters are affected:

Character Notation in XML


< &lt;
> &gt;
& &amp;
" &quot;
' &apos;

16.7.6.5 Operators
The operation instruction processes the following operators:

Operator Meaning
= Assignment
== Equal to
<, &lt; Less than
>, &gt; Greater than
<=, &lt;= Less than or equal to
>=, &gt;= Greater than or equal to
| OR operation in bits
|| Logic OR operation
&, &amp; AND operation in bits
&&, &amp;&amp; Logic AND operation
+ Addition
- Subtraction
* Multiplication
/ Division
! Not
!= Not equal to

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 245
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Operation instructions are processed from left to right. It may make sense to place terms in
parentheses under certain circumstances in order to define the priority for executing
subterms.

16.7.7 Addressing components


Address identifiers for the desired data must be created to address NC variables, PLC
blocks or drive data. An address consists of the subpaths component name and variable
address. A slash should be used as a separating character.

16.7.7.1 PLC addressing


Addressing the PLC starts with the path section plc.

Table 16- 4 The following addresses are permissible:

DBx.DB(f) Data block


I(f)x Input
Q(f)x Output
M(f)x Bit memory
V(f)x Variable

DBx.DBXx.b Data block


Ix.b Input
Qx.b Output
Mx.b Bit memory
Vx.b Variable

Table 16- 5 Data format f:

B Byte
W Word
D Double word

Data format identification is not applicable to bit addressing.

Address x:
Valid S7-200 address identifier
Bit addressing:
b – Bit number
Examples:
<data name = "plc/mb170">1</data>
<data name = "i0.1"> 1 </data>
<op> "m19.2" = 1 </op>

Function Manual
246 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

16.7.7.2 NC variable addressing


Addressing the NC variables starts with the path section nck.
This section is followed by the data address; its structure should be taken from the
SINUMERIK 808D Parameter Manual.
Example:
<LET name = "tempStatus"></LET>
<OP> tempStatus ="nck/channel/state/chanstatus" </OP>

16.7.7.3 Addressing machine and setting data


Setting data is identified by the character $ followed by the name of the data.
Machine data:
$Mx_<name[index, AX<axis_number>]>
Setting data:
$Sx_<name[index, AX<axis_number>]>
x:
N – General machine or setting data
C – Channel-specific machine or setting data
A – Axis-specific machine or setting data
Index:
For a field, the parameter indicates the index of the data.
AX<axis_number>:
The required axis (<axis_number>) has to be specified for axis-specific data.
Alternatively, the axis index can be read from a local variable using $<variable name>
"substitution characters".
e.g. AX$localvariable
Example:
<DATA name ="$MN_AXCONF_MACHAX_NAME_TAB[0] ">X1</DATA>
Direct addressing of the axis:
<DATA name ="$MA_CTRLOUT_MODULE_NR[0, AX1] ">1</DATA>


Indirect addressing of the axis:
<LET name ="axisIndex"> 1 </LET>
<DATA name ="$MA_CTRLOUT_MODULE_NR[0, AX$axisIndex] ">1</DATA>

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 247
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

16.7.7.4 Addressing the user data


Addressing user data starts with the path section gud, followed by the GUD name.
For a field, after the name, the required field index should be specified in square brackets.
Example:
<DATA name ="gud/syg_rm[0]"
<OP>"gud/syg_rm[0]" 0 10 </op>

16.7.8 Generating user menus

16.7.8.1 Generating softkey menus and dialog forms


User menus can only be inserted if there is a main-menu tag with the name "main" in the
XML description. This tag is called by the system after the "CUSTOM" operating area has
been activated. Further menu branches and dialog-box activation can be defined within the
tag.

PHQXQDPH 0$,1!
23(1B)250QDPH PDLQGLDORJXH!
VRIWNH\326,7,21 !
FDSWLRQ!VXEPHQXFDSWLRQ!
QDYLJDWLRQ!VXEPHQXQDYLJDWLRQ!
VRIWNH\!
PDLQPHQX
VRIWNH\326,7,21 !
FDSWLRQ!VXEPHQXFDSWLRQ!
PDLQGLDORJXH
QDYLJDWLRQ!VXEPHQXQDYLJDWLRQ!
VRIWNH\!
VXEPHQX VXEPHQX
PHQX!

PHQXQDPH VXEPHQX! GLDORJXH GLDORJXH


23(1B)250QDPH GLDORJXH!
PHQX!

PHQXQDPH VXEPHQX!
23(1B)250QDPH GLDORJXHಯ!
PHQX!

Function Manual
248 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


FORM This tag contains the description of a user dialog.
Attributes:
 color

Background color of the dialog box (color coding, see Chapter, color coding)
 name

Identifier of the form


 xpos

X-position of the top left corner of the dialog box (optional)


 ypos

Y position of the top left corner (optional)


 width

Extension in the X direction (in pixels) (optional)


 height

Extension in the Y direction (in pixels) (optional)


Dialog messages:
 INIT
 PAINT
 TIMER
 CLOSE
 FOCUS_IN
FORM continued Syntax:
<FORM name = "<dialog name>" color = "#ff0000">
Example:
<FORM name = "R-Parameter">
<INIT>
<DATA_ACCESS type = "true" />
<CAPTION>R - Parameter</CAPTION>
<CONTROL name = "edit1" xpos = "322" ypos = "34" refvar =
"nck/Channel/Parameter/R[1]" />
<CONTROL name = "edit2" xpos = "322" ypos = "54" refvar =
"nck/Channel/Parameter/R[2]" />
<CONTROL name = "edit3" xpos = "322" ypos = "74"
</INIT>

<PAINT>
<TEXT xpos = "23" ypos = "34">R - Parameter 1</TEXT>
<TEXT xpos = "23" ypos = "54">R - Parameter 2</TEXT>
<TEXT xpos = "23" ypos = "74">R - Parameter 3</TEXT>

</PAINT>

</FORM>

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 249
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


INIT Dialog box message
The tag is executed immediately after the dialog box is generated. All the input elements
and hotlinks for the dialog form should be created here.
FOCUS_IN Dialog box message
The tag is called if the system places the focus on a control. In order to identify the control,
the system copies the name of the control to variable $focus_nameand the value of the
attribute item_data to variable $focus_item_data. The system creates the variables
automatically.
This message can be used, for example, to output images depending on the focus position.
Example:
<focus_in>
<PRINT text="focus on filed:%s, %d">$focus_name,
$focus_item_data </PRINT>
</focus_in>
PAINT Dialog box message
The tag is executed when the dialog box is displayed. All the texts and images which are to
be displayed in the dialog box should be specified here.
Further, the tag is executed if the system identifies that parts of the dialog box are to be
redisplayed. For example, this can be initiated by closing high-level windows.
TIMER Dialog box message
The tag is executed cyclically.
Each form is assigned a timer that initiates that the timer - tag is executed approx. every 100
ms.
CAPTION The tag contains the title of the dialog box.
This tag should be used within the INIT tag.
Syntax:
<CAPTION>Titel</CAPTION>
Example:
<CAPTION>my first dialogue</CAPTION>
CLOSE Dialog box message
This tag is executed before the dialog box is closed.
CLOSE_FORM The tag closes the active dialog.
This instruction is only necessary if it involves a cycle dialog that is used in the program
editor area. Generally, dialogs are automatically managed and do not have to be explicitly
closed.
Syntax:
<CLOSE_FORM/>
Example:
<softkey_ok>
<caption>OK</caption>
<CLOSE_FORM />
<navigation>main_menu</navigation>
</softkey_ok>

Function Manual
250 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


CONTROL The tag is used to generate control elements.
Syntax:
<CONTROL name = "<control name>" xpos = "<X position>" ypos = "<Y
position>" refvar = "<NC variable>" hotlink = "true" format =
"<format>" />
Attributes:
 name

Identifier of the field.

The identifier simultaneously represents a local variable, and must not be used a
multiple number of times in the form.
 xpos

X position of the top left corner


 ypos
Y position of the top left corner
 fieldtype

Field type

If no type is specified, the field is set as an edit field.


– edit
Data can be changed
– readonly
Data cannot be changed

combobox

The field displays the corresponding identifiers instead of numerical values.

If the field type "combobox" is selected, then the expressions to be displayed must
also be assigned to the field.

The <ITEM> TAG should be used for this purpose.

The combo box saves the index of the currently selected text in the variable
belonging to the control (see the attribute refvar).
– progressbar
A progress bar with a value range of 0 to 100 appears.

The valley value and peak value properties can be used to adapt the value range to
the data to be displayed.

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 251
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


CONTROL continued  fieldtype
– listbox
The field type generates an empty list box control.

Using the tag <ITEM> a list box element can be inserted in the list box.

The ITEM attribute value allows this element to be assigned a unique value.

For example, this can be used to identify the element.

Parameters width and height specify the width and height of the list box.

After the control has been created, additional list box elements can be inserted using
the functions AddItem, InsertItem or LoadItem.
– graphicbox
The field type generates a 2d broken line graphic control.

Using the tag <ITEM> a graphic element can be inserted into the control.

Parameters width and height specify the width and height of the box.

Note: This control is not linked into the clipping.

This means that other elements can cover this control.

After the control has been created, additional elements can be inserted using the
functions AddItem or InsertItem. The parameter itemdata is not evaluated for this
control.
– itemlist
The field type generates a static control, which displays the corresponding identifier
instead of numerical values.

The <ITEM> tag can be used to assign an identifier to the field.


 item_data

A user-specific integer value can be assigned to the attribute. This value is given as part
of the FOCUS_IN message for identifying the focus field.
 refvar

Identifier of the reference variable that can be linked to the field (optional).
 hotlink = "TRUE" " If the value of the reference variable changes, then the field is
automatically updated (optional).
 format

The attribute defines the display format of the specified variable.

Formatting data, see print-Tag (optional).

Function Manual
252 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


CONTROL continued Attributes:
 time

specifies the data refresh rate (optional).

The following specifications are possible:


– super fast
Refresh time < 100 ms
– fast
Refresh time approx. 100 ms
– normal
Refresh time approx. 200 ms
– slow
Refresh time approx. 500 ms
 font

The attribute defines the font size used.


– 0: 8*8
– 1: 16*8
– 2: 24*16 (only numbers)
– 3: 8*8 double the character height
– 4: 16*8 double the character height
– 5: 24*16 double the character height (only numbers)
 color_bk

The attribute sets the background color of the control.


 color_fg

The attribute sets the foreground color of the control.

("color coding" see Section "Color coding (Page 245)")


 display_format

The attribute defines the processing format of the specified variable. This attribute must
be used when accessing a PLC float variable, as the access is realized by reading a
double word.

The following data formats are permitted:


– FLOAT
– INT
– DOUBLE
– STRING
Assigning expressions (e.g. text or graphic element to be displayed) to a list box, graphics
box or combo box:
Syntax:
<ITEM>Expression</ITEM>
<ITEM value ="<Value>">Expression</ITEM>

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 253
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


CONTROL continued Example:
<CONTROL name = "button1" xpos = "10" ypos = "10" fieldtype = "
combobox ">
<ITEM>text1</ITEM>
<ITEM>text2</ITEM>
<ITEM>text3</ITEM>
<ITEM>text4</ITEM>
</CONTROL>
If any integer value is to be assigned to an expression, the attribute value = "value" should
be added to the tag.
Rather than consecutive numbers, the control variable now contains the item's assigned
value.
Example:
<CONTROL name = "button1" xpos = "10" ypos = "10" fieldtype = "
combobox ">
<ITEM value = "10">text1</ITEM>
<ITEM value = "20">text2</ITEM>
<ITEM value = "12">text3</ITEM>
<ITEM value = "1">text4</ITEM>
</CONTROL>
Example of a progress bar:
<CONTROL name = "progress1" xpos = "10" ypos = "10" width = "100"
fieldtype = "progressbar" hotlink = "true" refvar =
"nck/Channel/GeometricAxis/actProgPos[1]">
<PROPERTY min = "0" />
<PROPERTY max = "1000" />
</CONTROL>
Example, list box:
<let name="item_string" type="string"></let>
<let name="item_data" ></let>

<CONTROL name="listbox1" xpos = "360" ypos="150" width="200"


height="200" fieldtype="listbox" />
 Adding elements:

Elements are added using the function additem or loaditem.


 Deleting the content:

The content is deleted using the function empty.

<op> item_string = _T"text1\\n" </op>


<function name="control.additem">_T"listbox1", item_string,
item_data </function>
<op> item_string = _T"text2\\n" </op>
<function name="control.additem">_T"listbox1", item_string,
item_data </function>

Function Manual
254 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


CONTROL continued Example, graphic box:
<CONTROL name= "graphic" xpos = "8" ypos="23" width="300"
height="352" fieldtype="graphicbox" />
 Adding elements:

Elements are added using the function additem or loaditem.

The following 2d elements can be used:


– Line - l(inc)
– Circle sector - c(ircle)
– Point - p(oint)
Structure of an element:
<Element type>; coordinates
 Line:

l; xs; ys; xe, ye

I - line marking

Xs - X start position

Ys - Y start position

Xe - X end position

Ye - Y end position
 Circle:

C, xs, ys, xe, ye, cc_x, cc_y, r

C - circular sector marking

Xs - X start position

Ys - Y start position

Xe - X end position

Ye - Y end position

Cc_x – X coordinate, circle center point

CC_y – Y coordinate circle center point


 Radius:

R
 Point:

P, x, y

P - point marking

X - X position

Y - Y position
 Deleting the graphic:

The content is deleted using the function empty.

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 255
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


CONTROL continued Example:
<let name="item_string" type="string"></let>
<let name="s_z" type="double">100</let>
<let name="s_x" type="double">50</let>
<let name="itemdata"></let>


<control name= "gbox" xpos = "6" ypos="24" width="328" height="356"
fieldtype="graphicbox" />


<print name ="item_string" text="p; %f; %f">s_z, s_x</print>
<function name="control.additem">_T"gbox", item_string,
itemdata</function>

Example itemlist:
<CONTROL name = "itemlist1" xpos = "10" ypos = "10" fieldtype = "
itemlist">
<ITEM value = "10">text1</ITEM>
<ITEM value = "20">text2</ITEM>
<ITEM value = "12">text3</ITEM>
<ITEM value = "1">text4</ITEM>
</CONTROL>
HELP_CONTEXT This tag defines the help topic to be called. It should be programmed in the INIT block.
The name specified in the attribute is supplemented by the prefix XmlUserDlg_ and is
transferred to the help system. The associated structure of the help file should be taken
from the topic - generating an online help.
Sequence when activating the help system:
1. Press the "Info" key.
2. The dialog supplies the expression "my_dlg_help".
3. Parser converts the expression into "XmlUserDlg_my_dlg_help" .
4. Activating the help system.
5. Submitting the search term "XmlUserDlg_my_dlg_help".
Syntax:
<HELP_CONTEXT name="<context name>" />
Example:
...
<INIT>
...
<CAPTION>my dialogue</CAPTION>
<HELP_CONTEXT name="my_dlg_help" />
...
</INIT>

Function Manual
256 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


DATA_ACCESS The tag controls the behavior of the dialog forms when user inputs are being saved.
The behavior should be defined within the INIT tag.
If the tag is not used, inputs are buffered in each case.
Exception: The attribute hotlink is set to true .
Attribute::
 type = "TRUE" – the input values are not buffered. The dialog form copies the input
values to the reference variables directly.
 type = "FALSE" – the values are only copied to the reference variable with the
UPDATA_DATA type = "FALSE" tag.
Example:
<DATA_ACCESS type = "true" />
MENU The tag defines a menu containing the softkey description and the dialog to be opened.
Attribute::
 name

Menu name
Syntax:
<MENU name = "<menu name>">

<open_form …>

<SOFTKEY …>
</SOFTKEY>
</MENU>
NAVIGATION This tag defines the menu to be called. This tag can only be set within a softkey block.
Syntax:
<NAVIGATION>menu name</NAVIGATION>
Example:
<menu name = "main">
<softkey POSITION="1">
<caption>sec. form</caption>
<navigation>sec_menu</navigation>
</softkey>
</menu>

<menu name = "sec_menu">


<open_form name = "sec_form" />
<softkey_back>
<navigation>main</navigation>
</softkey_back>
</menu>

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 257
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


OPEN_FORM The tag opens the dialog form given under the name.
Attribute::
 name

Name of the dialog form


Syntax:
<OPEN_FORM name = "<form name>" />
Example:
<menu name = "main">
<open_form name = "main_form" />
<softkey POSITION="1">
<caption>main form</caption>
<navigation>main</navigation>
</softkey>
</menu>

<form name="main_form">
<init>
</init>

<paint>
</paint>

</form>
PROPERTY This tag can be used to define additional properties for an operator control.
Attributes:
 max= "<maximum value>"
 min= "<minimum value>"
 default = "<pre-assignment>"
 factor = "conversion factor"
 color_bk= "<background color coding>"
 color_fg= "<font color coding>"
 font = "<Font number>"
 password = "<true>" - entered character is displayed with "*"
 multiline = "<true>" - permits multi-line inputs in an edit control
 disable = "<true/false>" - locks/permits the input in an edit control
Example:
<CONTROL name = "progress1" xpos = "10" ypos = "10" width = "100"
fieldtype = "progressbar" hotlink = "true" refvar =
"nck/Channel/GeometricAxis/actProgPos[1]">
<PROPERTY min = "0" />
<PROPERTY max = "1000" />
</CONTROL>
<CONTROL name = "edit1" xpos = "10" ypos = "10">
<PROPERTY min = "20" />
<PROPERTY max = "40" />
<PROPERTY default = "25" />
</CONTROL>

Function Manual
258 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


SOFTKEY The tag defines the properties and responses of a softkey.
Attributes:
 position

Number of the softkey. 1-8 horizontal softkeys, 9-16 vertical softkeys

The following additional actions can be defined within the softkey block:
 caption
 navigation
 update_controls
 function
Syntax:
<softkey position = "<1>">


</softkey>
TEXT The tag is used to display a text in the specified position.
If an alarm number is used, the dialog box displays the text which is saved for the number.
Syntax:
<TEXT xpos = "<X position>" ypos = "<Y position>"> Text </TEXT>
Attributes:
 xpos

X position of the top left corner


 ypos

Y position of the top left corner


 color

Text color (color coding)


Value:
Text to be displayed

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 259
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


IMG The tag is used to display an image in the specified position. The BMP and PNG image
formats are supported.
Syntax:
<IMG xpos = "<X position>" ypos = "<Y position>" name = "<name>" />
Attributes:
 xpos

X position of the top left corner


 ypos

Y position of the top left corner


 name

complete path name


 transparent

Transparent color of the bitmap (see Chapter "Color coding")


Optional:
If the image display is to differ from the original size, the dimensions can be defined using
the attributes width and height.
 width

Width in pixels
 height

Height in pixels
Examples:
<IMG xpos = "20" ypos = "40" name = "f:/appl/test.bmp" />
<IMG xpos = "5" ypos = "23" name = "f:/appl/test.bmp" height =
"355" width = "550"/>
BOX The tag draws a rectangle at the specified position, colored as indicated.
Syntax:
<BOX xpos = "<X position>" ypos = "<Y position>" width = "<X
extension>" height = "<Y extension>" color = "<Color code>" />
Attributes:
 xpos

X position of the top left corner


 ypos

Y position of the top left corner


 width

Extension in X direction (in pixels)


 height

Extension in Y direction (in pixels)


 color

Color coding (for details on color coding, see chapter, Color coding)

Function Manual
260 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


FUNCTION Function call
The tag executes the function body, which is specified under the attribute "name.
Attributes:
 name= "Name of the function body"
 return = "Variable name for saving the result of the function"
Values:
List of variables to be transferred to the function body. The variables must be separated by
a comma. A maximum of 10 parameters can be transferred.
It is also possible to specify constants or text expressions as call parameters. The identifier
_T should be placed at the start as a means of identifying text terms.
Syntax:
<FUNCTION name = "<function name>" />
Calling function expects a return value
<FUNCTION name = "<function name>" return = "<Variablenname>" />
Parameter transfer
<FUNCTION name = "<function name>"> var1, var2, var3 </FUNCTION>
<FUNCTION name = "<function name>"> _T"Text", 1.0, 1 </FUNCTION>
Examples:
See "FUNCTION_BODY".

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 261
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


FUNCTION_BODY Function body
The tag contains the function body of a subfunction. The function body needs to be
programmed within the DialogGui tag.
Attributes:
 name = "Name of the function body"
 parameter = "Parameter list" (optional)

The attribute lists the transfer parameters that are required. The parameters must be
separated by a comma.

When the function body is called, the values of the parameters specified in the function
call are copied to the transfer parameters listed.
 return = "true"

If the attribute is set to true then the local variable $return is created. The function's
return value which is forwarded to the calling function on quitting the function should be
copied to this variable.
Syntax:
Function body without parameter
<FUNCTION_BODY name = "<function name>">



</ FUNCTION_BODY>
Function body with parameter
<FUNCTION_BODY name = "<function_name>" parameter = "<p1, p2, p3>">

<LET name = "tmp></LET>
<OP> tmp = p1 </OP>

</FUNCTION_BODY>
Function body with return value
<FUNCTION_BODY name = "<function_name>" parameter = "<p1, p2, p3>"
return = "true">

<LET name = "tmp></LET>
<OP> tmp = p1 </OP>

<OP> $return = tmp </OP>
</FUNCTION_BODY>

Function Manual
262 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Tag identifier Meaning


FUNCTION_BODY Example:
continued <function_body name = "test" parameter = "c1,c2,c3" return = "true">
<LET name = "tmp">0</LET>
<OP> tmp = c1+c2+c3 </OP>
<OP> $return = tmp </OP>
</function_body>



<LET name = "my_var"> 4 </LET>
<function name = "test" return = " my_var "> 2, 3,4</function>
<print text = "result = %d"> my_var </print>


REQUEST The tag is used to add a variable to the cyclic reading service (hotlink). As a consequence,
the access time to variables, which are not linked to the control, is reduced.
If a function is to be called automatically when a value changes, then the name of the
function should be specified as an additional attribute
This tag is only processed within the INIT operation.
Attribut:e:
 name

Address identifier
Syntax:
<REQUEST name = "<NC-Variable>" />
UPDATE_CONTROLS The tag runs a comparison between the operator controls and the reference variables.
Attribute::
 type

The attribute defines the direction of the data comparison.

= TRUE – data is read from the reference variables and copied to the operator controls.

= FALSE – Data is copied from the operator controls to the reference variables.
Syntax:
<UPDATE_CONTROLS type = "<Direction>"/>
Example:
<SOFTKEY_OK>
< UPDATE_CONTROLS type="false"/>
</SOFTKEY_OK>

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 263
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

16.7.8.2 Substitution characters


The system offers the option of defining control properties (attribute values) for the runtime.
In order to use this function, the desired property must be set in a local variable and the
variable name must be transferred to the tag as an attribute value preceded by the character
$.
If the tag expects a string as attribute value or value, the $$$ characters must be placed in
front of the variable name.
Example:
<let name="my_ypos">100</let>
<let name="field_name" type="string"></let>

<control name = "edit1" xpos = "322" ypos = "$my_ypos"


refvar="nck/Channel/Parameter/R[1]" />

<op>my_ypos = my_ypos +20 </op>

<control name = "edit2" xpos = "322" ypos = "$my_ypos"


refvar="nck/Channel/Parameter/R[2]" />

<print name =" field_name" text="edit%d">3</print>


<op>my_ypos = my_ypos +20 </op>

<control name = "$field_name" xpos = "322" ypos = "$my_ypos"


refvar="nck/Channel/Parameter/R3]" />

<caption>$$$field_name</caption>

Function Manual
264 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

16.7.9 Predefined functions


The script language offers various string processing and standard mathematical functions.
The function names listed below are reserved and cannot be overloaded.

Function name Meaning


String.cmp Two strings are compared with one another from a lexicographical
perspective.
The function gives a return value of zero if the strings are the same,
a value less than zero if the first string is smaller than the second
string or a value greater than zero if the second string is smaller then
the first string.
Parameter:
str1 - string
str2 - comparison string
Syntax:
<function name="string.cmp" return ="<int var>" >
str1, str2 </function>
Example:
<let name="rval">0</let>
<let name="str1" type="string">A brown bear hunts a
brown dog.</let>
<let name="str2" type="string">A brown bear hunts a
brown dog.</let>

<function name="string.cmp" return="rval"> str1,


str2 </function>
Result:
rval= 0

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 265
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Function name Meaning


String.icmp Two strings are compared from a lexicographical perspective (the
comparison is not case-sensitive).
The function gives a return value of zero if the strings are the same,
a value less than zero if the first string is smaller than the second
string or a value greater than zero if the second string is smaller then
the first string.
Parameter:
str1 - string
str2 - Comparison string
Syntax:
<function name="string.icmp" return ="<int var>" >
str1, str2 </function>
Example:
<let name="rval">0</let>

<let name="str1" type="string">A brown bear hunts a


brown dog.</let>
<let name="str2" type="string">A brown Bear hunts a
brown Dog.</let>
<function name="string. icmp" return="rval"> str1,
str2 </function>
Result:
rval= 0
String left The function extracts the first nCount character from string 1 and
copies this to the return variable.
Parameter:
str1 - String
nCount - Number of characters
Syntax:
<function name="string.left" return="<result
string>"> str1, nCount </function>
Example:
<let name="str1" type="string">A brown bear hunts a
brown dog.</let>
<let name="str2" type="string"></let>

<function name="string. left" return="str2"> str1,


12 </function>
Result:
str2="A brown bear"

Function Manual
266 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Function name Meaning


String.right The function extracts the last nCount character from string 1 and
copies this to the return variable.
Parameter:
str1 - String
nCount - Number of characters
Syntax:
<function name="string.right" return="<result
string>"> str1, nCount </function>

Example:
<let name="str1" type="string">A brown bear hunts a
brown dog.</let>
<let name="str2" type="string"></let

<function name="string. right " return="str2">


str1, 10 </function>
Result:
str2="brown dog."
String middle The function extracts the specified number of characters from string
1, starting from the iFirst index, and copies these to the return
variable.
Parameter:
str1 - string
iFirst - start index
nCount - number of characters
Syntax:
<function name="string.middle" return="<result
string>"> str1, iFirst, nCount </function>
Example:
<let name="str1" type="string">A brown bear hunts a
brown dog.</let>
<let name="str2" type="string"></let

<function name="string. middle " return="str2">


str1, 2, 5 </function>
Result:
str2="brown"

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 267
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Function name Meaning


String.length The function gives the number of characters in a string.
Parameter:
str1 - string
Syntax:
<function name="string.length" return="<int var>">
str1 </function>
Example:
<let name="length">0</let>

<let name="str1" type="string">A brown bear hunts a


brown dog.</let>
<function name="string.length" return="length">
str1 </function>
Result:
length = 31
Strings.replace The function replaces all the substrings found with the new string.
Parameter:
string - string variable
find string - string to be replaced
new string - new string
Syntax:
<function name="<string.replace>"> string, find
string, new string </function>
Example:
<let name="str1" type="string">A brown bear hunts a
brown dog. </let>

<function name="string.replace" > str1, _T"a brown


dog" , _T"a big salmon"</function>
Result:
str1 = "A brown bear hunts a big salmon!"
String.remove The function removes all the substrings found.
Parameter:
string - string variable
remove string - substring to be deleted
Syntax:
<function name="string.remove"> string, remove
string </function>
Example:
<let name="index">0</let>

<let name="str1" type="string">A brown bear hunts a


brown dog. </let>
<function name="string.remove" > str1, _T"a brown
dog" </function
Result:
str1 = "A brown bear hunts"

Function Manual
268 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Function name Meaning


Strings.insert The function inserts a string at the index specified.
Parameter:
string - string variable
index - index (zero based)
insert string - string to be inserted
Syntax:
<function name="string.insert"> string, index,
insert string </function>
Example:
<let name="str1" type="string">A brown bear hunts.
</let>
<let name="str2" type="string">a brown dog</let>

<function name="string.insert" > str1, 19,


str2</function>
Result:
str1 = "A brown bear hunts a brown dog"
String delete The function deletes the defined number of characters starting from
the start position specified.
Parameter:
string - string variable
start index - start index (zero based)
nCount - number of characters to be deleted

Syntax:
<function name="string.delete"> string, start index
, nCount </function>

Example:
<let name="str1" type="string">A brown bear hunts.
</let>

<function name="string.delete" > str1, 2,


5</function>
Result:
str1 = "A bear hunts"

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 269
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Function name Meaning


String.find The function searches the transferred string for the first match with
the substring.
If the substring is found, the function provides the index to the first
character (starting with zero) or, failing this, -1.
Parameter:
string - string variable
findstring - string to be found
Syntax:
<function name="string.find" return="<int val>">
str1, find string </function>
Example:
<let name="index">0</let>
<let name="str1" type="string">A brown bear hunts a
brown dog. </let>
<function name="string.find" return="index"> str1,
_T"brown" </function>
Result:
Index = 2
String.reversefind The function searches the transferred string for the last match with
the substring.
If the substring is found, the function provides the index to the first
character (starting with zero) or, failing this, -1.
Parameter:
string - string variable
find string - string to be found
Syntax:
<function name="string.reversefind" return="<int
val>"> str1, find string </function>
Example:
<let name="index">0</let>
<let name="str1" type="string">A brown bear hunts a
brown dog. </let>
<function name="string.reversefind" return="index">
str1, _T"brown" </function>
Result:
Index = 21
String.trimleft The function trims the starting characters from a string.
Parameter:
str1 - string variable
Syntax:
<function name="string.trimleft" > str1 </function>
Example:
<let name="str1" type="string"> test trim
left</let>
<function name="string.trimleft" > str1 </function>
Result:
str1 = "test trim left"

Function Manual
270 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Function name Meaning


String.trimright The function trims the closing characters from a string.
Parameter:
str1 - string variable
Syntax:
<function name="string.trimright" > str1
</function>
Example:
<let name="str1" type="string"> test trim right
</let>
<function name="string.trimright" > str1
</function>
Result:
str1 = "test trim right"
sin The function calculates the sine of the value transferred in degrees.
Parameter:
double - angle
Syntax:
<function name="sin" return="<double val>"> double
</function>
Example:
<let name= "sin_val" type="double"></let>
<function name="sin" return="sin_val"> 20.0
</function>
cos The function calculates the cosine of the value transferred in
degrees.
Parameter:
double - angle
Syntax:
<function name="cos" return="<double val>"> double
</function>
Example:
<let name= "cos_val" type="double"></let>
<function name="cos" return="cos_val"> 20.0
</function>
tan The function calculates the tangent of the value transferred in
degrees.
Parameter:
double - angle
Syntax:
<function name="tan" return="<double val>"> double
</function>
Example:
<let name= "tan_val" type="double"></let>
<function name="tan" return="tan_val"> 20.0
</function>

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 271
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Function name Meaning


arcsin The function calculates the arcsine of the value transferred in
degrees.
Parameter:
double - x in the range from -PI/2 to +PI/2
Syntax:
<function name="arcsin" return="<double val>">
double </function>
Example:
<let name= "arcsin_val" type="double"></let>
<function name="arcsin" return=" arcsin_val"> 20.0
</function>
arccos The function calculates the arccosine of the value transferred in
degrees.
Parameter:
double - x in the range from -PI/2 to +PI/2
Syntax:
<function name="arcos" return="<double val>">
double </function>
Example:
<let name= "arccos_val" type="double"></let>
<function name="arccos" return=" arccos_val"> 20.0
</function>
arctan The function calculates the arctan of the value transferred in
degrees.
Parameter:
double - arctan of y/x
Syntax:
<function name="arctan" return="<double val>">
double </function>
Example:
<let name= "arctan_val" type="double"></let>
<function name="arctan" return="arctan_val"> 20.0
</function>
dll.load The function loads an additional user DLL to the memory.
Parameter:
dll_name - DLL name
class_name - name of the function class
Syntax:
<function name="dll.load"> dll_name, class_name
</function>
Example:
<function name="dll.load"> _T"customer.dll",
_T"customer" </function>

Function Manual
272 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Function name Meaning


dll.function The function calls a function from a user DLL. All parameters listed
after the parameter ID are transferred to the function called.
Parameter:
class_name - name of the function class
id - of the function
parameter - maximum seven function parameters (string variables)
Syntax:
<function name="dll.function"> class_name, id,
parameter1, parameter2</function>
Example
<function name="dll.function"> _T"customer", 290,
_T"par1", _T"par2"</function>
File processing
doc.readfromfile The function loads the contents of the file specified to a string
variable.
Attribute:
Return - name of the local variable
Parameter:
Progname - file name
Syntax:
<function name="doc.readfromfile" return="<string
var>"> progname </function>
Example:
<let name = "my_var" type="string" ></let>

<function name=" doc.readfromfile "


return="my_var"> _T"\spf\test.mpf" </function>
doc.writetofile The function writes the contents of a string variable to the file
specified.
Parameter:
progname - file name
str1 - string
Syntax:
<function name="doc.writetofile" > progname, str1
</function>
Example:
<let name = "my_var" type="string" > file content
</let>

<function name="doc.writetofile">_T"\spf\test.mpf",
my_var </function>

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 273
Special functions
16.7 Generating user dialogs using customized EasyXLanguage scripts

Function name Meaning


doc.remove The function removes the file specified from the directory.
Parameter:
progname - file name
Syntax:
<function name="doc.remove" > progname </function>
Example:
<function name="doc.remove">_T"\mpf\test.mpf"
</function>
doc.exist If the file exists, the function returns the value 1.
Parameter:
progname - file name
Syntax:
<function name="doc.exist" return="<int_var>" >
progname </function>
Example:
<let name ="exist">0</let>

<function name="doc.exist"
return="exist">_T"\mpf\test.mpf" </function>
ncfunc.select The function selects the program specified for execution. The
program must be stored in the NC file system.
Parameter:
progname - file name
Syntax:
<function name="ncfunc.select"> progname
</function>
Example:
<function name="ncfunc.select"> _T"\mpf\test.mpf"
</function>

Function Manual
274 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Licensing in SINUMERIK 808D 17
17.1 Licensing in SINUMERIK 808D

SINUMERIK 808D licensing


The PPU software on the CNC PPU has already been licensed in the factory before delivery.
Depending on specific requirements, factory licensing is available for the following machining
types:
● SINUMERIK 808D Turning
● SINUMERIK 808D Milling
You can also purchase the optional "Manual Machine Plus" and "Additional Axis" functions
for the SINUMERIK 808D Turning. You must activate these two functions on the control
system via the HMI user interface.

Note
You can obtain subsequent licenses from the Web License Manager
(http://www.siemens.com/automation/license).

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 275
Licensing in SINUMERIK 808D
17.2 Web License Manager

17.2 Web License Manager

17.2.1 Web License Manager


With the Web License Manager (http://www.siemens.com/automation/license) , you can
assign licenses to hardware in a standard Web browser. To conclude the assignment, you
must manually enter the License Key at the control system through the HMI user interface.

17.2.2 Assigning licenses

Requirements
The following prerequisites must be met in order to assign a license to a piece of hardware
via direct access and HMI user interface:
● The control system is powered up.
● The login data for direct access (e.g. per CoL) is available:
– License number
– Dispatch note number
● Type of the control system
● "CF card serial number" from the CompactFlash Card system

Operating sequences
1. In the "SYSTEM" operating area, press "Serv. displ." > "Version" > "License key" to find
the "CF card serial number".

Function Manual
276 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Licensing in SINUMERIK 808D
17.2 Web License Manager

Note
Ensure that the "CF card serial number" displayed is also really the one you want to make
the assignment for. The assignment of a license to a piece of hardware cannot be
reversed via the Web License Manager.

2. Go to the Web License Manager (http://www.siemens.com/automation/license):


3. Login via "Direct access":
– License number
– Dispatch note number
4. In the Web License Manager, follow the instructions and operate step by step.
5. At the end of the process, the Web License Manager shows the license key.
The following options are now available:
– Note down the key.
– Save it in a PDF file.
6. After completing the assignment process, enter the License Key displayed on the Web
License Manager into the licensing dialog of the HMI user interface (In the "SYSTEM"
operating area, press "Serv. displ." > "Version" > "License key".)

7. Press the "OK" softkey to confirm the entry for the new license key.
8. Activate the optional functions Manual Machine Plus and Additional Axis.

Note
For detailed information about activating the optional functions, refer to section "Activating
the optional functions (Page 278)".

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 277
Licensing in SINUMERIK 808D
17.3 Activating the optional functions

17.3 Activating the optional functions


To activate the optional Manual Machine Plus and Additional Axis functions for the turning
variant of the SINUMERIK 808D, proceed as follows:
1. In the "SYSTEM" operating area, press "Serv. displ." > "Version". It displays as follows
(example):

2. Press "Options". If you have activated the Additional Axis function by entering the licence
key, the value of the Licensed column is 1. Then you can set the Set column to 0 or 1,
which respectively indicates that 0 or 1 additional axis is set.

After you assign one additional axis and set the relevant MD correctly (see the note
below), the additional axis name can be seen in some operating areas. For example, the
"MACHINE" operating area will be shown as follows:

Function Manual
278 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Licensing in SINUMERIK 808D
17.3 Activating the optional functions

Or, press <SELECT> to select the software option Manual Machine Plus.

3. Press "NCK reset (po)". A warm restart is triggered on the control system. After system
restart, the corresponding software function is active in the control system.

Note
If either of the two options is not licensed, the alarm 8081 "1 option(s) that has (have) not
been licensed using a license key was (were) set" appears on the screen. Enter the valid
license; otherwise, you cannot operate the machine normally.
To use the additional axis function after activating it, set the following MDs first:
 MD10000[1]: Change "Y" to another symbol except capital letter C, for example, "MC".
 MD20070[3]: Change "0" to "2".
 MD20080[3]: Set the value to "C".
 When necessary, set the following MDs , wherein MD30300 determines whether the
additional axis is used as a rotary or linear axis.
– MD30300
– MD30310
– MD30320

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 279
Licensing in SINUMERIK 808D
17.4 Internet links

17.4 Internet links


Overview of Internet links used:

No. Topic Address


1 Web License Manager http://www.siemens.com/automation/license
2 Siemens A&D Mall: Customer login http://mall.automation.siemens.com
3 Download server http://software-download.automation.siemens.com

17.5 Important licensing terms


The terms below are important and helpful for you to understand the license management of
SINUMERIK software products.

Term Description
Software product "Software product" is generally used to describe a product that is installed on a piece of
hardware to process data. Within the license management of SINUMERIK software products,
a corresponding license is required to use each software product.
Hardware In the context of the license management of SINUMERIK software products, "hardware"
refers to the component of a SINUMERIK control system to which licenses are assigned on
the basis of its unique identifier. License information is also saved to the retentive memory on
this component.
 SINUMERIK 808D: CompactFlash Card system
License A license gives the user a legal right to use the software product. Evidence of this right is
provided by the following:
 CoL (Certificate of License)
 License key
CoL The CoL is the proof of the license. The product may only be used by the holder of the
(Certificate of License) license or authorized persons. The CoL includes the following data relevant for the license
management:
 Product name
 License number
 Delivery note number
 Hardware serial number
Note:
The hardware serial number is only found on a system software CoL or is only available if a
bundled license was ordered, in other words, the system software included options.
License number The license number is the feature of a license that is used for its unique identification.
CompactFlash Card The CompactFlash Card system represents, as the carrier of all the retentive data of a
system SINUMERIK solution line control system, the identity of this control system. The
CompactFlash Card system includes the following data that is of relevance to license
management:
 Hardware serial number
 License information including the License Key

Function Manual
280 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Licensing in SINUMERIK 808D
17.5 Important licensing terms

Term Description
Hardware serial number The hardware serial number is a permanent part of the CompactFlash Card system. It is used
to identify a control system uniquely. The hardware serial number can be determined by:
 CoL (see: Certificate of License > "Note")
 HMI user interface ("SYSTEM" operating area > "Serv. displ." > "Version" > "License
key")
 Printing on the CompactFlash Card system
License key The License Key is the "technical representative" of the sum of all the licenses that are
assigned to one particular piece of hardware, which is uniquely marked by its hardware serial
number.
Option One option is a SINUMERIK software product that is not contained in the basic version and
which requires the purchase of a license for its use.
Product A product is marked by the data below within the license management of SINUMERIK
software products:
 Product designation
 Order number:
 License number

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 281
Licensing in SINUMERIK 808D
17.5 Important licensing terms

Function Manual
282 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Index

D
A D functions, 200
Acceleration, 59 Dry run feedrate, 112
Acceleration profiles, 55
Abrupt acceleration changes, 55
Acceleration with jerk limitation, 55 E
activate the optional function, 278 EMERGENCY STOP
Approaching a fixed point Acknowledgment, 145
in JOG, 66 Interface, 144
With G75, 66 Sequence, 144
assign a license, 276 EMERGENCY STOP pushbutton, 143
ASUB Eventcontrolled program sequences
Initializing, 24 Operator panel reset,
Start, 105 Part program start and part program end,
Auxiliary function output Exact stop, 46
Block change, 77 Exact-stop criteria, 47
Block search, 80
Auxiliary functions, 75
Axis monitoring functions F
Actual velocity, 38
Clamping, 36 Feed disable, 194
Position monitoring, 33 Feedrate override, 59
Speed setpoint, 37 Feedrate override switch, 195
Standstill, 35 Feedrate/spindle stop, 194
Axisrelated jerk limitation, Feedrates
Axis-specific feedrate override, 196
Feed disable, 194
B Feed override, 195
Feedrate control, 193
Backlash compensation, 125 Feedrate/spindle stop, 194
Block search, 80, 113 Path feedrate F, 187
Spindle override, 196
Tapping with compensation chuck G63, 191
C Thread cutting G33, 189
CF card, 280 Fixed point positions, 69
Channel, 85 Following block velocity, 53
Channel status, 96
CoL, 280
Commands MEAS, MEAW, 136 G
Compensation table, 129 Grouping auxiliary functions, 78
Configuration file, 229
Continuous travel, 61
Contour violation, 41 H
Cyclic signal exchange, 14
Hand wheel
Traversal in JOG, 63

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 283
Index

Traversing the axes, 57 P


Hardware, 280
Part program interruption, 93
Hardware limit switches, 60
Path axes, 45
Hardware serial number, 281
Path feedrate F, 187
Alarms, 188
Feedrate for G63 (tapping with compensation
I
chuck), 191
Implicit exact stop, 48 Feedrate with G33 (thread cutting), 189
Incremental travel, 62 Pathrelated jerk limitation,
Internet links used, 280 Plausibility check, 157
Interpolator end, 47 PLC service display, 137
Interpolatory compensation PLC/NCK interface, 13
Compensation table, 127 Position controller gain, 34
Linear interpolation, 128 Position display, 125
Positioning window, 34
Probe, 134
J Probe connection, 135
Probe functional test, 137
Jerk limit, 50
Product, 281
Jerk limitation, 50
Prog Event, 97
JOG
Program control, 94
Approaching a fixed point, 66
Program mode
Part program interruption, 93
Part program selection, 91
L
Program status, 95
Leadscrew error compensation (LEC), 129 RESET command, 94
License, 280 Start of part program or part program block, 92
License key, 281 Program operation, 85
License number, 280 Program status, 95
Linear axis Program test
Limit switch monitoring, 39 Block search, 113
LookAhead, 48, 52 Processing of certain program sections, 113
Program processing in singleblock mode,
Skip part program blocks, 115
M
Measuring accuracy, 137
R
Measuring system error compensation (LEC), 129
Menu tree, 229 Rapid traverse override, 59
Mode change, 87 Rapid traverse override switch, 195
Motion monitoring functions, 32 Read measurement results in PP, 136
Reducing jerk, 50
Referencing
O Axis-specific, 148
Channel-specific, 148
Operating modes
with incremental measuring system, 149
Error on operating mode changeover, 87
Reset, 145
Interlocks, 90
Mode change disable, 87
Monitoring, 89
S
Option, 281
Overload factor, 50 Signals from PLC to NCK, 14
Single block mode, 110

Function Manual
284 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0
Index

SINUMERIK 808D licensing, 275 string.icmp, 266


Skip part program blocks, 115 string.insert, 269
Software limit switches, 60 string.left, 266
Software product, 280 string.length, 268
Spindle string.middle, 267
Gear stage change, 174 string.remove, 268
Spindle monitoring, 180 string.replace, 268
Synchronization, 172 string.right, 267
Spindle modes, 164 tan, 271
Spindle override factor, 196 doc.writetofile, 273
Start softkey, 230 XML identifier
BOX, 260
BREAK, 233
T CAPTION, 250
CLOSE, 250
T function, 80
CLOSE_FORM, 250
Tachogenerator compensation, 38
CONTROL, 251
TEACH IN, 86
CONTROL_RESET, 233
Tool, 200
DATA, 234
Activating the tool offset, 200
DATA_ACCESS, 257
Select, 200
DATA_LIST, 234
Selection of the cutting edge when changing
DO_WHILE, 244
tool, 200
ELSE, 234
Tool offset, 200
FOCUS_IN, 250
Value range of T, 200
FOR, 243
FORM, 235, 249
FUNCTION, 261
V
FUNCTION_BODY, 262
Velocity reduction, 50 HELP_CONTEXT, 256
Velocity reduction according to overload factor, 49 HMI_RESET, 235
IF, 236
IMG, 260
X INCLUDE, 236
INIT, 250
XML
LET, 237
Operators, 245
MENU, 257
Syntax, 245
MSG, 238
XML functions
MSGBOX, 239
arccos, 272
NAVIGATION, 257
arcsin, 272
OP, 240
arctan, 272
OPEN_FORM, 258
cos, 271
PAINT, 250
string delete, 269
PASSWORD, 240
doc.remove, 274
POWER_OFF, 240
dll.function, 273
PRINT, 241
doc.exist, 274
PROPERTY, 258
string.find, 270
REQUEST, 263
string.reversefind, 270
SOFTKEY, 259
dll.load, 272
STOP, 242
doc.readfromfile, 273
SWITCH, 242
ncfunc.select, 274
TEXT, 259
sin, 271
THEN, 242
string.cmp, 265, 266

Function Manual
Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0 285
Index

TIMER, 250
UPDATE_CONTROLS, 263
WAITING, 243
WHILE, 244

Function Manual
286 Operating Instructions, 12/2012, 6FC5397-2EP10-0BA0

You might also like