10/14/2010 4:12 PM | |
Joined: 9/27/2006 Last visit: 12/26/2024 Posts: 12314 Rating: (2695) |
Hello Ambrose; The easiest language to do this is SCL, a prgramming language that ressembles PASCAL. And since you are using PCS 7, you must have a license for it on your Engineering Station, so you might as well use it. S7-SCL manual:http://support.automation.siemens.com/WW/view/en/5581793 12.2.1 Overview of Control Statements Selective Statements A selective statement enables you to direct program execution into alternative sequences of statements. Types of Branch Function IF Statement: The IF statement enables you to direct program execution into one of two alternative branches depending on a condition being TRUE or FALSE. CASE Statement The CASE statement enables you direct program execution into 1 of n alternative branches based on the value of a variable. Loops You can control loop execution using iteration statements. An iteration statement specifies which parts of a program should be iterated depending on certain conditions. Types of Branch Function FOR Statement: Used to repeat a sequence of statements for as long as the control variable remains within the specified value range. WHILE Statement: Used to repeat a sequence of statements while an execution condition continues to be satisfied. REPEAT Statement:Used to repeat a sequence of statements until a terminate condition is met. Hope this helps, Daniel Chartier |
Last edited by: dchartier at: 10/14/2010 4:13 PM |
|
This contribution was helpful to1 thankful Users |
10/14/2010 4:15 PM | |
Posts: 183 Rating: (8) |
Hi Ambrose; With this info i would rather make a block (function block)programmed with SCL. SCL is similar to PASCAL and you can use if-else, select/case, for, while, etc... Take a look at this: http://support.automation.siemens.com/WW/view/en/5581793 Regards |
This contribution was helpful to1 thankful Users |
3/27/2012 8:01 AM | |
Posts: 11 Rating: (0) |
After a long read through I have got more than I asked for. I can almost do all that I need in PCS7. Thanks Guys. |
Follow us on