Technical data
Creating STL Source Files
13.7 Examples of STL Source Files
Programming with STEP 7
298 Manual, 05/2010, A5E02789666-01
13.7 Examples of STL Source Files
13.7.1 Examples of Declaring Variables in STL Source Files
Variables of Elementary Data Type
// Comments are separated from the declaration section by a double slash.
VAR_INPUT // Keyword for input variable
in1 : INT; // Variable name and type are separated by ":"
in3 : DWORD; // Every variable declaration is terminated with a semicolon
in2 : INT := 10; // Optional setting for an initial value in the declaration
END_VAR // End declaration of variables of the same declaration type
VAR_OUTPUT // Keyword for output variable
out1 : WORD;
END_VAR // Keyword for temporary variable
VAR_TEMP
temp1 : INT;
END_VAR
Variable of Data Type Array
VAR_INPUT // Input variable
array1 : ARRAY [1..20] of INT; // array1 is a one-dimensional array
array2 : ARRAY [1..20, 1..40] of DWORD; // array2 is a two-dimensional array
END_VAR
Variables of Data Type Structure
VAR_OUT // Output variable
OUTPUT1: STRUCT // OUTPUT1 has the data type STRUCT
var1 : BOOL; // Element 1 of the structure
var2 : DWORD; // Element 2 of the structure
END_STRUCT; // End of the structure
END_VAR