VAR_OUTPUT

Top  Previous  Next

The VAR_OUTPUT statement is used to initiate the section where a function block, thread block, or the main program output variables can be declared. If the VAR_OUTPUT section is used in the main program, variables declared within this section can be configured from the configuration dialog. Variables declared in the VAR_OUTPUT section can only be written from within the program and not read.

 

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

 

Example:

INCLUDE rtcu.inc
 
VAR_OUTPUT
  variable_temp : INT; | This is a variable that can be configured from the configuration dialog
  variable_test : DINT; | This is another variable that can be configured from the configuration dialog
END_VAR;
 
PROGRAM Greenhouse_1;
 
BEGIN
  ...
END;
 
END_PROGRAM;