Multiple JMP, with One LBL

wanher3

Member
Join Date
Feb 2018
Location
USA
Posts
65
Hello,

Could you have several JMP instructions pointing to one LBL ?
E.g
Rung 1 has: JMP (X1)
Rung 5 has: LBL (X1)
Rung 8 has: JMP (X1)
 
Last edited:
Hello,

Could you have several JMP instructions pointing to one LBL ?
E.g
Rung 1 has: JMP (X1)
Rung 5 has: LBL (X1)
Rung 8 has: JMP (X1)


Not sure what platform you're using, but I've definitely done it before.
 
The answer is definitely YES - multiple JMPs to one LBL is perfectly possible.


Obviously it doesn't work the other way, you can't have multiple LBLs with the same name/reference.
 
The answer is definitely YES - multiple JMPs to one LBL is perfectly possible.


Obviously it doesn't work the other way, you can't have multiple LBLs with the same name/reference.

Does it cause any issues with the scan time or how does it affect the scan time ?
 
Does it cause any issues with the scan time or how does it affect the scan time ?

If you are jumping forwards in the code, it shortens the scan time.

If you are jumping backwards, it lengthens it.

However, if you JMP backwards continuously, (i.e. without a "get-out" clause), you will fault the processor because the scan watchdog timer will time-out.


For repetitive "loops", I prefer to use the FOR instruction, the code executed resides in a separate routine file, and the FOR must terminate at some point
 
If you are jumping forwards in the code, it shortens the scan time.

If you are jumping backwards, it lengthens it.

However, if you JMP backwards continuously, (i.e. without a "get-out" clause), you will fault the processor because the scan watchdog timer will time-out.

How can i prevent that fault to happen ? and how many backward jumps will actually cause the fault ?
 
How can i prevent that fault to happen ? and how many backward jumps will actually cause the fault ?

It depends entirely on how much code you're jumping (and probably on a CPU setting for max cycle time).

The difference between jumping backwards 5 times and 6 times probably won't make a difference, unless you're jumping all the way from the end to the beginning.

In most situations where i've seen looping make sense, there is some calculation/algorithm/sort that needs to be done on an array of data. For an array of 10, that's probably OK. For an array of 1000, you might not like the affect on your scan time.

If the array is too big, it usually makes sense to just sort 1 item (or maybe several items) each scan, until it is all done a few seconds later.
 
It depends entirely on how much code you're jumping (and probably on a CPU setting for max cycle time).

The difference between jumping backwards 5 times and 6 times probably won't make a difference, unless you're jumping all the way from the end to the beginning.

In most situations where i've seen looping make sense, there is some calculation/algorithm/sort that needs to be done on an array of data. For an array of 10, that's probably OK. For an array of 1000, you might not like the affect on your scan time.

If the array is too big, it usually makes sense to just sort 1 item (or maybe several items) each scan, until it is all done a few seconds later.

Thank you.
 
If the array is too big, it usually makes sense to just sort 1 item (or maybe several items) each scan, until it is all done a few seconds later.

take a look at the FAL (File Arithmetic Logical) instruction - and pay particular attention to the MODE setting ...
 
take a look at the FAL (File Arithmetic Logical) instruction - and pay particular attention to the MODE setting ...


FAL is a "do" instruction...


If you are "looking", its sister is the FSC (File Search Compare) instruction ...
 

Similar Topics

This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
140
Compactlogix controller, program has 28 conveyors that use TON's to start the conveyors. The TT sounds a warning horn during start and the DN...
Replies
10
Views
485
I have 9 field devices, three METSEPM5110 power meters and six ACE949-2 rs285 interface modules. I want to read this Modbus rtu data through rs485...
Replies
8
Views
315
I'm trying to use DTM browser to make make modbus poll from RTAC. I'm able to get the points in first poll object. But not able to get anything in...
Replies
1
Views
123
Hello, I encountered a problem with the kinetix 6500 drive, error code s22, loss of 3 phase voltage. After disassembling and replacing the thermal...
Replies
2
Views
164
Back
Top Bottom