Declaration of a structured data type with partial address in ST
In case of structure elements for a structured data type, it is possible to define a not yet fully specified location (= a partial address).
TYPE
name_1: STRUCT
name_e1 AT %(I|Q|M)* (* optional_begin *) {OFFSET := value} (* optional_end *) : data-type := initial-value;
name_e2 AT %(I|Q|M)* (* optional_begin *) {OFFSET := value} (* optional_end *) : data-type := initial-value;
...
END_STRUCT;
END_TYPE
Meaning of the partial address and of the offset |
|||||||||||||||||||||
Use AT %(I|Q|M)* to assign a partial address to the structure element. The location will be specified in a VAR_CONFIG section, in particular for the variable that has been declared using the structure data type. Details: See "Declaring VAR_CONFIG sections within PLC-object". Enter a partial address according to this structure:
Use the optional attribute OFFSET to define a relative offset after the address. Restrictions
Enhancement to IEC-standard The attribute OFFSET is an enhancement to the →IEC-standard. |
Moreover, logi.CAD 3 allows you to specify additional data for the declaration . See " Defining description, comment or JSON string for variables and data types " for details.
TYPE
MyType1 : STRUCT
Elem1 AT %I* : INT; (* assignment of a not yet fully specified input, no offset *)
Elem2 AT %Q* {OFFSET := 9} : INT; (* assignment of a not yet fully specified output, offset for 'elem2': 9 *)
Elem3 : INT; (* no assignment of a location *)
END_STRUCT;
END_TYPE