PLCs

PLC Structures and Arrays 275

This class overviews structures and arrays in PLC software. Structures and arrays are complex data types that contain multiple tags. Structures contain multiple tags of different data types and are used to organize related tags. PLC software includes some predefined structures, such as timers and counters, and allows users to create custom structures called user-defined data types (UDTs). Arrays contain multiple tags of the same data type and are used to both organize and manipulate data. Arrays can have up to three dimensions, allowing users to track the relationships between multiple variables at once. Arrays are also used to move, compare, and alter large amounts of data using fewer program instructions.

.

After taking this class, learners will understand the basic features of structures and arrays. They will also be familiar with common uses of structures and arrays in PLC programming. These skills are fundamental for operating and troubleshooting PLC software.

  • Difficulty Intermediate

  • Format Online

  • Number of Lessons 12

  • Language English

Take the Next Step in Workforce Training

Talk with a Tooling U-SME specialist about class options and pricing.

1.866.706.8665

Contact Form

Course Outline
  • Complex Data Types
  • Structures
  • Common Predefined Structures
  • User-Defined Data Types
  • Nesting in UDTs
  • Review: Structures
  • Arrays
  • One-Dimensional Arrays
  • Two-Dimensional Arrays
  • Three-Dimensional Arrays
  • Data Manipulation with Arrays
  • Review: Arrays
Objectives
  • Distinguish between structures and arrays.
  • Describe structures.
  • Describe common predefined structures.
  • Describe how to create a user-defined data type.
  • Describe nesting complex data types inside UDTs.
  • Describe arrays.
  • Describe how elements are arranged in 1D arrays.
  • Describe how elements are arranged in 2D arrays.
  • Describe how elements are arranged in 3D arrays.
  • List common data manipulation functions with arrays.
Glossary
Vocabulary Term
Definition

Accumulated value

A value programmed into a counter or timer instruction that lists the current item counts or units of time that have accrued during a process. The accumulated value changes with each item counted or with each unit of time.

Add

A set of instructions that tells a PLC to add two input numbers. Add functions can be applied to multiple elements within an array.

Arrays

A complex data type that contains multiple tags of the same data type. Arrays allow operators to perform complex data manipulation using fewer instructions.

Average

A number expressing the central or expected value within a set of values. The average of a set of values is equal to the sum of the values divided by the number of values in the set.

Axes

An imaginary line or circle that is used to define the position of an object in space. The linear axes are the X, Y, and Z axes of the Cartesian coordinate system.

binary digits

The smallest unit of information on a computer. Binary digits, or bits, consist of 1s and 0s.

BOOL

Boolean. A single-bit data type that uses 1 for true and 0 for false. BOOL data is used for many common PLC functions and for all Boolean logic operations.

Boolean

BOOL. A single-bit data type that uses 1 for true and 0 for false. Boolean data is used for many common PLC functions and for all Boolean logic operations.

Cartesian coordinate system

A numerical system that describes the location of an object by expressing its distance from a fixed position along three perpendicular linear axes, the X axis, Y axis, and Z axis. The Cartesian coordinate system is used to program machining positions on a CNC machine.

Character

CHAR. An 8-bit data type that stores individual characters from the American Standard Code for Information Interchange (ASCII). Characters from ASCII include common numbers, symbols, and English language letters.

Comparison functions

A set of instructions that tells a PLC to compare pieces of data to one another. Common comparison functions include equal, not equal, greater than, and less than.

Complex data type

Multi-part data types that are made up of groups of tags. Complex data types include structures and arrays.

Control structures

A predefined structure that contains all the tags needed to control sequencers and data manipulation instructions. Control structures typically have two DINT members and three BOOL members.

Copy

A set of instructions that tells a PLC to copy elements from one array and move them to another array. Copy functions may be called move block functions depending on the PLC software.

Count-down bit

Data in a count-down counter instruction that is set when the counter instruction rung is true. The count-down bit causes the accumulated value to decrease by one.

Count-down counter

CTD. A counter instruction that decreases the current count by one each time the input logic transitions from false to true on a rung. Count-down counters start counting at the preset value and count down to the accumulated value.

Counter structures

A predefined structure that contains all the tags needed for a counter instruction. Counter structures typically have two DINT members and three BOOL members.

Count-up bit

Data in a count-up counter instruction that is set when the counter instruction rung is true. The count-up bit causes the accumulated value to increase by one.

Count-up counter

CTU. A counter instruction that increases the current count by one each time the input logic transitions from false to true on a rung. Count-up counters typically start counting from zero until the accumulated value matches the preset value.

CTU

Count-up counter. A counter instruction that increases the current count by one each time the input logic transitions from false to true on a rung. CTU instructions typically start counting from zero until the accumulated value matches the preset value.

Data manipulation

The process of moving, comparing, or altering multiple pieces of stored PLC information. Data manipulation often uses arrays to handle large amounts of data using fewer functions.

data manipulation function

Sets of instructions that tell a PLC to move, compare, or alter multiple pieces of stored data. Common data manipulation functions include move block, fill block, bitwise logic, and stack functions.

Data type

A designation for a data file that specifies both the bit size and how the data is interpreted by the PLC. Data types may be elementary or complex.

Dimensions

A virtual direction that represents the number of indexes applied to an array of data. Each dimension represents an index used to locate a single piece of data within the array.

DINT

Signed double integer. A 32-bit data type that can store positive and negative whole numbers. DINT data has a range of under -2 billion to over 2 billion.

Divide

A set of instructions that tells a PLC to divide one input number by another. Divide functions can be applied to multiple elements within an array.

Done bit

Data in a counter or timer instruction that is set when the instruction meets the programmed values. Done bits function differently for counter instructions and timer instructions.

Element

A component tag within an array. Elements within an array all have the same data type.

Elementary data types

A set of basic data types for PLC tags described by the standard IEC 61131-3. Elementary data types are designed to store specific kinds of information, such as integers, characters, or bit strings.

Enable bit

Data in an instruction that is set whenever the instruction is active. Enable bits are used for timer and sequencer instructions.

Error bits

Data in an instruction that is set whenever the instruction encounters an error. Error bits may indicate different types of problems depending on the instruction.

First-in, first-out

FIFO. A stack function in which the oldest piece of data within an array is retrieved first. First-in, first-out functions retrieve data in the same order in which it was stored.

greater than

A set of instructions that tells a PLC to determine whether one input number is greater than the other. Greater than functions can be applied to multiple elements within an array.

Index

A system for ordering and indicating specific elements in a data array. Indexes determine the position of elements within an array.

Index numbers

A series of numbers that indicate the position of an element within an array. Index numbers, also called subscripts, have a number for each dimension of an array.

Inventory management

A systematic approach to sourcing, storing, and selling inventory. Inventory management keeps raw materials and products adequately stocked.

Last-in, first-out

LIFO. A stack function in which the most recent piece of data within an array is retrieved first. Last-in, first-out functions retrieve data in the opposite order in which it was stored.

Member

A component tag within a structure. Members of a structure may be elementary or complex data types.

Mixing

An industrial process in which materials are combined. Data for mixing applications is commonly grouped together in a UDT.

Move block

A set of instructions that tells a PLC to copy elements from one array and move them to another array. Move block functions may be called copy functions depending on the PLC software.

Multiply

A set of instructions that tells a PLC to multiply two input numbers together. Multiply functions can be applied to multiple elements within an array.

Nesting

Placing one complex data type inside another complex data type. Nesting is common with UDTs, which may contain predefined structures, arrays, or other UDTs.

One-dimensional

1D. A data array organized by a single index. One-dimensional array elements have one number to indicate their position on their one dimension.

Overflow bit

Data in a count-up counter instruction that is set whenever the counter exceeds a maximum value. The number that triggers the overflow bit is determined by the data type of the accumulated value.

PLC

Programmable logic controller. A processor-driven device that uses logic-based software to control machines and processes. PLCs are used in industrial automation.

Predefined structures

Structures with a predetermined set of members. Most PLC software includes several predefined structures.

Preset value

A value programmed into a counter or timer instruction that lists a target number for the instruction to reach. Preset values for timers indicate an amount of time that must elapse.

Programmable logic controllers

PLCs. A processor-driven device that uses logic-based software to control machines and processes. Programmable logic controllers are used in industrial automation.

Quality rate

The percentage of good parts out of the total number of parts produced. Quality rate is calculated by dividing the number of acceptable products by the total number of produced products.

REAL

A 32-bit data type that can store numbers with up to 6 significant digits after a decimal point. REAL is a signed data type that can store positive or negative numbers.

Scrapped

Discarded, recycled, or otherwise destroyed. Parts must be scrapped if they do not meet official part specifications.

Sequencers

A function block that controls a process through a defined series of steps, one at a time, in a specific order by following programmed sequencer instructions. Sequencers can be used to streamline ladder logic and save memory to reliably repeat cycles of actions.

Signed double integer

DINT. A 32-bit data type that can store positive and negative whole numbers. Signed double integer data has a range of under -2 billion to over 2 billion.

Specifications

A description of the essential physical and technical properties of a part. Specifications, sometimes called specs, include information on the shape and tolerance of a part as well as required mechanical and physical properties.

Stack functions

A set of instructions that tells a PLC to store and retrieve data in an array in a specific order. Common stack functions include FIFO and LIFO.

Standard deviation

A number representing the degree of variation within a numerical set. The lower the standard deviation, the less variation appears in the dataset.

Structures

A complex data type that contains multiple tags of different data types. Structures group together tags related to the same machine or process.

Subscripts

A series of numbers that indicate the position of an element within an array. Subscripts, also called index numbers, have a number for each dimension of an array.

Subtract

A set of instructions that tells a PLC to subtract one input number from another. Subtract functions can be applied to multiple elements within an array.

Tag list

A display of all the tags in a PLC program. The tag list, also known as the tag table, shows key information about each tag, such as name, scope, data type, description, and constant or variable status.

Tags

A user-defined name and description assigned to memory locations in tag-based PLC systems. Tags replace the numeric file addresses of older PLC software.

Three-dimensional

3D. A data array organized by three indexes. Three-dimensional array elements have a three numbers to indicate their position in each dimension.

TIME

A 32-bit data type that stores measurements of time elapsed. TIME stores lengths of time as a number of milliseconds.

Timer off delay

TOF. A timer instruction that delays turning off an output device a specific amount of time after an input device turns off. Timer off delays can be used to automatically stop processes after a certain amount of time.

Timer on delay

TON. A timer instruction that waits to turn on an output device after receiving an on signal from an input. A timer on delay instruction may be used as a safety feature.

Timer structures

A predefined structure that contains all the tags needed for a timer instruction. Timer structures typically have two TIME or DINT members and three BOOL members.

Timer-timing bit

Data in a timer instruction that is set when a timer instruction is timing and has not reached the programmed values yet. The timer-timing bit and the enable bit may be active at the same time.

TOF

Timer off delay. A timer instruction that delays turning off an output device a specific amount of time after an input device turns off. TOF instructions can be used to automatically stop processes after a certain amount of time.

Two-dimensional

2D. A data array organized by two indexes. Two-dimensional array elements have a two numbers to indicate their position in each dimension.

UDTs

User-defined data types. A custom structure where the user specifies the number of members and the data type of each member. UDTs are added to the list of potential data types when creating a new tag.

Underflow bit

Data in a count-down counter instruction that is set whenever the counter falls below a minimum value. The number that triggers the underflow bit is determined by the data type of the accumulated value.

User-defined data types

UDTs. A custom structure where the user specifies the number of members and the data type of each member. User-defined data types are added to the list of potential data types when creating a new tag.

Variables

A value or number that changes. Variables for PLC functions may come from input devices or other programming functions.

Vision system

A collection of advanced optical components that collects data and forms an image, which is interpreted by a computer. Vision systems can be used to measure and inspect manufactured parts using the collected image data.