How to monitor a variable increaseing or decreasing?

S7PP

Member
Join Date
Sep 2010
Location
Toronto
Posts
134
Dear experts, I think my brain is not working now. I'm using siemens Step 7, I think of this for 2 days now without an answer, please help~~

If there is a variable (Real value), it's going up and down all the time. I want to create two BOOLs to indicate this variable value is increasing or decreasing. How should I do that? I'm planing to scan this variable every 100ms.

Thanks a lot.
 
Sorry I forgot to tell that I'm using Step 7 with LAD, FBD, STL; but I'm not using SCL.
I'm not able to do this now.

If it's equal then both BOOLs come to FALSE.
 
Im sure you understand what that means. But here is for stl:

Code:
L OldValue;
L Value;
<R ;
= Up;
>R;
= Down;
T OldValue;
 
Code:
L "OldValue"
L "NewValue"
<R
= "Bigger"
>R
= "Smaller"
T "OldValue"
Replace Bigger and Smaller with Increase, decrease if you'd like.


EDIT: Lol turpo sniped me with the exact same code. :D
 
Well, I don't really understand,but I will try it.

I think you Load the value twice in the same scan, the "OldValue' and the "NewValue" should be the same.

It looks like won't work to me.

I will try and see the result. Thanks a lot Turpo and Jeeds. I'll post the result.
 
Well a lot of it depends on how you are implementing the 100ms scan of the variable.
This part of the code needs to be done right after each scan. If you let it run at every PLC scan cycle, then no, it won't work.
 
Thanks guys, it works. I made a piece of LAD code, which is working too, but much bigger than yours.

I like STL better now.
Thanks~~
 

Similar Topics

Hi all, Im just Simatic S7 beginner. So I just made a small connection and try to force all IO in My PLC project. I made Viriable table and I put...
Replies
2
Views
1,474
We have a quad monitor setup with FT SE and we are utilizing a header screen at the top of every display. when we open a new page we abort the...
Replies
0
Views
93
Our plant manger/my boss wants each line to display the takt time above the line. I am trying to research the cheapest way to do this. Our plant...
Replies
3
Views
187
Hi Folks, Looking for support and ideas. We are trying to go online to monitor/fault find on an S7-300 programmed with TIA Portal V15. I can...
Replies
9
Views
351
We finally replaced our Cognex Checker with an IV-3 and I'm wondering if can replace the s/w in the monitor with anything else. I haven't been...
Replies
0
Views
100
Back
Top Bottom