|
|
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
MOUSE_EVENT
The tag can be linked into the script for processing mouse events. It is executed when the
following activities have been performed with the mouse:
● A button has been pressed
● A button has been released
● The mouse has been moved
The parser provides the information in a structure and creates the structure
variable $mouse_event with the following elements:
Structure elements:
● type
Coding of the activity
-
2 - A button has been pressed
–
3 - A button has been released
–
5 - The mouse has been moved
● x
X-position of the cursor in pixels; relative to the current screen resolution
● y
Y-position of the cursor in pixels; relative to the current screen resolution
● id
Identifier
-
-1, if the position cannot be assigned to any control
–
!= -1, if the mouse cursor is inside a control, the content of attribute idemdata is returned
● button
Contains the state of the buttons at the time of the event
-
0 - No button
–
1 - Left button
–
2 - Right button
–
4 - Center button
The buttons can be associated with a bit-by-bit OR operation.
Example:
<MOUSE_EVENT>
<print text="button %d type %d x %d y %d ">$mouse_event.button,
$mouse_event.type, $mouse_event.x, $mouse_event.y</print>
</MOUSE_EVENT>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
61
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
MESSAGE
Dialog message
If the Send_message operation is executed in the script, then the parser processes the tag
message. Values P1 and P2 are provided in the variables $message_par1 and $mes-
sage_par2 (see the "SEND_MESSAGE" tag).
Syntax:
<MESSAGE>
</MESSAGE>
Example:
<LET name="user_selection" />
<SOFTKEY POSITION="3">
<CAPTION>Set%nParameter</CAPTION>
<SEND_MESSAGE>1, 10</SEND_MESSAGE>
</SOFTKEY>
…
…
<FORM>
…
…
<MESSAGE>
<SWITCH>
<CONDITION>$message_par1</CONDITION>
<CASE value="1">
<OP> user_selection = $message_par2 </OP>
…
…
</CASE>
</SWITCH>
</MESSAGE>
…
…
</FORM>
Easy XML
62
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
SEND_MESSAGE
The tag sends a message with two parameters to the active form, which is processed in the tag
message (see also MESSAGE).
Syntax:
<SEND_MESSAGE>p1, p2</SEND_MESSAGE>
Example:
<LET name="user_selection" />
<SOFTKEY POSITION="3">
<CAPTION>Set%nParameter</CAPTION>
<SEND_MESSAGE>1, 10</SEND_MESSAGE>
</SOFTKEY>
…
…
<FORM>
…
…
<MESSAGE>
<SWITCH>
<CONDITION>$message_par1</CONDITION>
<CASE value="1">
<OP> user_selection = $message_par2 </OP>
…
</CASE>
</SWITCH>
</MESSAGE>
…
…
</FORM>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
63
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
RESIZE
Dialog box message
The tag can be linked into the script for processing a RESIZE event. This event is created by
a dynamic resolution switchover.
Easy XML
64
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
RESIZE Continued
Example:
<let name="screen_size" type="StructSize" />
<form name="menu_userscale_form" autoscale_content="off">
<init>
<caption>Use auto scaling</caption>
<function name="hmi.get_hmi_resolution">screen_size</function>
<print text="screen size: w %d h: %d">screen_size.width,
screen_size.height</print>
<data_access type="true" />
<control name="s_c" xpos="8" ypos="140" fieldtype="readonly"
width="500" refvar="string_var" hotlink="true"/>
<if>
<condition>screen_size.width == 800</condition>
<then>
<control name="s_1" xpos="508" ypos="140" fieldtype="readonly"
width="100" refvar="string_var1" hotlink="true"/>
</then>
</if>
<control name="s_w" xpos="200" ypos="350" fieldtype="readonly"
refvar="screen_size.width" hotlink="true"/>
<control name="s_h" xpos="200" ypos="370" fieldtype="readonly"
refvar="screen_size.height" hotlink="true"/>
</init>
<paint>
<text xpos ="68" ypos="310">Text</text>
<text xpos ="8" ypos="350">screen width</text>
<text xpos ="8" ypos="370">screen height</text>
</paint>
<resize>
<function name="hmi.get_hmi_resolution">screen_size</function>
<print text="resize_event screen size: w %d h:
%d">screen_size.width, screen_size.height</print>
<switch>
<condition>screen_size.width</condition>
<case value="640">
<function name="control.delete">_T"s_1"</function>
</case>
<case value="800">
<control name="s_1" xpos="508" ypos="140" fieldtype="readonly"
width="100" refvar="string_var1" hotlink="true"/>
</case>
</switch>
</resize>
</form>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
65
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
CHANNEL_CHANGED
Dialog message
The tag enables processing of the channel change event. It is executed when the user presses
the channel advance button.
Syntax:
<channel_changed>
</channel_changed>
Example:
When the channel is changed, the form is to close and open again so that the data of the
selected channel can be displayed.
<channel_changed>
<open_form name = "form1" reopen="true"/>
</channel_changed>
or
a another menu is activated when a channel is changed.
<channel_changed>
<navigation>menu2</navigation>
</channel_changed>
LANGUAGE_CHANGED
Dialog message
The tag allows processing of a language switchover request. It is executed when the user
switches language while the screen form is open.
Syntax:
<language_changed>
</language_changed>
Example:
When the language is switched over, the form is to close and open again in order to be able to
supply the controls with the text elements of the activated language.
<language_changed>
<open_form name = "form1" reopen="true"/>
</language_changed>
FOCUS_IN
Dialog box message
The tag is called if the system places the focus on a control. To identify the control, the system
copies the name of the control into variable $focus_name and the value of the
attribute item_data into variable $focus_item_data.
This message can be used, e.g. 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>
Easy XML
66
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
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.
The title bar can be divided into multiple columns.
To divide the title bar, the "caption" tag must be programmed with the "define_section" attribute
before the text is output.
The "define_section" attribute specifies the number of columns
The "property" attribute is used to define the length, starting position, and text alignment for
each column. The position and length specification is a percentage value referring to the width
of the form.
The value of the "value" attribute indicates the column number (beginning with zero)
<caption define_sections="3">
<property value="0" length="20" position="2" alignment="left" />
<property value="1" length="20" position="79"
alignment="right" />
</caption>
The text can then be assigned to the column by additionally specifying the "index" attribute with
the column index.
<caption index="0">column1</caption>
<caption index="1">column2</caption>
Syntax:
<CAPTION>Titel</CAPTION>
Example:
<CAPTION>my first dialogue</CAPTION>
CLOSE
Dialog box message
This tag is executed before the dialog box is closed.
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
67
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
CLOSE_FORM
The tag closes the active dialog.
This instruction is only necessary if the dialog is opened by the MMC command and the user
is offered a softkey function to close the dialog. 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>
Easy XML
68
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
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>" />
Note:
Variables used to set attribute values must be declared global variables.
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 field type combobox is selected, 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).
After the control has been created, additional elements can be inserted using the
functions addItem or insertItem.
- 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.
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
69
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
CONTROL Continued
● fieldtype
- graphicbox
The field type generates a 2D broken line graphic control. Using the tag <ITEM> a
graphical element can be inserted into the control. Parameters width and height specify
the width and height of the box.
After the control has been created, additional elements can be inserted using the
functions addItem or insertItem. Parameter itemdata is not evaluated for this control.
If a reference variable is assigned to the control, its values will be recorded in a 100 ms
time base. Up to 10000 values can be recorded. With the property max, values are
recorded endlessly. The oldest value is then deleted when the maximum recording time
is reached. The recording time must be specified in milliseconds.
Although the values are stored at discrete times, the control displays them as
connected lines. The attribute channel permits recording of up to three further reference
variables. The index starts with one. Index zero is used to set the properties of the
variables assigned in the control tag.
Example:
<control name= "c_gbox1" xpos = "250" ypos="24" width="240"
height="356" fieldtype="graphicbox" refvar="val" hotlink="true"
COLOR_BK="#ffffff">
<property max="60000" /> <!-- steps of ms -->
<property min="0" />
<property channel="0" color="#00ffff" penwidth="3"/>
<property ORDINATE="Y sinus" />
<property ABSCISSA="time *100 ms" />
<property channel="1" refvar="val2" color="#000000" />
</control>
Easy XML
70
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
CONTROL Continued
Example graphicbox:
<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.
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
71
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
CONTROL Continued
The following field types are described in section "Configuring your own buttons (Page 173)".
● fieldtype
- pushbutton
The field type is used as a pushbutton or a switch.
- radiobutton
The field type allows you to select one of several options.
- checkbox
The field type allows you to select several options.
- groupbox
The field type visually encloses a group of controls with a frame and a title.
- switch
The field type is a graphical element that signals one of two states using an icon.
- scrollarea
The field type is used to display controls within a specified area.
Easy XML
72
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
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.
This can serve to identify the element, for example.
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.
After the control has been created, additional list box elements can be inserted using
the function addItem or insertItem. 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).
The Format attribute also allows an integer value to be displayed in other number systems or
display as a Boolean value for the field types edit and readonly. Formatting using number of
characters and alignment is not supported.
The following types of representation can be used:
● %o - octal
● %x - hexdecimal
● %n - binary
● %b - bool
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
73
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
CONTROL Continued
Example attribute format:
<let name="val_test">255</let>
<form name="main_form">
<init>
<caption>bool hex octal bin display</caption>
<control name="test_oVal" xpos="250" ypos="60"
refvar="val_test" hotlink = "true" />
<control name="test_bool" xpos="250" ypos="90"
refvar="val_test" hotlink = "true" format="%b"/>
<control name="test_hex" xpos="250" ypos="120"
refvar="val_test" hotlink = "true" format="%x"/>
<control name="test" xpos="250" ypos="150"
refvar="val_test" hotlink = "true" format="%o"/>
<control name="test_b" xpos="200" ypos="180"
width="300" refvar="val_test" hotlink = "true"
format="%n"/>
</init>
<paint>
<text xpos="16" ypos="60">integer value</text>
<text xpos="16" ypos="90">boolean display</text>
<text xpos="16" ypos="120">hexadecimal
display</text>
<text xpos="16" ypos="150">octal display</text>
<text xpos="16" ypos="180">binary display</text>
</paint>
</form>
CONTROL Continued
Attributes:
● color_bk
The attribute sets the backg11round color of the control.
● color_fg
The attribute sets the foreground color of the control.
Color coding (see Chapter "Color coding (Page 52)")
● 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>
Easy XML
74
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
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>
CONTROL Continued
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>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
75
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
CONTROL Continued
The image box control manages a picture in bitmap or GIF format. If the picture is larger than
the displayable area, the control will show a scroll bar.
To control the visible area, the system provides the function CONTROL.IMAGEBOXSET (see
Chapter "Predefined functions (Page 118)").
Syntax:
<function name="control.imageboxget"> ... </function>
CONTROL Continued
Attributes:
● disable
The attribute locks/permits the input in an edit control.
● tooltip
An information text is displayed if the cursor is placed on the control.
● factor
Conversion factor
● font
Definition of a font
CONTROL Continued
Changing the control after creation
A control tag changes the properties of an existing control after it has been created. The tag
must be specified with the name of the control to be changed and the new properties. It can be
executed only within a form tag. The following properties can be changed, for example:
● name
● xpos
● ypos
● width
● height
● color_bk
● color_fg
● access level
● fieldtype
● itemdata
● min
● max
● default
● disable
● tooltip
● font
● factor
The reference variable cannot be modified. If a property is to be changed by triggering by a
softkey event, the send message tag must transfer this request into the form context. The
message tag is used to acquire the message.
Easy XML
76
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
CONTROL Continued
Control change in an operating instruction
Another possibility of changing properties of a control during runtime is to make the change in
an operating instruction. Therefore the name of the control and the property to which a new
value is to be assigned must be defined. The property is separated from the control name by
a point.
Syntax:
<Name>.<Property>
Example:
<let name="value" />
<let name="w" />
<let name="h" />
<control name="c_move" xpos="$xpos" ypos="124" />
<op>
c_move.xpos = 300;
value = c_move.xpos;
h = c_move.height;
w = c_move.width;
</op>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
77
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
HELP_CONTEXT
This tag defines the help topic to be called. It should be programmed in the INIT block.
808/802D sl systems
The name specified in the attribute is supplemented by the prefix XmlUserDlg_ and is trans-
ferred 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".
840D sl/828D systems
Further information regarding the layout and generation of a help book:
SINUMERIK Operate Commissioning Manual
Attributes:
● name
The name specified in the attribute is passed on to the help system. The file name used in
the help book in tag entry must be specified.
● anchor
With the attribute you can enter a keyword.
Syntax:
<HELP_CONTEXT name="<file name>" anchor="key word"/>
Example:
<form name = "form1">
<init>
<help_context name="chapter_1.html" anchor="Keyword_1" />
<control name = "cpwd" xpos = "322" ypos = "64" >
<property password="true" />
<property help_context="chapter_1.html" anchor="Keyword_2" />
</control>
</form>
Easy XML
78
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
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: Controls for which the hotlink attribute is set to true are always written to and read
directly.
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 UPDATE_CONTROLS type = "FALSE" tag
Example:
<DATA_ACCESS type = "true" />
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
79
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
DEBUG
The tag is used to store trace outputs, which can be programmed in the script. The attribute text
is used to write the text to be stored. This attribute and its values correspond to the text attribute
and the values of the print instruction.
By default, a debug tag is not executed as it slows down the system. To activate the debug
outputs, program the attribute debug_msg, with value on in tag DialogGui or AGM.
The debug outputs are stored together with the parser error messages in the following file:
card/oem/sinumerik/hmi/dvm/log/dvm.log
Syntax:
<debug text="<Text see print instruction>">Variables see print
instruction</debug>
Example Easy XML:
<DialogGui debug_msg="on">
<control name="test_bool" xpos="250" ypos="90"
refvar="val_test" hotlink = "true" format="%b"/>
<debug text="main_form control test_bool created
value:%d">test_bool</debug>
Entry in the file dvm.log:
date: 10/22/ 2018 time: 09:38:44:351
Debug xmldial.xml 17: main_form control test_bool
created value:255
Example Easy Extend:
<AGM debug_msg="on">
<control name="test_bool" xpos="250" ypos="90"
refvar="val_test" hotlink = "true" format="%b"/>
<debug text="main_form control test_bool created
value:%d">test_bool</debug>
Entry in the file dvm.log:
date: 10/22/ 2018 time: 09:38:44:351
Debug xmldial.xml 17: main_form control test_bool
created value:255
Easy XML
80
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
EDIT_CHANGED
Dialog box message
This tag is called if the contents of an edit control have changed.
To identify the control, the system copies the name of the control into variable $focus_name
and the value of the attribute item_data into variable $focus_item_data.
Example:
<EDIT_CHANGED>
<print text="index changed filed:%s, %d"> $focus_name,
$focus_item_data </print>
…
…
</EDIT_CHANGED>
GESTURE_EVENT
The tag is used to perform finger gestures for multi-touch operation.
The tag is described in section "Multitouch operation (Page 165)".
INDEX_CHANGED
Dialog box message
The tag is called, if the operator changes the selection of a combo box.
To identify the control, the system copies the name of the control into the variable
$focus_name and the value of the attribute item_data into the variable $focus_item_data.
Note:
A reference variable assigned to the control, has not been aligned to the control variable at this
point in time and contains the index of the previous selection of the combo box.
Example:
<INDEX_CHANGED>
<print text="index changed filed:%s, %d"> $focus_name,
$focus_item_data </print>
…
…
</INDEX_CHANGED>
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>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
81
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
NAVIGATION
This tag defines the menu to be called. It can be used within a softkey block, a menu block, and
in a form. If a variable name is assigned to the tag as its value, the parser will activate the menu
stored in the variable.
In a menu block, the navigation is at the position in the instruction. Subsequent instructions are
no longer executed.
Note:
If the navigation target is to be determined by the content of a variable, this variable must be
declared a global variable.
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>
Easy XML
82
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
OPEN_FORM
The tag opens the dialog form given under the name.
If the specified screen form is already active, this tag is not executed.
You can force the screen form to open again by entering the attribute reopen. This may be
necessary if system states change that require rearrangement of screen form contents.
Attribute:
● name
Name of the dialog form
● reopen
If the value of the attribute is set to true, when the tag open_form is called again, a check
is made to see whether the screen form is the active form. If this is the case, the parser
closes the active form and opens it again.
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>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
83
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
PROPERTY
This tag can be used to define additional properties for an operator control. The tag is embed-
ded in the control tag.
Attributes:
● max = "<maximum value>"
● min = "<minimum value>"
● default = "<pre-assignment>"
● factor = "conversion factor"
● color_bk = "<backg11round color coding>"
● color_fg = "<font color coding>"
● 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
● transparent = "Transparent color of a bitmap"
Color coding (see Chapter "Color coding (Page 52)")
● tooltip = information text is displayed if the cursor is set to the control.
The syntax is: <property tooltip="note text" />
● abscissa = "Name of the first coordinate axis" (only permissible for a graphic box)
● ordinate = "Name of the second coordinate axis" (only permissible for a graphic box)
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>
PROPERTY continued
Attributes:
alignment - this attribute defines the text alignment for entry fields
Syntax:
alignment="<right/left>"
Example:
<control name="edit2" xpos="208" ypos="52" >
<property alignment="right"/>
</control>
Easy XML
84
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
PROPERTY continued
Attributes:
picture - this attribute defines a graphic to be displayed
The specified graphic is displayed or the name of the graphic is stored in a variable if the input
focus is set on this field. This attribute is to be used in conjunction with the refvar attribute to be
able to define the data sink.
To display a graphic or an animation, the name of an imagebox type control must be specified.
This control assumes management of the graphic.
If the name of a local variable is specified, this variable must be of a String data type.
The graphic continues to be displayed until a new name is assigned to the reference variables.
Syntax:
<property picture="<Name der Grafik>" refvar="<Datensenke>"/>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
85
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
PROPERTY continued
Example:
<let name="cursor_icon" type="string" />
<form name="main_form1">
<init>
<caption>Control attribute: picture</caption>
<control name="cursor_image" xpos="8" ypos="32" width="100"
height="100" fieldtype="imagebox" />
<control name="edit1" xpos="208" ypos="32" >
<property picture="red_led_off.bmp" refvar="cursor_image"/>
</control>
<control name="edit2" xpos="208" ypos="52" >
<property picture="red_led_on.bmp" refvar="cursor_image"/>
</control>
<control name="edit3" xpos="208" ypos="72" >
<property picture="test.gif" refvar="cursor_image"/>
</control>
<control name="edit4" xpos="208" ypos="92" >
<property picture="red_led_off.bmp" refvar="cursor_image"/>
</control>
<control name="edit5" xpos="208" ypos="112" >
<property picture="red_led_off.bmp" refvar="cursor_icon"/>
</control>
<control name="edit6" xpos="208" ypos="132" >
<property picture="red_led_on.bmp" refvar="cursor_icon"/>
</control>
</init>
<timer><print text="%s">cursor_icon</print></timer>
</form>
Easy XML
86
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
PROPERTY continued
Attributes:
cursortext - this attribute defines the cursor text to be displayed
The text is issued in the title bar if the input focus is set on this field.
Two further attributes can be specified in addition to this attribute which define the alignment
of the text and the cursor text area. The text is left-justified as standard. The cursor text area
takes up 50% of the title bar width by default.
alignment="<right/left>" - Text alignment right-justified/left-justified
length="<Width>" - percentage of the title bar which should be required for the cursor text
Syntax:
<property cursortext="<text>" />
or
<property cursortext="<text>" alignment="<right/left>" />
or
<property cursortext="text2" alignment="r="<text>"
alignment="<right/left>" length="<Ratio>"/>
Example:
<form name="main_form2">
<init>
<caption>Control attribute: cursortext</caption>
<control name="edit1" xpos="208" ypos="32" >
<property cursortext="cursor text field edit1" />
</control>
<control name="edit2" xpos="208" ypos="52" >
<property cursortext="cursor text field edit2"
alignment="right"/>
</control>
<control name="edit3" xpos="208" ypos="72" >
<property cursortext="cursor text field edit3"
alignment="right" length="40"/>
</control>
<control name="edit4" xpos="208" ypos="92" >
<property cursortext="cursor text field edit4" />
</control>
</init>
</form>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
87
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
PROPERTY continued
Attributes:
multiline - this allows the multi-line output of a text in a read-only control
Syntax:
<property multiline="true" />
Example:
<op>
textlist[2] = _T"This is a multiline text in a Reaonly control.\
\nThe multiline attribute enables Word break function.";
</op>
<control name="lstring" xpos="8" ypos="120" width="200" height="160"
fieldtype="readonly" refvar="textlist[2]" >
<property multiline="true" />
</control>
PROPERTY continued
Attributes:
● help_context
The attribute makes it possible to assign a help topic to a control. The file name used in
tag entry in the help book must be specified.
● anchor
With the attribute you can enter a keyword. This attribute is only valid in conjunction with the
attribute help_context.
Syntax:
<property help_context="<file name>" anchor="<key word>"/>
Example:
<control name = "cpwd" xpos = "322" ypos = "64" >
<property password="true" />
<property help_context="chapter_1.html" anchor="Keyword_2" />
</control>
Easy XML
88
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
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 attributes become effective from:
● type
Defines the property of the softkey.
user_controled - The script defines how the softkey is displayed
toggle_softkey - The softkey is displayed alternating between pressed and not pressed
● refvar
Should only be used in conjunction with toggle_softkey .
Reference variable, into which the actual softkey property is copied.
A variable, type "String" should be specified, which includes the properties pressed, not
pressed or locked (see tag state).
● picture
Using the attribute, a bitmap can be output left justified on the softkey. The complete path
name should be specified.
The number of text characters that can be displayed is reduced to the width of the bitmap.
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
89
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
SOFTKEY continued
The following additional actions can be defined within the softkey block:
●
picturealignment
The image orientation is specified by this attribute.
The image is aligned with the left side of the softkey by default.
The following values can be specified for alignment:
- top
Top edge
- bottom
Bottom edge
- left
Left edge
- right
Right edge
- center
Centered
●
caption
Softkey text
●
state
Should only be used in conjunction with user_controlled .
The tag assigns the required softkey display to the system.
Syntax:
<state type="<state>" />
The following strings can be specified:
- notpressed
The softkey is displayed as being not pressed.
- pressed
The softkey is displayed as being pressed.
- disabled
The softkey is locked and is displayed in gray.
●
navigation
●
update_controls
●
function
Easy XML
90
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
SOFTKEY continued
Syntax:
Standard softkey:
<state type="<softkey state>" />
<softkey position = "<1>">
…
…
</softkey>
or
Script-controlled softkey:
<softkey position = "<1>" type="<user_defined>" >
<state type="<softkey state>" />
…
…
</softkey>
or
Toggle softkey:
<softkey position = "<1>" type="<toggle_softkey>" refvar="<variable
name>" >
…
…
</softkey>
Example:
<let name="define_sk_type" type="string">PRESSED</let>
<let name="sk_type">1</let>
<softkey POSITION="1" type="user_controled" >
<caption>Toggle%nSK</caption>
<if>
<condition>sk_type == 0 </condition>
<then>
<op> sk_type = 1 </op>
<op> define_sk_type = _T"PRESSED" </op>
</then>
<else>
<op> define_sk_type = _T"NOTPRESSED" </op>
<op> sk_type = 0 </op>
</else>
</if>
<state type="$$$define_sk_type" />
…
…
</softkey>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
91
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
SOFTKEY continued
Example:
or
<let name="curr_softkey_state" type="string">PRESSED</let>
</softkey>
<softkey POSITION="3" type="toggle_softkey"
refvar="curr_softkey_state">
<caption>Toggle%nSK</caption>
…
</softkey>
SOFTKEY_OK
The tag defines the response of the softkey "OK".
The following additional actions can be defined within the softkey block:
● navigation
● update_controls
● function
Syntax:
<SOFTKEY_OK>
…
…
</SOFTKEY_OK>
SOFTKEY_CANCEL
The tag defines the response of the softkey "Cancel".
;
$ERUW
The following additional actions can be defined within the softkey block:
● navigation
● update_controls
● function
Syntax:
<SOFTKEY_CANCEL>
…
…
</SOFTKEY_CANCEL>
Easy XML
92
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
SOFTKEY_BACK
The tag defines the response of the softkey "Back".
%DFN
The following additional actions can be defined within the softkey block:
● navigation
● update_controls
● function
Syntax:
<SOFTKEY_BACK>
…
…
</SOFTKEY_BACK>
SOFTKEY_ACCEPT
The tag defines the response of the softkey "Accept".
$FFHSW
The following additional actions can be defined within the softkey block:
● navigation
● update_controls
● function
Syntax:
<SOFTKEY_ACCEPT>
…
…
</SOFTKEY_ACCEPT>
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 (see Chapter "Color coding (Page 52)")
Value:
Text to be displayed
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
93
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
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>" />
<IMG … xrot="angle X axis" yrot=" angle Y axis " zrot=" angle Z axis
" />
Attributes:
● xpos
X position of the top left corner
● ypos
Y position of the top left corner
● name
Complete path name. The path information is made in lowercase letters.
● transparent
Transparent color of the bitmap (see Chapter "Color coding (Page 52)")
IMG Continued
Example:
The image is rotated through 34 degrees around the Z axis:
<img xpos = "5" ypos = "23" name = "f:/appl/pic3.bmp" height="355"
width="550" zrot="34" color_bk="#ffffff" >
</img>
Note:
The drive designations vary depending on the system.
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"/>
Easy XML
94
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
IMG Continued
Attribute:
AspectRatioMode
This attribute allows the control of the aspect ratio for an image wherever non-proportional
zooming is performed.
Values:
● Ignore
The aspect ratio of the bitmap is adapted to the prescribed height and width.
● Keep (default)
The aspect ratio is retained and ensures that the image is scaled to a rectangle which
assumes the greatest expansion within the prescribed height and width.
● KeepByExpanding
The aspect ratio is kept and ensures that the image is scaled to a rectangle which assumes
the greatest expansion outside of the prescribed height and width.
Example:
<img xpos = "8" ypos = "30" name = "test.bmp" height="155"
width="150" AspectRatioMode="KeepbyExpanding">
<property transparent="#00ff00" />
</img>
<img xpos = "8" ypos = "200" name = "test.bmp" height="155"
width="150" AspectRatioMode="Ignore">
<property transparent="#00ff00" />
</img>
<img xpos = "200" ypos = "200" name = "test.bmp" height="155"
width="150" AspectRatioMode="Keep">
<property transparent="#00ff00" />
</img>
● Top - KeepbyExpanding property set
● Bottom left - Ignore property set
● Bottom right - Keep property set
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
95
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
IMG Continued
Attributes:
ExpandingForRotation
The aspect ration is retained. The image is scaled to a rectangle which corresponds with the
bounding box of the rotated and scaled image.
Example:
<img xpos = "8" ypos = "100" name = "pic1.bmp" height="155"
width="150" >
<property transparent="#ffffff" />
</img>
<op>
zrot = 45.0;
</op>
<img xpos = "205" ypos = "23" name = "pic1.bmp" height="155"
width="150" zrot="$zrot" AspectRatioMode="ExpandingForRotation">
<property transparent="#ffffff" />
</img>
<img xpos = "205" ypos = "200" name = "pic1.bmp" height="155"
width="150" zrot="$zrot" >
<property transparent="#ffffff" />
</img>
● Left - Image is scaled to a size of 150x155 pixels
● Top right - Image is scaled to a size of 150x155 pixels and is rotated around 45 degrees with
the ExpandingForRotation property
● Bottom right - Image is scaled to a size of 150x155 pixels and is rotated around 45 degrees
Easy XML
96
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
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 (see Chapter "Color coding (Page 52)")
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"
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
97
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
FUNCTION_BODY
Function body
The tag contains the function body of a subfunction. The function body needs to be program-
med 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" (optional)
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>
Easy XML
98
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
FUNCTION_BODY contin-
Example:
ued
<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.
Attributes:
● name
Address identifier
● function
Function name
Syntax:
<REQUEST name = "<NC-Variable>" />
or
<REQUEST name = "<NC-Variable>" function="<function name>"/>
Example:
<request name ="plc/mb10" />
or
<function_body name="my_function" >
<print text="value changed" />
</function_body>
…
…
…
<request name ="plc/mb10" function="my_function"/>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
99
Generating user dialogs
1.7 XML identifier
Tag identifier
Description
RECALL
This tag can be used in a menu if a navigation is to take place via Recall button. If the tag is
programmed, the Recall icon is shown, and the parser may process the Recall button.
Syntax:
<recall>
…
…
</recall>
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>
Easy XML
100
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.8 Generating user menus
1.8
Generating user menus
1.8.1
Creating processing cycle forms
The cycle support function allows the automatic creation and decompilation of a cycle call
through the form dialog.
To manage this functionality, the following tags are available:
● NC_INSTRUCTION
● CREATE_CYCLE
To mark a cycle form, in the FORM tag, the attribute type should be specified with the value
cycle. This marking allows the NC_INSTRUCTION to be processed.
Example
<FORM name = "cycle100_form" type= "CYCLE">
…
…
</FORM>
The NC_INSTRUCTION tag contains the cycle call to be generated. All cycle parameters
should be reserved using space retainers.
Example
<FORM name = "cycle100_form" type= "CYCLE">
<NC_INSTRUCTION refvar= "cyc_string" >Cycle100 ($p1, $p2, $p3)</
NC_INSTRUCTION>
…
…
…
</FORM
The CREATE_CYCLE tag prepares the values saved in the space retainer variables and
generates the NC instruction.
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
101
Generating user dialogs
1.8 Generating user menus
This is then copied to the specified variable.
Tag identifier
Description
NC_INSTRUCTION
This tag is used to define the NC instruction to be generated.
All listed cycle parameters are automatically created as string variables of
the FORM and are available to the FORM.
Precondition: The FORMattribute type is set to the value CYCLE.
Attribute:
● refvar
If the tag is assigned a reference variable, all parameters are pre-assigned with
the values from the NC block saved in the reference variable.
Syntax:
<NC_INSTRUCTION> NC instruction with placeholders </
NC_INSTRUCTION>
Example:
<let name="cyc_string" type="string"> Cycle100(0, 1000, 5)</
let>
<FORM name = "cycle100_form" type= "CYCLE">
<NC_INSTRUCTION refvar= "cyc_string" >Cycle100($p1, $p2,
$p3)</ NC_INSTRUCTION>
…
…
…
</FORM>
Easy XML
102
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.8 Generating user menus
Tag identifier
Description
CREATE_CYCLE
The tag generates an NC block, whose syntax is defined by the value of the NC_IN-
STRUCTION tag.
Before generating the NC instruction, the parser calls the CYCLE_CRE-
ATE_EVENT tag of the FORM. This tag can be used to calculate the cycle param-
eters.
Syntax:
<CREATE_CYCLE/>
Option:
If a reference variable is specified, the instruction copies the generated call into this
variable.
<create_cycle refvar="name" />
Attribute:
● refvar
If the tag is assigned a reference variable, the NC instruction is copied to this
variable.
Example:
<LET name="cyc_string" type="string"> Cycle100(0, 1000, 5)</
LET>
<SOFTKEY_OK>
<caption>OK</caption>
<CREATE_CYCLE />
<close_form />
<navigation>main_menu</navigation>
</SOFTKEY_OK>
or
<SOFTKEY_OK>
<caption>OK</caption>
<CREATE_CYCLE refvar= "cyc_string" />
<close_form />
<navigation>main_menu</navigation>
</SOFTKEY_OK>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
103
Generating user dialogs
1.8 Generating user menus
1.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>
Easy XML
104
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.9 Addressing components
1.9
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.
1.9.1
PLC addressing
Addressing the PLC starts with the path section plc.
Table 1-3
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 1-4
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>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
105
Generating user dialogs
1.9 Addressing components
1.9.2
Addressing NC variables
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 List Manual
NC Variables and Interface Signals.
Example:
<LET name = "tempStatus"></LET>
<OP> tempStatus ="nck/channel/state/chanstatus" </OP>
1.9.3
Channel-specific addressing
If no channel number is defined in the address token, access is always to Channel 1 of the
operating software.
If it is necessary to read data from a specific channel, the identifier u (Unit) with the desired
channel number is added to the address.
Example:
nck/Channel/MachineAxis/actFeedRate[3]
nck/Channel/MachineAxis/actFeedRate[u1, 3]
1.9.4
Generating NC/PLC addresses during the runtime
It is possible to generate an address identifier during runtime.
In this case, the content of a string variable is used as address in an operation statement as well
as in the nc.cap.read and nc.cap.write functions.
Observe the following for this type of addressing mode:
● Write the variable names in quotation marks.
● Use three ‚$’ characters as prefix for variable names.
Syntax:
"$$$variable name"
Example:
<PRINT name="var_adr" text="DB9000.DBW%d"> 2000</PRINT>
<OP> "$$$var_adr" = 1 </OP>
Easy XML
106
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.9 Addressing components
1.9.5
Addressing drive components
Addressing the drive components starts with the path section drive.
Then the drive device is specified:
CU - Control Unit
DC - Drive Control (Motor Module)
CULNK - Expansion Modules (HUBs)
TM - Terminal Modules
LM - Line Modules
The parameter to be set is added to this section.
Example:
<LET name="r0002_content"></LET>
<LET name="p107_content"></LET>
<!- Reading of value r0002 on the CU ->
<OP> r0002_content = "drive/cu/r0002" </OP>
<OP> r0002_content = "drive/cu/r0002[CU1]" </OP>
<!- Reading of value r0002 on NX1 ->
<OP> r0002_content = "drive/cu/r0002[CU2]" </OP>
<!- Reading of value p107[0] on the CU ->
<OP> p107_content = "drive/cu/p107[0]" </OP>
<PRINT text="%d"> p107_content </PRINT>
<!- Reading of value p107[0] on the CU ->
<OP> p107_content = "drive/cu/p107[0, CU1]" </OP>
<PRINT text="%d"> p107_content </PRINT>
<!- Reading of value p107[0] on the NX1 ->
<OP> p107_content = "drive/cu/p107[0, CU2]" </OP>
<PRINT text="%d"> p107_content </PRINT>
Addressing the drive objects:
To address individual objects, the desired object should be entered in square brackets after the
parameter.
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
107
Generating user dialogs
1.9 Addressing components
Figure 1-7
Drive parameter p0978 [ ...] at the control
Parameter number[do<DO-index>]
Example:
p0092[do1]
Alternatively, the drive index can be read from a local variable using $<variable name>
"substitution characters".
z.B. DO$local variable
Example:
<DATA name ="drive/cu/p0092">1</DATA>
<DATA name ="drive/dc/p0092[do1] ">1</DATA>
Indirect addressing:
<LET name = "driveIndex> 0 </LET>
<OP> driveIndex = $ctrlout_module_nr[0, AX1] </OP>
<DATA name ="drive/dc[do$driveIndex]/p0092">1</DATA>
Easy XML
108
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.9 Addressing components
1.9.6
Example: Determine the DO number for the Motor Module
The DO number of a type 11 (servo) Motor Module can be determined as follows:
All connected drive objects are listed with their slot number in field p978 of the relevant CU. The
component type numbers are listed in the field p101 and the component types are listed in the
field p107 simultaneously.
A separate indexing is to be used for each of the following component types:
CU - Control Units
DC - Drive Controls (Motor Module)
CULNK - Expansion Modules (HUBs)
TM - Terminal Modules
LM - Line Modules
The addressing index can be determined by running through the field p107 in ascending order
for each connected CU, and the type index is incremented by one each time the desired type
occurs. The basic value is one. If NX components are found in this field, the counting on an NX
component is not continued until the current array has been run through completely. The NX
and CU components are executed in the order found.
Index determination: CUI with NX
CUI
NX1
Addressing index
DO
CU
p107[0]
[3]SINAMICS
1
p107[2]
[11]SERVO
1
p107[3]
[11]SERVO
2
p107[4]
[11]SERVO
3
p107[5]
[254]CU-LINK
2
p107[6]
[11]SERVO
4
p107[1]
[11]SERVO
5
p107[2]
[11]SERVO
6
p107[3]
[11]SERVO
7
This topology contains seven Motor Modules. Indices one to four address the Motor Modules
assigned to the CU. Indices five to seven address the Motor Modules of the NX. Index one is
to be used to access the CU. The NX is addressed twice by the index.
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
109
Generating user dialogs
1.9 Addressing components
Sample scripts: xmldial.xml and drv_sys_hlpfunct.xml
xmldial.xml
<DialogGui>
<?include src="f:\appl\drv_sys_hlpfunct.xml" ?>
<menu name = "main">
<open_form name = "main_form" />
<softkey POSITION="1">
<caption></caption>
<navigation>main</navigation>
</softkey>
</menu>
<form name="main_form">
<init>
<caption>Component arrangement</caption>
<let name="count" />
<let name="str" type="string" />
<let name="do_name" type="string" />
<let name="cu_name" type="string" />
<let name="cui_idx" />
<op>
cui_idx = 0;
</op>
<function name="load_component" />
<print text="%d CUs found">num_cus</print>
<function name="calculate_do_index" />
<control name="list_comp_no_do_idx" xpos="8" ypos="80"
fieldtype="listbox" width="360" height="500" >
<property item_data="100" />
</control>
<op>
count = 0;
</op>
<while>
<condition>count < 32 && address_idx_map[$count].comp_no != 0</
condition>
<op>
do_name= _T"";
</op>
<function name="read_do_name_fast" return="do_name">count</function>
<function name="read_cu_name_fast"
return="cu_name">address_idx_map[$count].cu_idx</function>
<print name="str" text="%3d %3d %3d %s
%s">address_idx_map[$count].cu_idx, address_idx_map[$count].comp_no,
address_idx_map[$count].do_idx, do_name, cu_name</print>
Easy XML
110
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.9 Addressing components
xmldial.xml
<function name="control.additem">_T"list_comp_no_do_idx", str, count</
function>
<op>
count = count +1;
</op>
</while>
<paint>
<text xpos="8" ypos="30">Motor moduls</text>
<text xpos="8" ypos="60">CU</text>
<text xpos="40" ypos="60">Comp.</text>
<text xpos="92" ypos="60">DO Index</text>
<text xpos="172" ypos="60">Name</text>
</paint>
</form>
</DialogGui>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
111
Generating user dialogs
1.9 Addressing components
drv_sys_hlpfunct.xml
<typedef name="components" type="struct">
<element name="cu_p978" dim="25" />
<element name="do_p0101" dim="25" />
<element name="do_p0107" dim="25" />
</typedef>
<typedef name="comp_no_do_idx_map" type="struct">
<!-- cu index -->
<element name="cu_idx" />
<!-- component number -->
<element name="comp_no" />
<!-- address index -->
<element name="do_idx" />
</typedef>
<let name="componentsList" dim="5" type="components" />
<let name="address_idx_map" dim="32" type="comp_no_do_idx_map" />
<let name="num_cus" />
<let name="_drv_sys_comp_array_size">23</let>
<!-- ------------------------------------------------------------
function: load_components_description
This function loads the parameter arrays p978, p101 and p107 into a local
memory
input:
cuno: CU index 0 based (index 0 == CUI)
output:
componentsList structure
---------------------------------------------------------------- -->
<function_body name="load_components_description" parameter="cuno">
<let name="count" />
<let name="next_nx" >0</let>
<let name="cuidx"></let>
<let name="error" />
<op>
count = _drv_sys_comp_array_size;
next_nx = cuno;
cuidx = cuno+1;
</op>
<print text="gather data" />
<function name="ncfunc.cap.read" return="error"
rows="$count">componentsList[$cuno].cu_p978, "drive/cu/p0978[0, cu
$cuidx]"</function>
<function name="ncfunc.cap.read" return="error"
rows="$count">componentsList[$cuno].do_p0101, "drive/cu/p0101[0, cu
$cuidx]"</function>
Easy XML
112
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.9 Addressing components
drv_sys_hlpfunct.xml
<function name="ncfunc.cap.read" return="error"
rows="$count">componentsList[$cuno].do_p0107, "drive/cu/p0107[0, cu
$cuidx]"</function>
<print text="gather data finished" />
<sleep value="20" />
<op>
count = 0;
</op>
<while>
<condition>count < _drv_sys_comp_array_size</condition>
<if>
<condition>componentsList[$cuno].cu_p978[$count] == 60</condition>
<then>
<op>
next_nx= next_nx +1;
</op>
<print text="next nx %d">next_nx</print>
<function name="load_components_description">next_nx</function>
</then>
</if>
<op>
count = count+1;
</op>
</while>
<op>
num_cus = next_nx+1;
</op>
</function_body>
<!-- ------------------------------------------------------------
function: calculate_do_index
This function is looking for components of type 11 (SERVO) and lists these
in the componentsList array.
input:
-
output:
componentsList array filled
---------------------------------------------------------------- -->
<function_body name="calculate_do_index">
<let name="cuno" />
<let name="count" />
<let name="do_index" >1</let>
<let name="map_index" />
<while>
<condition>
cuno < num_cus</condition>
<op>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
113
Generating user dialogs
1.9 Addressing components
drv_sys_hlpfunct.xml
count = 0;
</op>
<while>
<condition>count < _drv_sys_comp_array_size</condition>
<if>
<condition> componentsList[$cuno].do_p0107[$count] == 11</condition>
<then>
<op>
address_idx_map[$map_index].cu_idx = cuno+1;
address_idx_map[$map_index].comp_no =
componentsList[$cuno].do_p0101[$count];
address_idx_map[$map_index].do_idx = do_index;
do_index = do_index+1;
map_index = map_index +1;
</op>
</then>
</if>
<op>
count = count +1;
</op>
</while>
<op>
cuno = cuno +1;
</op>
</while>
</function_body>
Easy XML
114
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.9 Addressing components
1.9.7
Addressing machine and setting data
Drive and 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>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
115
Generating user dialogs
1.9 Addressing components
1.9.8
Channel-specific machine data
If no channel number is defined in the address token, access is always to the currently set
channel of the operating software.
If it is necessary to read data from a specific channel, the identifier u (Unit) with the desired
channel number in square brackets is added to the address. In an array-addressing, the
channel definition is the last argument in the square brackets.
Example:
$MC_RESET_MODE_MASK
or
$MC_AXCONF_GEOAX_ASSIGN_TAB[0]
$MC_RESET_MODE_MASK[u1]
or
$MC_AXCONF_GEOAX_ASSIGN_TAB[0, u1]
$MC_RESET_MODE_MASK
Easy XML
116
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.9 Addressing components
1.9.9
Addressing 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]" = 10 </op>
Addressing the global user data
Addressing starts with the path section gud, followed by the specification of the area
CHANNEL. This address section is followed by the specification of the GUD areas:
GUD areas
Assignment
sgud
Siemens GUD
mgud
Machine manufacturer GUD
ugud
User GUD
GD4 to GD9
User data extended
Then enter the GUD name. If an array is to be addressed, the name is
followed by the array subscript in square brackets.
Example:
<data name ="gud/channel/mgud/syg_rm[0]">1</data>
<op>"gud/channel/mgud/syg_rm[0]" = 5*2 </op>
Addressing multi-dimensional arrays
When addressing multi-dimensional arrays, the line index is expected followed by the column
index. The indices must be indicated separated by a period.
The following applies to channel-specific GUDs:
● The channel number must be noted with the identifier u (unit) followed by the number before
or after the line/column specification.
● The sequences must be separated by a comma.
● If no channel number is indicated, access is to the first channel.
Example:
"gud/Channel/sgud/_WP[u2, 2.0]"
or
"gud/Channel/sgud/_WP[2.0, u2]"
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
117
Generating user dialogs
1.10 Predefined functions
1.10
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
Description
Ncfunc cap read
The function copies a value from the specified address into a local var-
iable. If the read operation was error-free, then the return variable con-
tains the value zero.
Contrary to the operation instruction, in the event of a fault, this function
does not interrupt the processing of the script operations.
Attributes:
● return - Execution status
- Value = 0 - fault-free
- Value = 1 - The variables could not be read
● rows - Number of additional lines of an array to be read (optional)
If an array index is defined for the reference variables, as from this
index, the function copies the values read into the target variable.
Syntax:
<function name="ncfunc.cap.read" return="error">
lokale variable, "address"</function>
Example:
<let name="error"></let>
<function name="ncfunc.cap.read" return="error"> 3,
"drive/cu/p0009"</function>
<if>
<condition>error != 0</condition>
<then>
<break />
</then>
</if>
or
<let name="cu_p978" dim="25" ></let>
<function name="ncfunc.cap.read" return="error"
rows="23">cu_p978, "drive/cu/p0978[0, 1]"
</function>
Easy XML
118
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.10 Predefined functions
Function name
Description
Ncfunc cap write
The function writes a value into the specified variable. If the write oper-
ation was error-free, then the return variable contains the value zero.
Contrary to the operation instruction, in the event of a fault, this function
does not interrupt the processing of the script operations.
Attributes:
● return - Execution status
- Value = 0 - fault-free
- Value = 1 - The variables could not be read
● rows - Number of additional lines of an array to be written (optional)
If an array index is defined for the reference variables, as from this
index, the function copies the values into the target variable.
Syntax:
<function name="ncfunc.cap.read" return="error">
local variable or constant, "address"</function>
Example:
<let name="error"></let>
<function name="ncfunc.cap.write" return="error">
0, "drive/cu/p0009"</function>
<if>
<condition>error != 0</condition>
<then>
<break />
</then>
</if>
or
<let name="cu_p978" dim="25" ></let>
<function name="ncfunc.cap.write" return="error"
rows="23">cu_p978, "drive/cu/p0978[0, 1]"
</function>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
119
Generating user dialogs
1.10 Predefined functions
Function name
Description
Ncfunc PI-Service
Jobs can be transferred to the NCK using the program invocation (PI)
service.
If the service has been executed error-free, the function returns the
value 1 in the return variable.
Manipulation of the tool list:
_N_CREATO - Create tool
_N_DELETO - Delete tool
_N_CREACE - Create tool cutting edge
_N_DELECE - Delete tool cutting edge
Activate work offsets:
_N_SETUFR - Activates the actual user frame
_N_SETUDT - Activates the actual user data
Block search:
_N_FINDBL - Activate block search
_N_FINDAB - Cancel block search
Reconfigure machine data:
_N_CONFIG - Machine data with activation level NEW_CONF, which
the operator entered one after the other, are simultaneously activated
Syntax:
<function name="ncfunc.pi_service" return="return
var"> pi name, var1, var2, var3, var4, var5
</function>
Attributes:
name - function name
return- Name of the variable in which the execution result is saved:
● Value == 1 - job executed successfully
● Value == 0 - faulty job
Tag values:
pi name - Name of the PI service (string)
var1 to var5 - PI specific arguments
Easy XML
120
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.10 Predefined functions
Function name
Description
Ncfunc PI-Service Continued
Arguments:
● _N_CREATO
var1 - Tool number
● _N_DELETO
var1 - Tool number
● _N_CREACE
var1 - Tool number
var2 - Cutting edge number
● _N_DELECE
var1 - Tool number
var2 - Cutting edge number
● _N_SETUFR
No arguments
● _N_SETUDT
var1- User data area to be activated
-
1 - Tool offset data
–
2 - Active basic frame
–
3 - Active adjustable frame
● _N_FINDBL
var1 - Search mode
-
2 - Search with contour calculation
–
4 - Search for the block end point
-
1 - Block search without calculation
● _N_FINDAB
No arguments
● _N_CONFIG
No arguments
Example:
Creating a tool - tool number 3
<function name="ncfunc.pi_service">_T"_N_CREATO",
3</function>
Delete cutting edge 1 of tool 5
<function name="ncfunc.pi_service">_T"_N_DELECE",
5, 1
</function>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
121
Generating user dialogs
1.10 Predefined functions
Function name
Description
ncfunc chan PI-Service
The function executes a PI service in a channel-related manner. The
channel number is passed after the PI service name. This is followed by
all other call parameters.
Parameter:
channel - Channel number
Syntax:
<function name="ncfunc.chan_pi_service"
return="error"> _T"_N_SETUFR", channel, …</function>
Example:
<let name="chan" >1</let>
<function name="ncfunc.chan_pi_service"
return="error"> _T"_N_SETUFR", chan</function>
<function name="ncfunc.chan_pi_service"
return="error"> _T"_N_SETUDT", chan, _T"016",
_T"00000", _T"00000"</function>
Ncfunc display resolution
This function supplies the conversion rule for floating point numbers
defined in the control. A string variable must be provided as variable.
See also display machine data MD203 DISPLAY_RESOLUTION and
MD204 DISPLAY_RESOLUTION_INCH
Syntax:
<function name="ncfunc.displayresolution"
return="dislay_res" />
Example:
<let name="dislay_res" type="string"></let>
…
<function name="ncfunc.displayresolution"
return="dislay_res" />
<control name = "cdistToGo" xpos = "210" ypos =
"156" refvar="nck/Channel/GeometricAxis/
progDistToGo[2]" hotlink="true" height="34"
fieldtype="readonly" format="$$$dislay_res"
time="superfast" color_bk="#ffffff"/>
Easy XML
122
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.10 Predefined functions
Function name
Description
Ncfunc Get drive by axis name
This function returns the addressing index of a motor module by spec-
ifying the associated axis name.
Parameter:
str - Axis name
Return value:
Index of the motor module - Name on a variable in which the determined
index is written.
Syntax:
<function name="NCFUNC.GETDRVBYAX_NAME"
return="<index>"><axis name></function>
Example:
<let name="drv_idx" />
<function name="NCFUNC.GETDRVBYAX_NAME"
return="drv_idx">_T"X1"</function>
<control name = "c_do2" xpos = "140" ypos = "114"
width = "320" fieldtype="itemlist" refvar="drive/dc/
p10[do$ drv_idx]" hotlink="true" color_bk="#f1f1f1">
<item value="0">Ready</item>
<item value="1">Quick commissioning</item>
<item value="2">Power unit commissioning</item>
<item value="3">Motor commissioning</item>
<item value="4">Encoder commissioning</item>
<item value="5">Technological application/units
</item>
<item value="15">Data sets</item>
<item value="17">Basic positioning commissioning
</item>
<item value="25">Commissioning the position
control</item>
<item value="29">Download</item>
<item value="30">Parameter reset</item>
<item value="95">Safety Integrated commissioning
</item>
</control>
</init>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
123
Generating user dialogs
1.10 Predefined functions
Function name
Description
Ncfunc Get drive by axis index
This function returns the addressing index of a motor module by spec-
ifying the associated axis index.
Parameter:
index - Axis index
Return value:
Index of the motor module - Name on a variable in which the determined
index is written.
Syntax:
<function name="NCFUNC.GETDRVBYAX_IDX"
return="<index>"><axis index></function>
Example:
<let name="drv_idx" />
<function name="NCFUNC.GETDRVBYAX_IDX"
return="drv_idx">1</function>
<control name = "c_do2" xpos = "140" ypos = "114"
width = "320" fieldtype="itemlist" refvar="drive/dc/
p10[do$ drv_idx]" hotlink="true" color_bk="#f1f1f1">
<item value="0">Ready</item>
<item value="1">Quick commissioning</item>
<item value="2">Power unit commissioning</item>
<item value="3">Motor commissioning</item>
<item value="4">Encoder commissioning</item>
<item value="5">Technological application/units
</item>
<item value="15">Data sets</item>
<item value="17">Basic positioning commissioning
</item>
<item value="25">Commissioning the position
control</item>
<item value="29">Download</item>
<item value="30">Parameter reset</item>
<item value="95">Safety Integrated commissioning
</item>
</control>
</init>
Easy XML
124
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.10 Predefined functions
Function name
Description
Ncfunc Get drive by drive name
This function returns the addressing index of a motor module by spec-
ifying the motor module name.
Parameter:
string - Name of motor module
Return value:
Index of the motor module - Name on a variable in which the determined
index is written.
Syntax:
<function name="NCFUNC.GETDRVBYDRV_NAME"
return="<index>"><drive name></function>
Example:
<let name="drv_idx" />
<function name="NCFUNC.GETDRVBYDRV_NAME"
return="drv_idx">_T"SERVO_3.13:4"</function>
<control name = "c_do2" xpos = "140" ypos = "114"
width = "320" fieldtype="itemlist" refvar="drive/dc/
p10[do$ drv_idx]" hotlink="true" color_bk="#f1f1f1">
<item value="0">Ready</item>
<item value="1">Quick commissioning</item>
<item value="2">Power unit commissioning</item>
<item value="3">Motor commissioning</item>
<item value="4">Encoder commissioning</item>
<item value="5">Technological application/units
</item>
<item value="15">Data sets</item>
<item value="17">Basic positioning commissioning
</item>
<item value="25">Commissioning the position
control</item>
<item value="29">Download</item>
<item value="30">Parameter reset</item>
<item value="95">Safety Integrated commissioning
</item>
</control>
</init>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
125
Generating user dialogs
1.10 Predefined functions
Function name
Description
Ncfunc Get drive by bud address
This function returns the addressing index of a motor module by spec-
ifying the bus address of the motor module.
Parameter:
bus - Bus number
slave - Slave number
component - component number
Return value:
Index of the motor module - Name on a variable in which the determined
index is written.
Syntax:
<function name="NCFUNC.GETDRVBYBUS_ADDR"
return="<index>"><bus>,<slave>,<component></
function>
Example:
<let name="drv_idx" />
<function name="NCFUNC.GETDRVBYBUS_ADDR"
return="drv_idx"> 3,13,4 </function>
<control name = "c_do2" xpos = "140" ypos = "114"
width = "320" fieldtype="itemlist" refvar="drive/dc/
p10[do$ drv_idx]" hotlink="true" color_bk="#f1f1f1">
<item value="0">Ready</item>
<item value="1">Quick commissioning</item>
<item value="2">Power unit commissioning</item>
<item value="3">Motor commissioning</item>
<item value="4">Encoder commissioning</item>
<item value="5">Technological application/units
</item>
<item value="15">Data sets</item>
<item value="17">Basic positioning commissioning
</item>
<item value="25">Commissioning the position
control</item>
<item value="29">Download</item>
<item value="30">Parameter reset</item>
<item value="95">Safety Integrated commissioning
</item>
</control>
</init>
Easy XML
126
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.10 Predefined functions
Function name
Description
Ncfunc Get MD limits
The function copies the limits of a machine data to the specified varia-
ble, data type StructMDLimits. The structure definition is contained in
file struct_def.xml.
Parameter:
range - A string should be transferred that specifies the machine data
area:
● displayMD - Display machine data
● generalMD - NC global machine data
● channelMD - NC channel-specific machine data
● axisMD - NC axis-specific machine data
● generalSettingMD - NC global setting data
● channelSettingMD - NC channel-specific setting data
● axisSettingMD - NC axis-specific setting data
● channelGUD - NC channel-specific user data
● globalGUD - NC global user data
MD-number - Machine data number of the area
variable name - After the function call, this variable contains the value of
the limits
range/unit - Optional (e.g. channel number)
Syntax:
<function name="NCFUNC.GETMD_LIMITS"><range>, <MD-
number, <variabel name>, <range/unit>></function>
Example:
<let name="limits" type="StructMDLimits" />
<function
name="NCFUNC.GETMD_LIMITS">_T"generalMD", 19220,
_T"limits"</function>
<op>
upper_BAGS = limits.upperLimit;
</op>
Ncfunc bico to int
The function converts a string specified in BICO format into an integer
value. (see SINAMICS).
Syntax:
<function name="ncfunc.bicotoint" return="integer
variable">bico-string</function>
Example:
<let name="s_np0480_0" type="string"></let>
<let name="i_p0480_0">0</let>
<function name="ncfunc.bicotoint"
return="i_p0480_0">s_np0480_0</function>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
127
Generating user dialogs
1.10 Predefined functions
Function name
Description
Ncfunc int to bico
The function converts an integer value into a BICO format string. (see
SINAMICS).
Syntax:
<function name="ncfunc.inttobico" return="string
variable">integer variable</function>
Example:
<function name="ncfunc.inttobico"
return="s_p0480_0">"drive/dc/
p0480[0, DO2]"</function>
Ncfunc is bico str valid
This function returns the value zero for a string specified in BICO format.
(see SINAMICS)
Syntax:
<function name="ncfunc.isbicostrvalid"
return="integer variable">string varaible</function>
Example:
…
<let name="s_np0480_0" type="string"></let>
…
…
<control name = "cp0480_0" xpos = "402"
ypos = "76" hotlink="true" refvar="s_np0480_0" >
<property item_data="4001" />
</control>
…
…
<function name="ncfunc.isbicostrvalid"
return="valid">cp0480_0</function>
Easy XML
128
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
Generating user dialogs
1.10 Predefined functions
Function name
Description
Ncfunc password
This function sets or deletes a password level from the NC.
● Set password:
The password should be specified for the required password level
as parameter.
● Delete password:
A blank string deletes the password level.
Syntax:
<function name="ncfunc.password">password
</function>
Example:
<let name="password" type="string"></let>
<function name="ncfunc.password" > password
</function>
<function name="ncfunc.password" > _T"CUSTOMER"
</function>
Delete password:
<function name="ncfunc.password" > _T"" </function>
Control form color
This function provides the text or backg11round color of the dialog box as
a string (color coding see Chapter "Color coding (Page 52)").
Range:
● BACKGROUND - request color value of the backg11round
● TEXT - request color value of the text (foreground)
Syntax:
<function name="control.formcolor"
return="variable">_T"Area"</function>
Example:
<let name="bk_color" type="string"></let>
<function name="control.formcolor"
return="bk_color">_T"BACKGROUND"</function>
Easy XML
Programming Manual, 12/2019, 6FC5397-1DP40-6BA3
129
|