VAR

Top  Previous  Next

The VAR statement is used to initiate the section where a function, function block, or the main program variables can be declared.

 

Variables that are configurable are declared in the VAR_INPUT/VAR_OUTPUT sections.

 

It is allowed to have more than one VAR section within the same scope.

 

Example:

INCLUDE rtcu.inc
 
VAR
  variable_temp : INT;  
  variable_test : DINT;
END_VAR;
 
PROGRAM Greenhouse_1;
 
BEGIN
  ...
END;
 
END_PROGRAM;