SrcData

Data for the options menu.

The combo box drop-down list can be configured in two different ways:

Engineering

  1. Add a combo box to the interface.
  2. Change the drop-down list for the 'Src Data' attribute of the 'Data' category using the 'Combobox Src Data' dialog
  3. 1. Define the required number of entries and their sequence.
  4. 2. For each of the three entries, assign an ID, a text that is displayed in the drop-down list and the value behind this entry.

Additional Information

A simple list of options can be compiled in the Engineering. Each option consists of these components:

Further, complex data are supported by using Binding for this parameter.

SrcData 1:

The categories (and the display text independent of the value) can be used to easily group the values.

Category A
    Option 1 => valueA1
    Option 2 => valueA2
Category B
    Option 1 => valueB1
    Option 2 => valueB2

Items

List of all objects added

SrcData 2:

Delete the selected object

SrcData 3:

Change the object order (top = left)

SrcData 4:

Add a new object

Category: General

Name

Description

ID

Definition of a freely selectable ID for the list entry. This ID must be unique within the defined entries.

Text

Definition of the text of the list entry

Value

Definition of the value of a list entry

PLC

Array of a structure representing the structure of a list entry

SrcData 5:

The structure elements must be named identically to the attributes defined on the TwinCAT HMI side. Upper and lower case is taken into account.

aComboboxEntries : ARRAY [1..5] OF ST_ComboboxEntry;
TYPE ST_ComboboxEntry:
STRUCT
id : INT;
text : STRING;
value : INT;
END_STRUCT
END_TYPE

Array of a simple data type

aTexts : ARRAY [1..5] OF STRING;
aValues : ARRAY [1..5] OF INT;
  1. Add a combo box to the interface.
  2. Link the array to the 'Src Data' attribute of the 'Data' category

Schema (version 1.8): tchmi:framework#/definitions/ListItemList

Schema (version 1.12): tchmi:framework#/definitions/TcHmi.Controls.Beckhoff.TcHmiCombobox.ListItemList

Attribute getter

public getSrcData(): TcHmi.Controls.Beckhoff.TcHmiCombobox.ListItem[] | any[] | Dictionary<any>;

Parameter

Name

Type

Description

-

-

-

Return value

Type

Description

TcHmi.Controls.Beckhoff.TcHmiCombobox.ListItem[] | any[] | Dictionary<any>, null

The current value of the attribute.

Attribute setter


public setSrcData(valueNew: TcHmi.Controls.Beckhoff.TcHmiCombobox.ListItem[] | any[] | Dictionary<any> | null): void;

Parameter

Name

Type

Description

valueNew

TcHmi.Controls.Beckhoff.TcHmiCombobox.ListItem[] | any[] | Dictionary<any>, null

The new value of the attribute. If null is passed, the internal default value is used.

Return value

Type

Description

void

No return value.

SrcData 6:

Available from 1.8