Siemens SCL uploading

moelsayed

Member
Join Date
Jan 2016
Location
mi
Posts
41
Hi,

Please I want to know if it is possible to upload SCL code from siemens PLC or not.

and what is the best way to get the SCL code from running CPU?

Thanks

Moelsayed
 
You can upload function created in scl - it's compiled to stl. But without scl source file it will be hard to figure out what is doing.
 
As adFox says, the SCL is a compiled language and there are no decompiler’s (to my knowledge) to regenerate the SCL source from the STL.
 
Depends on the complexity of the program code. When you have a function or function block with only simple operations, then it's you it's relatively easy to manually restore the original source code. An example which is relatively easy to restore, is the source from the Siemens library Cont_c PID FB.

It gets more complicated, when there were used UDTs/structs, At-views, more than one dimensional arrays or external datablocks. Structs or AT-views can't be restored. Some SCL control structures (For / Repeat) will generate the same IL code, so you can't determine which one was used in the original code.
 
Won't be scl though
Why do you think it's not SCL?
If it's worth to decompile, and you want to spend more than 10 minute, than it's possible. You can compile your SCL code back to IL and compare the code, and you can get 100% concistency. Compared to decompiling x86 Assembler back to C, IL/SCL is much more easier.

I've written a primitive SCL decompiler which detects the basic blocks and builds me some graphs for the control flow. This helps a little bit. See attachement for a simple for loop with continue.

graph-for-cont.jpg
 
Maybe sometimes it's good, not understanding all details of the english language ;-)

I won't share the complete code, but if someone has a precise question about a problem, I will always help.
And you'll gain a lot of knowledge if you understand how a compiler works.

There are people out there who think, they don't need password protection, they simply write the code in SCL an no one will get the code back.
 

Similar Topics

Hello, When you want compare values of an array to a range of numbers is it a right way to do that? FUNCTION ADD VAR_IN_OUT A:ARRAY[1..50]...
Replies
5
Views
2,071
Hi All, I need to try and convert some code from Siemens SCL (TIA16) over to Allen Bradley RS5000. I have attached an image of the SCL and what...
Replies
10
Views
4,056
in the scl code written in screenshot Line 1 condition is false but still the program checking the line 2 condition and says it is true i had...
Replies
3
Views
1,759
I am new to PLC programming. Is there a standard way to incorporate alarms / warnings / events such as the exceptions in C++ or Java where you can...
Replies
5
Views
1,972
Hello All, I am new to programming with Tia Portal and I am having difficulty with something that we have found "easy" in other programming...
Replies
3
Views
2,379
Back
Top Bottom