Navigation:  Programming > Variables >

Literals in the Rung

Previous pageReturn to chapter overviewNext page

In the functional blocks, it is also possible to enter literal values as shown in the figure that follows.

 

Figure 1: Example of Program

Figure 1: Example of Program

 

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

 

In order to enter literals, the following conventions must be used:

 

Whole number has no decimal point.
oE.g.:  12, 1000, 1555
Real numbers with floating point must necessarily have point.
oE.g.:  1.5, 2.25, 3.0
Numbers represented in hexadecimal must necessarily define the data type.
oE.g.:  BYTE#16#7F, WORD#16#3CF0, DWORD#16#00FF0088
Numbers represented in binary must necessarily define the data type.
oE.g.:  BYTE#2#1010_0000, WORD#2#0111_0000_0000_0001

 

wpshelp_common_fig_danger

ATTENTION!

In some blocks, for data verification and consistency reasons, it will be necessary to define the data type of the literal through specific notation that will contain the following options:   BOOL#, BYTE#, INT#, UINT#, DINT#, UDINT#, WORD#, DWORD# and REAL#. Example: WORD#17321