Need help explaining tiny section of STL code

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.
 
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...
4
Replies
2,095
Views
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...
4
Replies
3,059
Views
Good day, experts! I am a fresh grad service engineer and I encounter a problem while uploading an existing program, it says I need...
0
Replies
128
Views
Hi everyone, I have an old Modicon PLC program saved as an .FMD file, which was created using FasTrak PLC WorkShop for Modicon. I can open the...
1
Replies
188
Views
How use my compact logic but read and write from the micro820 to the compact logixs with out a hub
4
Replies
322
Views
Top