FALSE, OFF

Top  Previous  Next

FALSE and OFF are both synonymous for the same thing. They are used when assigning a constant to a variable of the type BOOL.

 

 

Example:

INCLUDE rtcu.inc
 
VAR
  var : BOOL;
END_VAR;
 
PROGRAM test;
 
BEGIN
  var := FALSE; // This sets the variable var to FALSE (the same as setting it to OFF)
  var := OFF;   // This sets the variable var to OFF (the same as setting it to FALSE)
 
  var := BOOL(0); // This makes a typecast on the value 0 (an integer) and assigns it to var (the same as FALSE/OFF)
END;
 
END_PROGRAM;