how to be a Professional Siemens PLC STL programmer

Dear LD,
I am trying to test the STL instructions, just begin to figure out, hope some day I would be
like you ~~ Legend
Could you tell me the way (or experience) that how do you become a "Legend" ~~ I just wanna follow your step to grow up "fast" ~~
 
My advice is to read everything L D[AR2,P#0.0] has posted. I've followed him since I joined and he really knows his stuff.

Yes he has helped me many times with Step7. I was not a big fan of SIEMENS but I don't mind using it now.
Thanks [AR2,P#0.0]
 
Code:
Sum:=0
For i = 1 to n
Sum := Sum  + i
end_for

Never mind just for mine own sake :D

Code:
FUNCTION "SUM" : VOID
TITLE =
VERSION : 0.1


VAR_INPUT
  Max_count : INT ;    
END_VAR
VAR_OUTPUT
  Total : DINT ;    
END_VAR
VAR_TEMP
  count : INT ;    
END_VAR
BEGIN
NETWORK
TITLE =

      L     0; 
      T     #Total; 
      OPN   "DB_SUM"; 
      LAR1  P#DBX 0.0; 
      L     #Max_count; 
sum:  T     #count; 
      L     #Total; 
      L     W [AR1,P#0.0]; 
      +I    ; 
      T     #Total; 
      +AR1  P#2.0; 
      L     #count; 
      LOOP  sum; 

END_FUNCTION
 
Ok here


Code:
 L     0
      T     #Total
      L     1
      T     #temp
      L     #Max_count
sum:  T     #count
      L     #Total
      L     #temp
      +I    
      T     #Total
      L     #temp
      L     1
      +I    
      T     #temp

      L     #count
      LOOP  sum

Hope am on target this time !!
 
Closer, but Total is a dint so +D required. The function is supposed to return the Total, not use an output parameter. How did you plan to test the function ?
 
Took me 2 mins, not much time, snowing here and time to go home. So if it has a minor mistake, don't shoot me, you can figure out the general idea though.

Code:
      L     0
      T     "i"

next: L     "n"
      L     "i"
      ==I   
      +     1
      T     "i"
      L     "sum"
      JC    end
      +D    
      T     "sum"
      JU    next
end:  NOP   0
This one actually goes from 1 to n, not from n to 1 as is done when using a LOOP.
Used MW and MD as it was faster, could've easily used input for "n" and locals for "i" and "sum".
If I understood L D's intentions, this one will also hold the "sum" value in ACCU 1 when exiting the FC. This is what I understood when he said 'Return the value'.

(if you wanna correct it, do it in red.... :D)
 
:confused:

Code:
      L     L#0 //long dec 0 ->accu1
      L     #N  //accu1 -> accu2 #N ->accu1
T:    TAK       //accu1 -> accu2, accu2 -> accu1 
      +D        //accu1 + accu2, accu2 unchanged result to accu1
      TAK       //accu1 -> accu2, accu2 -> accu1
      LOOP  T   //decrement accu1 by one, jump to T
      TAK       //accu1 -> accu2, accu2 -> accu1
      T     #RET_VAL  //accu1 to ret_val

you lazy, didn comment to everyone not as good as you :D
 
yeah i know, i tried to get ppl to think

What i have done with programs i dont immediately understant (eg. dont remember all instructions), i "comment" what is happening on. Then i dont need to use time to read it on help and come back to code.

the point was, "how to become learn stl programming"

not everybody get good at it, i think i have seen term "knak" in here, what it needs? yes?

i have noticed, that as ppl get better in something, they do forget what it was to learn the stuff. Sometimes yours and others posts are pretty cryptic, they forgo ppl that ppl are not at same level with you.

i myself have learned ****load of theory in here. thanks to experienced ppl in here. many times it has been needed for me to take the help, the post and the simulator and test whats happening.

i think it mostly answer to the question is, "are you prepared to do all the hard work to get to you goal" shorter. DO YOU REALLY WANT TO?

as ppl, really, tend to get what they REALLY want. maybe they hit their head on the wall few times, but in the end, they get what they REALLY want.
 
Last edited:

Similar Topics

We just got the link to download and install Siemens Step 7 Pro, v17, and WinCC Comfort v17. My needs usually involve using earlier versions for...
Replies
11
Views
5,275
Does any one have a link to download WinCC RT Professional v15 + Crack???
Replies
19
Views
8,184
Hello, I'm working on TIA Portal v15, and Wincc RT Professional. My Pc works on Windows 10 Pro, and I have installed SQL server 2019. The...
Replies
3
Views
2,748
Are there any problem to use S7 professional 12/2002 version for PLC program development? Also, $700 that I bought this software with single...
Replies
7
Views
3,429
Hello to everyone, I need to comunicate With a Modbus gateway(TCP-RTU)connected throught Modbus TCP/Ip on wincc v7.5 or professional; i will...
Replies
0
Views
266
Back
Top Bottom