S7-SCL Help

Viks

Member
Join Date
Jun 2008
Location
Hamilton
Posts
157
Hi,

I'm completely new to SCL and have a piece of code which I'm trying to understand by using the help menu but got stuck on a point where there is a jump (JCN) in the code which has A7d0 written next to it. Would someone with SCL programming experience please explain what A7d0 means so I can proceed further. Thanks.

VK
 
JCN = Jump if RLO = 0

A7d0 is the label where the code continues if the jump command is executed.

this is STL syntax though.
 
You must have opened SCL block that you dont have source for in Step 7 v5.

SCL looks like:

Code:
IF #something
THEN
  Different := true;
END_IF;

Then it gets compiled to blocks folder, now if you open this block and dont have SCL source for it, it shows the compiled STL code.
 
Check the source folder within the project tree for the SCL source code of the block you are trying to view.

In S7 V5.x, the SCL editor is a separate program. You cannot edit SCL code from within S7 itself. In TIA portal, the SCL editor is integrated.

Post the code and we can comment each line explaining what it is doing.
 
Apologies for not providing a detailed info in my first post. Actually there are two blocks from two different programs (both programs are for the same equipment but was modified due to some issues) which I'm trying to compare. The original code is compiled in SCL for both but when comparing, I get this message as a result of comparision "Path 2 contains newer version" "Block codes are different. The absolute value of the addresses were compared". I know that the code in the concerned block for path 2 will be different as the code was modified by the OEM due to some issues after operating the equipment for a few months. When I click Go To in the comparion results window, I see this message under the comparion tab "The comparision was performed in STL because of the different programming languages!" When I open the block in path 1 (original code) which is created in SCL, it does give me a warning that the "Block and the SCL source file have different time stamps". The two codes are as follows:

Path 1 (original code)

SET
SAVE
= L 16.1
A #enaSimInBo
JCN A7d0
A #fwCnInBo
O #bwCmInBo
= #feedbackOuBo
SET


Path 2 (Modified code)

SET
SAVE
= L 16.1
A #enaSimInBo
SET
JCN A7d0
A #fwCnInBo
O #bwCmInBo
= #feedbackOuBo
SET


This is just the part of the code where the difference is. The program is for a SEW servodrive which I assume was by-passed in the modified code.
 
If you open the block from Simatic manager, the appropriate editor will open STL/LAD/GRAPH/SCL, however, if you open the block from the STL/LAD block editor, the block will open in STL

fc6.JPG
 
If you then edit the block and save it, you will lose the internal link betwen the block and the SCL source. This is more than likely what has happened.

fc6a.JPG
 
Path 1 (original code)

SET
SAVE
= L 16.1
A #enaSimInBo
JCN A7d0
A #fwCnInBo
O #bwCmInBo
= #feedbackOuBo
SET


Path 2 (Modified code)

SET
SAVE
= L 16.1
A #enaSimInBo
SET
JCN A7d0
A #fwCnInBo
O #bwCmInBo
= #feedbackOuBo
SET
Before someone added the SET, the code after JCN A7d0 would be executed depending on #enaSimInBo. After someone added the SET, the code after JCN A7d0 will be executed always.
I dont think the SCL compiler would have created this code since the JCN A7d0 is now redundant. I think someone has manually added the SET in STL for some reason.
You should investigate what #enaSimInBo does, and if it is used elsewhere in the program.
 
Last edited:
Yes the code was modified by the OEM tech support after some problems on the equipment. This code is for a SEW MoviAxis servo drive which controls the gap between 2 rollers. Until now I was assuming that the SET instruction was added so that the code after that is not executed as the block comment read "by-pass program". I was thinking that it was something like an AFI instruction used in AB controllers. FYI, the servo motor doesnt control the roller gap anymore. Required gap setting was entered via a HMI by the operator. I'll keep looking to see if I can find anything else which will help me solve this issue. The bosses want the servo running again so the operator set the gap from the HMI. Current they have to set it manually, mechanically. FYI, I just started with this employer 4 months ago and dont know what actually happened which made the OEM modify the code. There were no controls personnel working in this department when the code was modified by the OEM and those who were there do not know much about PLC's. This is what is holding me back now as I dont know the root cause of the problem and no one here can explain what actually happened.
 
Last edited:

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
350
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,092
Hi, Can someone translate this for me please, or at least help to explain what the instructions mean? SET SAVE =...
Replies
17
Views
4,639
Hi guys Its been some time since I worked with SCL and have a few lines of code I need some help with, I have the SCL raw code and am currently...
Replies
1
Views
1,509
Working with a SCL instruction and need a little help. The logic is a Heat / Cool circuit controlled by a PID. The PID Zone_4.CVEU tag is coming...
Replies
3
Views
3,177
Back
Top Bottom