S7 Jump labels

Werner

Member
Join Date
Apr 2005
Location
IJsselstein
Posts
336
I'm using labels to jump to in Siemens STL software. I programmed the labels for future use, so they were never used to jump to. (I am still in the process of creating the software). I saved and closed the block. Later when I reopend the block all the unused labels were removed. I think thats nice when my software would have been finished. Now I have to retype all the jumps and save it when all jumps are used. Is there some kind of syntax checking function which is resposible for this automatic correction. If so, can I (temporally) disable it?

:unsure:
 
Yes, I've had this problem as well. I never did get to the bottom of it.

I particularly wanted each network in OB1 to be labelled to make it easy to skip over bits of the program during testing, but as soon as I commented out a jump to allow normal running of that bit of the program, if I stored the program, the label was gone!

I eventually solved the problem by creating a network with a list of JCs to all the labels and testing my M_FALSE bit which is never true.
 
I am not sure if i can understand the problem right but
why do not u add // before the label
this will be considered as a comment and will be saved if u close the block
 
Amr Hassan said:
I am not sure if i can understand the problem right but
why do not u add // before the label
this will be considered as a comment and will be saved if u close the block

You are right if I change the jump to comments the jumps will not disappear. This could be a work around the problem solution. Off course I could also program the jumps anyway. I just wondered if I could turn off this kind of auto correction.
 
why do not u add // before the label
this will be considered as a comment and will be saved if u close the block



This is true, but it means you've now got two things to comment out instead of one and if the Block has a lot of networks, finding the right one can be a bit of a pain.
 
As far as I know, there isn't a way to turn this off. When I will be programming jumps later, I'll just set up the jump destinations with NOPs, i.e.:

m001: NOP 0
m002: NOP 0
m003: NOP 0

and so forth.
 
a m 2.0
jc M001

M001: s M 3.0

In the program above M001 will not be removed because the jump is used (JC M001). If there is no JC (or JCN/JNB etc) the M001 before the set instruction will be removed. This is kind of logical because the label is not used and therefor not needed.
 
S7Guy said:
As far as I know, there isn't a way to turn this off. When I will be programming jumps later, I'll just set up the jump destinations with NOPs, i.e.:

m001: NOP 0
m002: NOP 0
m003: NOP 0

and so forth.

This will not work. The program below will prevent removal:

A always_off bit
JC m001
jc m002
jc m003

Safe the block without the jumps, close the block and reopen it, then all unused jump labels are removed. Safe the block with the jumps and the labels are kept.
 
Last edited:
Why not? Could you show a case where it won't work?


Maybe this is a 300 / 400 difference.

In my 317 unused labels disappear leaving the NOP 0 behind.

The program listed by Werner is exactly the solution I came up with to solve the problem.
 
Man, I need more sleep. I was reading the question wrong. Yes, the best way is to just add "scratch" jumps that you can add logic to later, and insert the markers whereever you want. That is commonly done to build jump lists that have large numbers of possible steps that will be filled in at a later time.
 

Similar Topics

Hi all! I have a client requesting quotation for us to install a jump box for remote updating of 3 Siemens S7-300 PLC's using Simatic Manager...
Replies
10
Views
2,545
Good Evening , I have a Powerflex drive that has been running steady at about 39 Hz for years , but is beginning to swing 39.6 Hz , 40.5...
Replies
7
Views
2,832
New to rslogix 5000 and factorytalk view me. Where do I find the Jump to Display #?
Replies
7
Views
1,877
I am accustomed to segregating my program in subroutines in RSLogix 500 and 5000 using the JSR instruction. I assumed the JUMP instruction was...
Replies
15
Views
6,852
Hello Everybody, I have a big problem and I'm currently stuck in how to solve it. I'll try to make it clear as much as I can but any question is...
Replies
2
Views
4,346
Back
Top Bottom