3 - 7 3 - 7
3 HANDLING OF CHARACTERS AND NUMERIC VALUES IN ST PROGRAMS
(2) Structure
A structure is a data type defined by combining the data of any types.
Each element can be referred to individually by describing the element name
after the variable (label) name defined for the structure type, with a period (.)
placed between them.
The element name is also called a member variable.
[Format]
Structure name.structure element name
[Image diagram]
When the setting is as follows
Structure name stocking,
Structure element:
One word type Structure element name Unit No
One real number type Structure element name unit price
One character string type Structure element name name of
article
Stocking
100
98.2
"APPLE"
Unit No
Unit price
Name of
article
[Description example]
(* 100 is assigned to structure element Unit No *)
Stocking.Unit No := 100;
(* 98.2 is assigned to structure element Unit price *)
Stocking.Unit price := E98.2;
(* "APPLE" is assigned to structure element Name of article *)
Stocking.Name of article := “APPLE”;
Precaution for use of the member variables of a structure
The number of members that can be entered on the structure variable setting
screen is 128.
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......