Need help explaining tiny section of STL code

stayclashy80

Member
Join Date
Jul 2020
Location
raleigh
Posts
76
Hey everyone,

In the middle of deciphering STL code in S7 plc and I'm confused. I interpret the following code to be load the register "#Step" then load a value of "11" into that register then if it doesn't equal 11 then jump to S011. I don't understand the <>I part. How could it not equal 11 if I just loaded it right above? New to STL.

Thanks

STL L and not equal I snapshot.png
 
There are two accumulators (1&2).


When you perform a L #Step, accu1 is transferred to accu2, and Step is transferred to accu1


When you perform a L 11, accu1 is transferred to accu2, and 11 is transferred to accu1


The <>I instruction compares the accumulators.
 
If #Step is not equal to 11, then the RLO evaluates to TRUE and the conditional jump to the label S011 is executed.
If #Step is equal to 11, then JC is ignored,
 
Ah ok I think I get it now. What would be the value of accu1 when performing part of L #Step where accu1 is transferred to accu2? Would that just be a null value?
 
To further explain my question this is how I understand it. For example lets say we are actually on step 20 for the value of #Step

L# Step L11 Step
Value accu1 20 11

Value accu2 ? 20
 
When loading a value (L) you always load to accu1, the value in accu1 gets pushed to accu2.

Code:
[FONT="Courier New"]
instruction           accu1      accu2    RLO
L   #STEP             20         ??       true  // loads 20
L   11                11         20       true  // loads 11, pushes 20
<>I                   11         20       true  //evaluates 11<>20
JC  S011   //jump is executed as RLO is true
[/FONT]
 
ok cool I get it now. Just wanted to make sure I understood that value in accu2 on the first load instruction would be null or unknown.

Thanks guys, much appreciated!
 
L #step - Loads the value in #step into ACC1
L 11 - Pushes the value in ACC1 into ACC2 and loads 11 into ACC1
<>I - Compares ACC1 and ACC2 as integers
JC S011 - Jump Conditional (If the result of the compare is true then jump to
S011)

Jesper has already explained the code operation above. You will have these for each step in your code.
 
If you right click on the RHS whe you are monitoring you can show/hide the registers to help you see what is happening. STANDARD is accu1.

acc1.jpg
 
Oh wow that helps a lot. Thanks L D. Makes it much easier to understand and now I see the value in Accu2 is actually a real number and its what the value was for #Step in the last place it was used in the code.
 

Similar Topics

Hello automation experts, I'm trying to learn about servo axis control in AB ControlLogix PLCs (L33ERMS). Attached is an example of a servo...
Replies
4
Views
1,075
Hello All, I am currently updating an existing vessel that has 6 valves for a customer. I'm new to plc's but picking it up pretty well. I trying...
Replies
4
Views
2,291
I'm fairly new to Rockwell software, I've had some basic training in the past but nothing too advanced. My company and I use Reliable products for...
Replies
11
Views
273
Hi all, I am having issues accessing my Cimplicity software - the site code changed after re-install and I am no longer able to attain a new key...
Replies
10
Views
158
Good day all! Can someone help me with the procedure to update Beijers E700 firmware? The Panel I am working on is firmware 2.04v and I would...
Replies
1
Views
62
Back
Top Bottom