Ab Lbl Instruction

HI KEITH
Thanks for the reply sorry I did not see jmp in rung for I thought that jmp is first and lbl is placed in the program after jmp instruction thanks anyway.
 
This method of jumping backwards is useful for a VERY LIMITED and tightly controlled number of times. Otherwise an endless loop could be established faulting the processor with a watchdog timeout. It is generally not suggested and, if the nubmer of repitions is small, just repeat the code.
 
WOW! Talk about doing things the hard way! That code is guaranteed to generate a 3:00 am phone call from Bubba.

It takes bits 2, 3, 4, and 5 from input word I:0.0 and puts them at bits N7:0, N7:1, N7:2, and N7:3 so that a single digit BCD value can be placed in N7:1. It does this by copying the input word to N7:0 and then bit sifting N7:0 right two times with a for loop.

First off, when you want to shift bits right just divide by 2^n where n is the number of places you want to shift. Dividing N7:0 by 4 will shift all the bits in N7:0 right by 2 places. Use the bit shift instruction when you want to shift in a bit.

But in this case the solution is even more simple.

I:0/2 N7:0/0
---] [------------( )----

I:0/3 N7:0/1
---] [------------( )----


I:0/4 N7:0/2
---] [------------( )----

I:0/5 N7:0/3
---] [------------( )----

 

Similar Topics

We're working on a firmware upgrade on a couple of 1756-L55 processors. The processors are currently running v12.x firmware but since we've...
Replies
2
Views
4,684
I understand that when the [JMP] instruction is true, it jumps/skips to the [LBL] instruction. I don't understand how the [LBL] is handeled when...
Replies
8
Views
14,917
In the MicroLogic instruction files under the LBL instruction: Why is it labeled Q and where in the Data Tree can I find these? Can you explain...
Replies
2
Views
3,443
Hello again, Happy New Year. If the bit controlling this subroutine switches off, causing the JMP and LBL instructions to take effect, will the...
Replies
3
Views
328
Hi everyone, I have a series of 8 or 9 subroutines that are not in the main program file (File 2)..they are all consecutively placed in Ladder 11...
Replies
8
Views
411
Back
Top Bottom