4/5/2019 10:46 PM | |
Joined: 9/27/2006 Last visit: 4/27/2025 Posts: 12347 Rating:
|
Hello Med_selmi; Think of the control systems that the PLC replaced, historically. Plants would have hard-wired relay panels, where the address of each input and output was completely known at "programming" time, and the logic was connected by wires. The relay logic included contacts, switches, times, counters... that needed to be used in a known physical position (from the electrical plans of the control panel) and connected through electrical signals.This is what our friend mindware had in mind with his description of a "static" program: changing a control logic meant disconnecting and connecting the control relays, and could not be done on the fly. https://en.wikipedia.org/wiki/Relay_logic When PLCs replaced the relay logic panels, they were based on microcontrolers, and added to the relay logic (which you can understand has been retained in Ladder Logic programs) the programming capacities of digital computers. This included higher-level programming, and the use of pointers. https://en.wikipedia.org/wiki/Pointer_(computer_programming) As you can see in the Wikipedia definition, a pointer is used in a computer program to store the address of a memory location, instead of the value contained at that memory location. This allows the programmer to choose a specific memory register where he needs to start an operation, and then use following memory locations designated by an offset. A special register (AR1, for example) is used to point to a special memory location which was not known at the time the program was designed, and it is loaded with the pointer to that memory address. Then by using special instructions (known collectively as indirect addressing), it can be programmed to point at a lower or higher address, and used to execute operations there. Pointers are used in many different programming contexts. FIFO tables are a very useful application: before you choose tit you do not know where in memory the first register of the table is situated; you use a pointer to set it at execution time. Then you want to shift all the adresses of the table one memory address lower so you can copy the new value of the FIFO table in the start position. Very difficult to program with relay logic, especially since you have no idea where the table begins before you program it, on a computer it is easy to understand and develop. Loops, memory and data copy and many other operations depend on pointers and indirect addressing in PLCs. You can find more and better information on the subject from this article frpm plcdev.com: http://www.plcdev.com/siemens_s7_indirect_addressing Hope this helps, Daniel Chartier |
This contribution was helpful to
5 thankful Users |
Follow us on