abhinaykdn1
How do we declare and initialize arrays in OpenPLC Editor and use it's values in a loop by incrementing the indices of the array in a Ladder Logic Program?
Quote 0 0
thiagoralves
You can declare arrays by selecting "Array" as the variable type on the variables list window. Once you select "Array", a new window will appear asking for the array dimension. Use the IEC 61131-3 nomenclature for array dimension. For example, if you need to declare an array with 20 positions, the dimension can be [1..20] or [2..21], etc.

To work with arrays and loops, I rather write the code in Structured Text instead of Ladder Logic. I've attached a small example that does that. This is a little program to control the level of a water tower. The level is read by a sensor that gives a lot of noise, so I created a little functionBlock to "filter" the noise by just calculating the arithmetic mean (average) of the last 20 values. You can take a look at the filtering functionBlock to see how it works.
Quote 0 0
Sumit
Hello,

I am trying to open this file (Water_Tower) in open PLC, but it is showing error that "folder doesn't contain any project"
please tell me how to open this file in open PLC

Thanks
Quote 0 0
thiagoralves
This project uses the old format. Create a new blank project, save and close it. Then replace the plc.xml file with the water tower .xml file on the download and open the project again
Quote 0 0
Sumit
Hello,

I followed the steps as you mentioned here, but it still giving error "Invalid project"
Quote 0 0
thiagoralves
Here it is
Quote 0 0
Sumit
Thanks
Quote 0 0