7/13/2014 7:17 PM | |
Posts: 8946 Rating: (999) |
Yes, theydo also. Same thing S and R and Jumps.... |
7/13/2014 7:25 PM | |
Posts: 8946 Rating: (999) |
? I dont think so. |
7/13/2014 9:51 PM | |
Posts: 69 Rating: (0) |
Could you clarifie a bit more ?
|
7/13/2014 10:01 PM | |
Posts: 69 Rating: (0) |
I have written a simple program in STL the purpose of it is to exercise my new limited skills. The program controls a ATS panel and a generator to turn on and off, i have attached the file and would be thanksfulif you could give me your thoughts and adivce. Thanks in advance
AttachmentOB1.pdf (116 Downloads) |
7/14/2014 9:15 AM | |
Posts: 8946 Rating: (999) |
PLEASE Use a new network for any allocation. |
7/14/2014 9:23 PM | |
Posts: 5225 Rating: (1185) |
Hi Mishal11. Please find attached a sample code piece that represent the code structure I think you aimed for originally. The image was created in Step7 for TIA.. you will not have the "%" signs in your version of Step7. The LAD and converted STL version are shown. What I saw in my mind for the coding looks different from how the code actually turned out. My comments on execution speed is not true for the reasons I had in mind for. You will see in the STL converted code some NOP commands. These are placeholders for the full functionality of the timer as seen in LAD. You can leave these no-operations out and the code will still execute correctly - BUT the coding will then not be able to convert back to LAD. NOP commands does take some of the scan time to scan over, but it is a very small period. I think you will find it interesting how the "(" and ")" was used in the attached example. w |
7/14/2014 9:27 PM | |
Posts: 5225 Rating: (1185) |
- - - about your code... Purely out of an academical point of view, you could have done the following structure.. [code]// Global time value L S5T#4s // Check if I0.0 is held for a while A I0.0 SD T0 // Check if I0.1 is held for a while A I0.0 SD T1 //..will use 4 seconds again because Acumulator did not change // Switch Q0.0 if either timer is ON, but not if both A T0 X T1 //..simple bit XOR, not directly available in LAD = Q0.0 [/code] Note the time value is loaded once but re-used. That is possible because the accumulator is not updated with another value and the coding is in one network. In the following code the accumulator is again re-used: [code] L #value //smaller than 5 L 5 <I = #M1 //equal to 5 ==I // accumulators still in place = #M2 //bigger or equal to 10 TAK // swap accumulators.. as if "L #value" L 10 >=I = #M3 // value is between 6 and 9 AN #M1 AN #M2 AN #M3 = #M4 [/code] ------- IBN-Service is giving you deep rooted advice - I am going to add to it. STL is a very powerful tool. You can create very effective coding with it. There is however a danger too. You must be very aware of how the code will be handled and executed; it is very easy to make a slip-up. As an example, if you split the coding to more networks, there In this days you should consider also how much understandable and readable your code is. When using multiple netwroks, you force yourself to (hopefully) document smaller portions of your code. It does not help you designing very clever code that you can not even follow yourself in 3 months' time. If you have to make an analasys of such code just to understand what it does.. your clever code waisted your time when a breakdown comes. The rules change however when you design code for interrupts.. there your code should be as effective as ever. I very much liked using STL coding. Using SCL instead has however other advantages. There are web pages where you could get coding for solving some problem that is easily converted to SCL. Having said that, I'd rather use LAD or STL when coding timers. I hope you find these thoughts helpful. w |
Last edited by: William B. at: 7/15/2014 12:04 PMwording strike through Last edited by: William B. at: 7/14/2014 9:30 PM |
|
This contribution was helpful to1 thankful Users |
7/14/2014 10:17 PM | |
Posts: 69 Rating: (0) |
You used the Nesting option to isolate the timer so that the signal from the (A I0.0) is not terminated by the timer. Very kind of you |
7/14/2014 11:42 PM | |
Posts: 5225 Rating: (1185) |
Yes the parenthesis "(" and ")" does isolate the contents in the sense you understand. It has the same functionality as with math functions. Talking about "isolation" there exists all sorts of pitfalls however. [code] A I0.0 L MW10 T MW12 [/code] .. regardless of what the value of I0.0 is, the LOAD function will be executed. The code should be something like.. [code] A I0.0 JCN next L MW10 T MW12 next: NOP 0 [/code] If you are really into using STL.. Read this topic [LINK] --- TIA Portal is software Siemens has develop as a general engineering framework. Two of the more common components are Step7 and WinCC. Step7 for TIA Portal will replace Step7 V5.x. TIA Portal with Step7 Basic and WinCC Basic is used by people that only design for S7-1200 PLCs and Basic panel types. Step7 Professional handles the newer S7-300 and S7-400 as well as their replacement S7-1500. Not all S7-300 / 400 PLCs can be engineered with TIA Portal. More details as to this subject is beyond the scope of your thread. know however there is much to be said on the TIA Portal subject. That is all from me for now.. Greetings. w |
7/15/2014 9:39 AM | |
Posts: 5225 Rating: (1185) |
Thanks for that! VKE >>> RLO >>> Result of Logic Operation Example.. [code]Network 1 A I0.0 A I0.1 Network 2 A I0.3 = Q0.0 [/code] Q0.0 will come on when I0.0 and I0.1 and I0.3 is ON, because the RLO state in network 1 is not "terminated" in a coil. The same can be true when using a jump function.. but some jump function can change the RLO state. IBN-Service , did I translate your statement correctly? Thanks. w |
7/15/2014 10:41 AM | |
Posts: 8946 Rating: (999) |
Yes, I think so. |
This contribution was helpful to1 thankful Users |
7/15/2014 12:08 PM | |
Posts: 5225 Rating: (1185) |
..added is an example of results that can carry over the network boundary. >> be careful on how you code your STL. w |
7/15/2014 12:40 PM | |
Posts: 8946 Rating: (999) |
|
Follow us on