Programming Vectors
Dear all,
How do i programme vectors in 800XA?If anyone has configured logics which involves vectors then please send me the snapshot of the same
Answers
Not sure what you want to know. Basic vector math is easily programmed in Structured Text.
https://www.mathsisfun.com/algebra/ve...
Have you got a specific problem you need to solve ?
I have attached the snapshot .Please let me know how i can program this .
You can see 19 rows and 19 columns.Say if want to make the columns dynamic then how can i do that using structured text .The rows are fixed .The columns have to be dynamic and it should be changeable.How can i program this .?
OK, so this question has nothing to do with "vectors" - what you want is a variable array size AND the ability to display this on a graphic.
In simple terms No, it doesnt work. Instead, Decide the MAXIMUM number of columns and program for that. Then set the unused columns invisible on the operator graphic. For 2 dimensional arrays, use an X-Y table to hold the data. The operator graphic can easily display the values of the X-Y table paramenters.
You can also use For Next loops (if required) quite safely in this case because the loop size never changes, so your CPU load and memory size never change.
In more complicated terms ....
The PLC can support variable sized arrays, but to do it, you have to create a new array of the right size, copy the old array to it then delete the old array. This is messy, complicated, time consuming and likely to fail by stealing all the remaining memory and crashing the controller when you fail to check for the code creating too many columns. If anything goes wrong in the memory cleanup you will also have horrible problems. Dont do this - it will end in tears.
Also, the HMI cannot display elements from an array.
Add new comment