How to Use Indexing in PLCs?

Indexing: An address where the data storage location can change; for example, D0Z0: if Z0 equals 0, then D0Z0 is equivalent to D0; if Z0 equals 2, then D0Z0 is equivalent to D2. This is similar to an array.Why use indexing? It simplifies the program, making complex and cumbersome programs easier to manage;For example: Real-time monitoring of indoor temperature changes and displaying the temperature change curve over continuous intervals.Collect the current indoor temperature every second, and refresh the current temperature change curve on the touchscreen every 10 seconds.How to Use Indexing in PLCs?Temperature-Time CurveThe specific program in the Mitsubishi PLC ladder diagram is as follows:How to Use Indexing in PLCs?Simple program for temperature collectionProgram description: D100 is the temperature value (the temperature sensor needs to be calibrated for D100 to display the actual temperature accurately), and indexing Z0 allows real-time temperature changes to be stored in continuous registers starting from D1000. Thus, D1000-D1009 will store 10 sets of temperature values; once 10 sets are full, it will trigger the touchscreen curve refresh register, allowing the temperature changes to be displayed.Why use indexing in such a simple program? It is indeed possible to achieve the same without indexing, but you will find that each line requires assigning values to D1000, D1001, …, D109, which makes the program much larger. When collecting 100 sets, if indexing is not used, the number of program steps will become even more cumbersome. Indexing simplifies the program in certain projects.

Leave a Comment