Essentially, when you assign a “tag name” (this could be a IO point, a variable, almost anything in Pac Control) to a pointer table index, you are providing the table with the name of an entity like a var or IO point. Whenever you loop in your chart, you “load” the Pointer from the pointer table. The idea being that this iteration of the loop is the next index number of a set of whatever it is you’re trying to manipulate.
I’m not saying you can’t use pointers in other ways, but the primary use of pointers is to have a process that needs to happen over and over but to a whole list of say equipment items.
Lets take a pump control for 50 pumps, all with essentially a similar control scheme. I would assign a pointer to:
and so on until you have essentially every variable you might need to control and monitor that pump. Then you load all these tag names into the pointer table (before you enter the loop) and from that point on, you load each pointer from each associated pointer table (one pointer and one pTable for each variable or control element) using the index number of the loop. This way, everytime your loop iterates, the index changes, and so does all the elements you are now pointing to for that loop iteration.
Now you have one code group that when perfected, does all 50 pump control processes. If you have to fix something, you are fixing all 50 pump logics.
You can also make minor differences inside the loop simply by making an exception based on index number of the loop. Therefore, if this one pump control number 29 needs to have something different, you simply look for index 29, and branch for that exception. It could be a big difference or small, just create a separate branch that handles only that difference.
There are 3 things to remember, when loading the pointer table you need the “&” such as
PumpOn_pTable = &Pump_On_din; in order to load the ptable. In order to reference the pointer or I.E.; use that pointer in the logic as a control element, you need this *Pump_On_ptr. And finally, when you load the pointer, you don’t need anything, just load it such as Pump_On_ptr = PumpOn_pTable[Loop_Index];