The Most Powerful PLC Instruction?

What is the most powerful PLC instruction? What instruction or concept is the most powerful when programming any manufacturer’s PLCs? Many people will guess timers, counters, or the set and reset bit instructions. These are all great instructions, but the most powerful is the indirect or pointer instruction.

In PLC programming, pointers, also called indirect addressing,  store or retrieve memory addresses of data or instructions. They are instrumental when dealing with large amounts of data or performing complex calculations. Machine recipes, sequence control, and storage of test results are just a few examples where this powerful PLC instruction is used.

We will examine how indirect addressing works in the Click, Do-More, and Productivity PLCs. You will discover how easily and powerful pointers are when programming. Let’s get started.

Powerful PLC Indirect (Pointer) Instruction

The pointer instruction will give you flexibility when programming. Previously, we discussed the five steps to PLC program development. Using a sequence table is an excellent method to determine the states of each input and output in the PLC as we program our machine. The indirect address can take this sequence table and program it directly. The inputs are compared to an input table. If equal, the output pointer will move the output table value to the physical outputs. Pointers are incremented, and the sequence continues. A comparison instruction is used on the last step, and if equal, the pointers are reset, sequencing the machine over again.

This powerful method will involve changing the input and output tables to change the sequence of operations. Troubleshooting is quickly done because the pointers show you the table value versus the actual input values.
This technique can be seen in the following posts:
Click PLC EasyPLC Gantry Simulator – Video
EasyPLC Machine Simulator Productivity PLC Robotic Cell – Video
EasyPLC Solder Robot Do-More PLC Programming – Video

Once we understand the basic concept of this powerful instruction, we can also use it to store values from a test in a series of registers in the PLC. This is especially useful when the test is quicker than the corresponding communication method.

Stored recipes in the PLC can also be utilized to run on a machine. The indirect pointer will load or keep the corresponding recipe required in the machine.

How many more examples and applications can you think of using indirect pointers? Let me know in the comments below.

Click PLC Indirect Pointer

Indirect addressing is supported in the Click PLC. The manuals refer to this as ‘Pointer Addressing.’ It will utilize the DS registers as the offset value and can be used with the DS, DD, DF, DH, XD, YD, TD, CTD, and TXT data register memory types.
Example:
DD[DS3] – This will point to the address in DD that the DS3 value contains. If DS3 has a ‘145’ value, the address will use DD145. As we change DS3, DD’s corresponding address will also change.

We can copy values to that location (logging) and read values from that location (retrieving).
EasyPLC Palletizing Robot Programming Click PLC – Video
Node-RED can also use pointers, such as in the following data logging example.
Simple Click Data Logging – Video

Productivity PLC Indirect Pointer

We use arrays to handle indirect addressing in the productivity series PLC. A tag name can be specified as the index of the Array.
Example:
Widget Progress (Pointer) – a 1D array
Widget Progress (Pointer_Row), (Pointer_Column) – 2D array

Individual elements (values in the Array) are addressed by their index. (Coordinates (Row, Column)) The address of the above elements in the Array called Widget Progress is Widget Progress (4), (2).
Format: Array Name (Row), (Column)
Note: The row and Column index always begin at 1.
The above array example was a 2-dimensional array. (2D – X and Y) The productivity series PLC can also have a 1-dimensional array. (1D – X)

Since we have only one row in this Array, we would address the element by the column location. In our example, Widget Progress (2) would be the location of the element highlighted.
Format: Array Name (Column)

Productivity 1000 Series
Array Functions Part 1 – Video
Array Functions Part 2 – Video
Array Functions Part 3 – Video

Productivity 2000 PLC Array Functions
Part 1 – Video
Part 2 – Video
Part 3 – Video

Do-More (BRX) PLC Indirect Pointer

Indirect addressing allows an instruction’s memory address to be varied when running to point to multiple locations.
All of the data blocks in the CPU can be used as arrays. This includes the ones that you can define yourself. The array index must be in the range of 0 to 65535 and must be stored in the V memory location.
Example:
In this example, we use V0 as the pointer in the Array. Its value ranges from 1 to 6. We are using the instruction Move V[V0] to V100.

The following posts have further information on indirect addressing:
EasyPLC Simulator Robotic Cell BRX Do-More PLC – Video
Here is a Method that is Helping PLC Programmers to Program Faster
Building PLC Program that You Can Be Proud of – Part 1

Indirect addressing, or pointer instruction, is the most powerful instruction in PLC programming. It stores or retrieves memory addresses of data or instructions, which is extremely useful when dealing with large amounts of data or performing complex calculations. Pointers provide programming flexibility and can be used for machine recipes, sequence control, and storage of test results. They can be easily implemented in Click, Do-More, and Productivity PLCs. Indirect addressing can take a sequence table and program it directly, comparing inputs to an input table and moving output table values to physical outputs. This method involves changing input and output tables to change the sequence of operations. Troubleshooting is made easy because pointers show table values versus actual input values. Indirect addressing can also be used to store values from a test in a series of registers in the PLC and to run stored recipes in a machine.

Watch on YouTube: The Most Powerful PLC Instruction?

PLC Beginner’s Guide to PLC Programming
There are many different PLC manufacturers with other hardware and software. All of the programmable logic controllers have similar basic features. Here is how I would approach learning about basic PLCs.
Once you are familiar with the basics of the PLC, you will then learn specifics for the controller you will be programming.
This is the easiest way to learn about PLC programming.

Here are the controllers that we have covered or are covering at ACC Automation:
Arduino Opta PLC
BRX Do-More Series (Do-More Designer Software + Simulator)
Productivity Series  P1000  /  P2000
Click PLC Series
Omron CP1H Series
Horner XL4 PLC Series

EasyPLC Software Suite is a complete PLC, HMI, and Machine Simulator Software package. See below to receive 10% off this software. This PLC learning package includes the following:
Easy PLC – PLC Simulation will allow programming in Ladder, Grafcet, Logic Blocks, or Script.
HMI System – Easily create a visual human-machine interface (HMI)
Machine Simulator – A virtual 3D world with real-time graphics and physical properties. PLC programs can be tested using the EasyPLC or through other interfaces. (Modbus RTU, TCP, etc.)
Machine Simulator Lite – Designed to run on Android Devices.
Machine Simulator VR – Virtual Reality comes to life so you can test, train, or practice your PLC programming.
Purchase your copy of this learning package for less than \$95 USD for a single computer install or less than \$110 USD to allow different computers.
Receive 10% off the investment by typing in ACC in the comment section when you order.
Learn PLC programming the easy way. Invest in yourself today.