Mantainance of a value

karofilakis

Member
Join Date
Oct 2010
Location
iraklio
Posts
5
Sorry for my english

in my s7 project , i have a global variable (as an input in i0.2) named "m35.over_load"
in the function fc2, i have a local variable named #over_load as bool
when i push the buton i0.2 the m35.over_load = 1 and something is done in the fuction (stops the motor)
when i realease the buton i0.2 the m35.over_load = 0 and the motor should start to run but under contitions that have to do with the previus status of m35.over_load (1)
how i can transfer the value of m35.over_load when is 1 in the local variable #over_load whithout this change when the m35.over_load is 0 ???

When i push the buton i0.2
m35.over_load ---> 1
#over_load ------> 1

when i realese the buton i0.2
m35.over_load ---> 0
but i want steel
#over_load ------> 1

how i can do this ????????

Thanks in advance
 
Use the positive and negative edge functions.

FP = Positive Edge
FN = Negative Edge

A M35.over_load
FP i0.2
S #over_load

A #over_load
FN i0.2
R m35.over_load

When you first press the button, i0.2 goes False to True, and triggers the SET. If the #over_load is set, and you release the button, i0.2 goes True to False and triggers the reset of just the M35.over_load. #over_load should remain unchanged.

Hopefully that works, and I'm not leading you in the wrong direction. I'm not 100% fluent in Step7 or STL. I've only ever used the (P) instruction in LADDER and not STL.
 
As over_load is a temp variable in a FC you cannot store its value between calls. Either convert the FC to an FB and use the stat area for over_load, or change over_load from a temp variable to an in_out variable. When you call the FC you assign over_load an M flag or global DB bit or a stat if calling the FC from an FB.
 

Similar Topics

I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
10
Views
254
I want to set user security level based on the value of a tag in my PLC called "ActiveUser". That tag will contain the A-P code which we use for...
Replies
6
Views
207
hello. In Intouch, I want the color of the alarm window in the header menu to change depending on the priority value of the tag. To do this, I...
Replies
0
Views
81
I have a Type C to RS485 adapter connect to my Siemens RWF55. I use modscan to scan it to get a value from the Siemens controller. In the...
Replies
4
Views
102
I'm pretty new to PLC's, so forgive me if I use the wrong terminology and whatnot. We have an issue at work where we have a flow meter that is...
Replies
10
Views
291
Back
Top Bottom