SCL in S7

userxyz

Member
Join Date
May 2002
Location
any
Posts
2,768
Hi,

I write mostly in STL now, before a year ago I was a ladder man.

@ school I've learned VHDL (higher programminglanguage looking like SCL)

I have no experience in SCL...

When it's better to use SCL instead of STL ?
Can you monitor in SCL like in STL ?
Anyone has a good tutorial ?

Thanks in forward,

Regards,

Gerry
 
SCL - ideal for multi-dimension array processing. Online monitoring shows values in variables as lines of SCL are processed.
 
I'm a STL guy now after learn the way of manupilating DBs and ARs registers which other languages is not able to provide. It also take time to understand the limitation of changing the content of this registers under different situation of FB and FC calls.

SCL is very much similar to C or Pascal. Its a great tool with implementing PID control or matrix handling. But end of day, the SCL editor will convert the compiled codes into STL. To view it in SCL code in STL, please don't double click from Simatic Manager, simply just open it from LAD/STL/FBD editor.

Cheer,
^^
 
the SCL editor will convert the compiled codes into STL
Is this actually correct? I've always had a belief that the the SCL compiler behaves exactly the same as the STL compiler and the S7-Graph compiler etc. They all produce blocks of 'nearly' executable object code which is finally recompiled in the PLC CPU down to machine language. I don't know what form the object code is in (MC7?) but it so happens that the only editor capable of reading these object code blocks regardless of the compiler used to create them is the STL editor. Just because you can view the de-compiled block content using STL doesn't mean it's STL code that's in the block. Or can someone prove that SCL and others do genuinely generate STL instructions? If so, why don't they use better ones!?

Regards

Ken
 
Ken M said:
I don't know what form the object code is in (MC7?)


It is STL, in fact basic without the interface would be numbers that represent the STL. But STL is the very basic form of Siemens code.

SCL, Ladder, Graph7, etc all break down to STL.
 
Here's some "STL" compiled from an SCL block. As you can see, function calls are shown in their basic form as the STL editor does not show them in the nice CALL format you get if the block was created using the block editor. If you try and edit the block and change the parameters to FC193, the STL editor will not let you.

L DIB [AR1,P#762.0]
T LB 14
TAR2 LD 34
TAK
T LD 16
TAK
UC FC 193
P#L 0.3
P#L 13.0
P#L 0.5
P#L 14.0
LAR2 LD 34
A #bLeftFaultDetected
L LB 14
LAR1 LD 16
T DIB [AR1,P#762.0]
 
So

So, any tutorials ?

Or lets say that I want to see this in SCL (it's a start that I need):

A I0.0
X I0.1
= Q0.5

A Q0.5
JCN STP

L 50
T SETP

STP: L 0
T SETP
 
Help me here.
Doesn't L D[AR2,P#0.0]'s example in Post 6 tend to suggest that SCL does not compile to STL? If it did, why wouldn't a simple FC call operation be compiled as the direct STL equivalent CALL? Isn't this indicative that the SCL is in fact compiling to some other code form? And then when you use the STL editor/viewer it's making the best sense of it that it can. And the fact that you can't edit it would also support the theory that the block contents aren't truly STL?

There's another forum I contribute to where one of the regulars has a sign-off "It's not an optical illusion, it just looks like one." I'm starting to feel the same about this issue!

Ken
 
Ken M said:
And the fact that you can't edit it would also support the theory that the block contents aren't truly STL?
I think that the Property "Created in SCL language" causes edits in the LAD/STL/FBD editor to be inhibited. This probably to avoid inadvertently goofing up the SCL code. But you can allways copy-and-paste from the STL view of the SCL code to another block with STL.

And I think that the "basis" code language in S7 is always STL.
STL is like assembly language, and MC7 is like machine code.
 
Ken - from the evidence that I've seen, there is no such thing as a CALL (so to speak) in STL, all calls are actually performed as CC or UC. The STL block editor embeds control codes into the block so that when it is displayed, it is shown as a call with a list of parameters.

Here's some STL in "normal" block editor display (a simple call):

CALL FC 5
IN0 :=L#5
RET_VAL:="dbDataq".DataW
NOP 0

And here is the same code after removing all knowledge of FC5 from the editor:

Call
BLD 1
= L 72.0
L L#5
T LD 73
L 1
T LW 77
L P#DBX 0.0
T LD 79
UC FC 5
P#L 73.0
P#L 77.0
BLD 2
End Call
NOP 0
 
Oh. I get the feeling I should have stopped asking questions slightly earlier. :confused: I'll stick to LAD wherever possible now!!

Ken
 

Similar Topics

HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
81
Hi, I have an intermediate-advance knowledge of programming with TIA Porta in Ladder, would you recommend me to start learning SCL for it to...
Replies
11
Views
559
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 everyone, I am new to this amazing world of PLC, well... I mean, in practice, since I already knew electronics, programming languages, IT, and...
Replies
7
Views
652
Hi all, This is my first post; I am new to PLC Controls stuff and English is not my native language, so I apologize in advance if something is...
Replies
4
Views
512
Back
Top Bottom