Skip to main content

Literals in the Rung

In function blocks, it is also possible to input literal values, as shown in the following figure.

Figure 1 - Program Example

Literal values are those that are not tied to any variable and are entered into the ladder diagram with their explicit value.

In this example, the PT input of the TON block was configured with the literal value 1000.

For literal input, the following conventions must be used:

  • Integer numbers do not have periods.
  • Ex.: 12, 1000, 1555
  • Real numbers must have periods.
  • Ex.: 1.5, 2.25, 3.0
  • Numbers represented in hexadecimal must define the data type.
  • Ex.: BYTE#16#7F, WORD#16#3CF0, DWORD#16#00FF0088
  • Numbers represented in binary must define the data type.
  • Ex.: BYTE#2#1010_0000, WORD#2#0111_0000_0000_0001

WARNING: In some blocks, for data consistency checking purposes, it will be necessary to define the literal data type using specific notation. which will have the following options: BOOL#, BYTE#, INT#, UINT#, DINT#, UDINT#, WORD#, DWORD# and Example: WORD#17321.