Stl/scl

duckie112

Member
Join Date
Mar 2012
Location
In a cardboard box
Posts
46
Hi, I have a small problem with converting my STL code into SCL to work with my S7-1200 PLC.
Code:
L mw10
L 1000
*I
T mw12
This is the code I want to convert to SCL but don't know anything about SCL actually. All my Function Blocks have calculations similar to this. If someone could help me with this 1 I would appreciate it.
 
Start with the person who ordered the S7-1200 plc:)
I already told he made a bad decision :)
This problem is solved anyway just a simple
"result":=ABS(tag+tag);
But now I got trouble with making this calculation in a SCL code
Code:
  L     MW    78                    //days to hours
      L     24
      *D    
      L     MW    76                    //add current hours
      +D    
      L     60                          //hours to mins
      *D    
      L     MW    74                    //add current minutes
      +D    
      L     60                          //mins to secs
      *D    
      L     "Seconden Up Total"         //add current secs
      +D    
      L     1000                        //convert to ms
      *D    
      T     "Tijd uptime"               //gives result in #time
 
Tijd uptime := (((((((MW 78 * 24) + MW 76) * 60) + MW 74) * 60) + Seconds Up Total) * 1000)

Like that?
As I said, it's easier to convert to LAD.
So far there's nothing you've mentioned that can't be handled with LAD.
 
Tijd uptime := (((((((MW 78 * 24) + MW 76) * 60) + MW 74) * 60) + Seconds Up Total) * 1000)

Like that?
As I said, it's easier to convert to LAD.
So far there's nothing you've mentioned that can't be handled with LAD.
:D yay thank you and i should look into LAD then I normally only program in FBD or STL
So far I got an Pseudo Random Generator aswell. Is that possible to in LAD? If so I should try that 1 out
 
Sorry to the OP for the brief tangent...

Ouch V10.5! Had a big problem with that last week. Did a program compare, failed so I uploaded from PLC. Re checked compare, all ok. Made program modification, re downloaded to PLC. PLC faulted with startup OB NIL_PTR fault. Converted program to V11 and chucked away my V10.5 :cry:

Go V11 SP2 Update 3 and firmware update your PLC's to V2.2 (Online progamming enabled). Have just gone through that exercise last week site wide. It actually feels like the 1200 meets expectations now. Just missing the xref through the DB's but no doubt that will come.
 

Similar Topics

Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
317
Hi! I am working on a project were we will be replacing an 300 CPU with a 1500 CPU and we are working on migrating / converting code. There is a...
Replies
9
Views
1,074
Hi all, I'm currently trying to convert code written in STL for a S7-300 to SCL for an S7-1200. I'm getting stuck trying to address inputs in...
Replies
4
Views
2,653
Hello, I'm working on my master thesis on university. Main goal of it is to compare PLC programming languages in Siemens (LAD, FBD, SCL, STL)...
Replies
30
Views
12,084
Could someone help me to convert following from STL to SCL? AN #PV_EXT_S JC MEAS L #PV_EXT L 1.000000e+000...
Replies
9
Views
2,747
Back
Top Bottom