1/28/2011 1:51 PM | |
Joined: 10/7/2005 Last visit: 10/9/2024 Posts: 3024 Rating: (1054)
|
Hello Najsel you use a variable called "#loopcounter" as the loop counter at the start of the loop and one called "#loopcntr" at the end, is this just a typing mistake and they are in fact the same variable (which they need to be)? Let's assume they are and lets further assume that you are only calling this piece of logic in OB1, your observation would be correct! What happens is that the value of variable "#test"will be incremented to 100 in the first OB1 scan, followed by a count up to 200 in the secondOB1 scan, followed by a count to 45 in the thirdOB1 scan (its a BYTE which go back to zero once its reachesa value of 255) etc. etc.. All of the above will happen very fast ifyou were to observe the logic online that you may think the loop is doing something wrong when in fact it is working as it should. I hope this helps, but of not please upload your whole S7 project here for evaluation. |
Cheers |
|
This contribution was helpful to1 thankful Users |
6/20/2017 9:08 AM | |
Joined: 9/3/2014 Last visit: 3/13/2019 Posts: 4767 Rating: (123) |
New question published by Siemens- STL? is split to a separate thread with the subject STL, find a minimum value after which it ramps up. Best regards |
Follow us on