Can someone explain this bit of S7 code please?

uptown47

Lifetime Supporting Member
Join Date
Feb 2008
Location
Over there, next to those boxes
Posts
1,146
Hi all,

I'm struggling to understand a bit of code at the very start of an FB.

Code:
OPN DB 100
AN M215.5
L DBW 452
L 1
+I
T DBW 452
= M 215.6

Can someone explain what would cause M 215.6 to come on in this instance?

I've been told that Loads and Transfers don't affect the RLO.

So what is actually happening to M215.6?
Is it on when M215.5 is off?
Or is it on all the time?

There is no preceding code in the FB, this is the first segment.

Many thanks

;-)
 
If you highlight an instruction in the editir and press F1 you will get the help for the intruction. In the help it shows which status bits are affected by the execution of the instruction. "L", "+I", and "T" do not alter the state of RLO so the state of M215.6 is governed by the state of M215.5

Nick
 
Hi Peter,

That makes a bit more sense to me.

There's another bit of code that is similar but I'm also struggling with it. Here it is:

Code:
A T 88
= M 133.6
AN T 88
JC =M002
L DBW 224
T DBW 102
L 0
T DBW 226
= M 133.6

What is influencing M 133.6 coming on in this instance? Is it from the AN T 88 command before the conditional jump?

I can't see why the marker is repeated (ie. being brought on by T 88 and then another use of it at the end of the Loads /Transfers)

Can someone shed light on this for me? Is it just poorly written code or is there something clever happening here that I don't understand?

Many thanks

;-)
 
Taken from the Help file for JC instruction:

"If the result of logic operation is 0, the jump is not executed. The RLO is set to 1, and the program scan continues with the next statement."

So it is the JC instruction that is setting the RLO to 1 for M133.6

Nick
 
It appears to me that the flag is turned on no matter what.

The JC changes the RLO to 1, as taken from JC help

'If the result of logic operation is 0, the jump is not executed. The RLO is set to 1, and the program scan continues with the next statement.'

So if T 88 is ON, the flag is turned on and the Load/Transfer instructions are jumped over.

If T 88 is OFF, the Load/Transfer instructions are done and as the JC set the RLO to 1, then the flag will be turned ON.
 
Thanks for the info on the JC instruction MangleMender and Peter,

Would it not be then that if T 88 is off the Load and Transfer's are 'jumped around' and so the last =M133.6 isn't brought on? And if T88 is on then M133.6 is being brought on at the start and at the end of that bit of code?

In other words, if T88 is on then so is M133.6 and if T88 is off then so is M133.6 ?

*scratches head*...
 
Nick,
I think you're right. I've found another example of a bit being brought on in exactly the same way but it's not being used anywhere else in the program. Its like the programmer maybe dumped a few markers here and there for testing purposes and forgot to remove them?

Still... as long as I know how its working then that's fine.

Thanks for all your help, and thanks to Peter too.

Cheers

John ;-)
 

Similar Topics

Hello all, I have recently been working on a project utilizing Allen Bradley PLC/HMI. It's an L16ER-BB1B PLC and a Panelview Plus 7 HMI. I'm...
Replies
15
Views
5,729
I’m using rslogix5000 v20 with ControlLogix L72. I added some rungs to monitor time meter of our propulsors. But with same ladder instruction I...
Replies
11
Views
4,027
Like the title syas can someone explain to me what motor absorbtion is?
Replies
1
Views
1,057
This is a bit of a rant lol, my first 5 years as a systems integrator was using Siemens, then I came to the dark side of Allen Bradley / Rockwell...
Replies
67
Views
23,794
I'm going to be working on some InTouch and System Platform projects - I've not worked with WonderWare before and am wondering if someone could...
Replies
9
Views
6,813
Back
Top Bottom