6-3
Constants (Literals)
This section describes constants.
6-3-1
Constants
The value of a variable changes depending on the data that is assigned to that variable. The value of
a constant never changes.
Unlike variables, constants are not stored in memory. You can use constants in the algorithm of a POU
without the need to declare them.
Constants have a "data type" in the same way as variables.
6-3-2
Types of Constants
The following types of constants can be used with Safety Control Units.
• Bits
• Numbers
• Bit strings
• Times
The following tables show the notation to define different constants for the Safety Control Unit. The
constant is normalized after it is entered.
Bits
Notation Example Remarks
TRUE or FALSE FALSE or TRUE
{data_type}#{numeric_value} bool#0 or bool#1 Data type: BOOL
Numbers
l
Integers
Notation Example Remarks
{data_type}#{base}#{numeric_val-
ue}
int#10#1
• Data type: int or dint
• Base: 2, 8, 10, or 16
The editor on the Sysmac Studio does not
show the base of 10. Values entered as the
base of 8 are converted to decimal num-
bers.
• Numeric values cannot be signed (+ or
−).
{data_type}#{numeric_value} int#1 This is interpreted as decimal data.
{numeric_value} -100 This is interpreted as SAFEINT or SAFEDINT
data.
6 Programming
6 - 19
NX-series Safety Control Unit User's Manual (Z930)
6-3 Constants (Literals)
6
6-3-1 Constants