You are on page 1of 4

Presentor: Postrero, Joshua P.

Date of Presentation: October 2, 2020

VARIABLES AND DATA TYPES

• It is the use of exclusively directly represented variables is not enough to create control
programs such as resources, inputs, outputs and memory.
• Data is frequently required which contains specific information and a more complex
nature.
• It can be a specified direct or accessible only via variables.

Symbolic Addressing

• Symbolic Identifier always consists of capital or lower case letters, digits and an
underline.
• An identifier must always begin with a letter or an underline.
• The underline can also be used to render an identifier more readable.
• Several underlines are also impermissible. If the controller supports capital and lower
case letters, then the use of these letters are not significance.
• Symbolic identifiers must not be identical with keywords
• Keywords are words reserved for specific tasks.

Representation of Data

• Within a control program, it must be possible for time values and counter values to be
specified.
• EN 61131-3 (IEC 61131-3) laid down the definitions for the representation of data to
specify:
✓ Counter Values
✓ Time Values
✓ Strings
• The use of individual underlines between the digits is permissible to improve
readability. However, the underline is not significant.
EN 61131-3 (IEC 61131-3) provides different types of time data:
✓ Duration (for measuring results)
✓ Date
✓ Time of Day

• The specification of a time duration consists of an introductory part and a sequence


of time related sections.

• Capitals may also be used instead of lower case letters and individual underlines
inserted for the purpose of better readability.
• Another method of representing data is the use of sequence of characters known as
strings. A String consists of zero or several characters, introduced and ended by a
simple inverted comma.
Data Types

• EN 61131-3 (IEC 61131-3) defines a large number of data types for different tasks.
• A BOOL type variable either assumes the value 0 or 1.

• INT and UINT define integer numbers.


• The range of values of data type INT covers both negative and positive numbers.
• Type UINT variables permit positive values only.
• SINT (Short integer) and DINT (double integer) have smaller or greater range of values
than type INT.
• Data type TIME used to specify time and may contain a time duration.

Variable Declaration

• With the use of data, the right of access to this data must be clearly defined.
• Constructed into individual organization units:
✓ Configuration
✓ Resource
✓ Programs
✓ Function Blocks
✓ Functions
• All variable declarations always start with a keyword which designates the position of the
variable in the organization unit of the controller and end with the keyword END_VAR.
• EN 61131-3 (IEC 61131-3) differentiates between six different types of access to variables
namely:
✓ Input Variables
✓ Output Variables
✓ In-/Output Variables
✓ Local Variables
✓ Global Variables
✓ External Variables
• Input variables are declared with the keywords VAR_INPUT and END_VAR.
• Input Variable - variables specified in this way represent input variables fed externally to
an organization unit. These can be read only within the organization unit.
• Output variables are defined with the keywords VAR_OUTPUT and END_VAR
• In-/Output Variable - variables containing input and output values are permitted through
the use of this keywords VAR_IN_OUT and END_VAR.
• In-/Output Variable - this represents a third option and permits the declaration of
variables, which may be read and used within the organisation unit.
• Local Variable - the variables specified here are local to an organisation unit and can only
be used within. The are unknown in all other organisation units.
• Global Variable – a variable may be globally declared, in which it may be accessed
universally.

You might also like