Z := (X1-A)*Y1+(X2-A)*Y2+(X3-A)*Y3 ... +(X20-A)*Y20;
Ken M said:I would go with JRW on this one (sorry, S7Guy!). This seems to be crying out for SCL.
Douyi, SCL would allow you to write your code almost exactly as a mathematical equation -
Code:Z := (X1-A)*Y1+(X2-A)*Y2+(X3-A)*Y3 ... +(X20-A)*Y20;
Get a copy of the SCL manual from the Siemens web-site and have a look at what commands and structures are available - you'll never write maths in ladder or STL again!
Regards
Ken
No no, if you have tried "reverse polish notation" on HP calculators, then it is quite easy to get into STL math.I would go with JRW on this one (sorry, S7Guy!). This seems to be crying out for SCL.
L X1
L A
-D
L Y1
*D
T tempValue
L X2
L A
-D
L Y2
*D
L tempValue
+D
T tempValue
...
...
...
Do I have any shortcut in learning STL?
Originally posted by Ken M:
Sure you can look at the resulting compiled code decompiled back in to STL but what does that tell you that the SCL doesn't?