Technical Forum

STEP 7 / STEP 7 Lite

SR flip-flop is set to 1 by default

Thread Starter: krneki10   Started: 8/16/2012 2:21 PM   Replies: 11

« Previous thread Next thread »
12» Page 1 of 2 (12 items)
  8/16/2012, 2:21 PM
Joined 8/3/2012
Last visit: 9/14/2012
Posts: 45
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
When I switch to online mode and turn monitor on in Step 7 5.4 SP5, some of SR flip-flops are set on 1 by default although all inputs are set on 0. See attachment for an example. 

This is really driving me nuts, I can't even continue with programming because I have no idea what's wrong.

Thanks for help in advance.

Attachment: sr.JPG  (31 Downloads)

Top
  8/16/2012, 2:28 PM
Joined 8/29/2009
Last visit: 5/5/2013
Posts: 190
Rating:
Rated: Excellent [4.33 out of 5 / rated 3 time(s)]. (3) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 

Could you check in cross-references if this marker bit is used elsewhere (byte/word/doubleword instances)?

Regards
Top
  8/16/2012, 2:35 PM
Joined 8/3/2012
Last visit: 9/14/2012
Posts: 45
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
On the other hand, see this attachment. 

Only OB1 is present online on SIMATIC. Do I still need to check for cross references?

Attachment: sr2.JPG  (18 Downloads)

Top
  8/16/2012, 3:07 PM
Joined 10/7/2005
Last visit: 5/21/2013
Posts: 2354
Rating:
Rated: Excellent [4.26 out of 5 / rated 612 time(s)]. (612) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hello krneki10

as for the problem in you first post (sr.jpg):
Neither the SET nor the RESET input are true, but could it be that I 0.2 was ON for >7 seconds at some stage?
This would then SET (latch) M1.4 ON which of course would remain ON until such time that the RESET (I 0.1) becomes true.    

as for the problem in you second post (sr2.jpg):
The SET as well as the RESET input are ON and the RESET one "wins" in the this case (as you aare using a SR Flip Flop, use a RS Flip Flop if you want the SET to "win", see also <F1> help on the SR and RS Flip Flops for more).

I hope this helps

Cheers

fritz

The advice and opinion given in this thread is that of the author and does not necessarily reflect the views of I S Systems Pty Limited.
To find out how I S Systems can help you with your automation needs please visit www.issystems.com.au.
Top
  8/17/2012, 1:01 PM
Joined 8/3/2012
Last visit: 9/14/2012
Posts: 45
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
I have done some modifications to my program, now all inputs are rather defined as memory bits, for example I0.1 is M0.1, and so on. 

Program actually works, but if SR flip flop will be on 1 when I close program, next time when I will open and run program it will still be on 1 and I will need to manually modify it to 0 in order to get program working. It seems that Step 7 rember values and use them next time. That's not much of an issue if everything according to the plan, but if error occurs in program, then I will have problems next time.

So, my question is, are there any options to force Step 7 to initialize 0 values for all SR before program runs it's first cycle? I remember Omron PLC had that option if you used first_cycle in CX Programmer, where you could set all initial values.
Top
  8/17/2012, 4:27 PM
Joined 9/27/2006
Last visit: 5/21/2013
Posts: 3937
Rating:
Rated: Excellent [4.15 out of 5 / rated 619 time(s)]. (619) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hello krneki10;

OB100 is the "warm restart" OB. See the attachment for more details on restarts factors (from the System and standard functions manual).
In S7-300 CPUs you have only one restart OB, OB100.
Whatever you program in OB100 will be executed once before the start of the cyclic OB1.
So simply set all your SR bits to zero in OB100 and by the time your CPU starts processing the program all your bits will be correctly initialized.

Attachment: S7 startups.JPG  (13 Downloads)

Top
  8/20/2012, 1:52 PM
Joined 8/3/2012
Last visit: 9/14/2012
Posts: 45
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hello,

I put

      CLR   
      =     M      1.0
      =     M      1.2
      =     M      1.6
      =     M      2.1
      =     M      2.2

to OB100. Is that correct?




=== Edited by krneki10 @ 8/20/2012 1:52 PM [GMT ] ===


Top
  8/22/2012, 1:33 PM
Joined 8/3/2012
Last visit: 9/14/2012
Posts: 45
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
That doesn't work. When I switch from STOP to RUN-P mode, nothing gets resetted.sad
Top
  8/22/2012, 2:27 PM
Joined 1/28/2009
Last visit: 5/21/2013
Posts: 2859
Rating:
Rated: Excellent [4.1 out of 5 / rated 394 time(s)]. (394) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
krneki10 wrote:
That doesn't work. When I switch from STOP to RUN-P mode, nothing gets resetted.sad

Hello  ,
It is really difficult to judge without checking source
of your project.The memories may be written in the
first cycles after execution of OB100.

Best regards
Hamid Hosseini

Human beings are members of a whole , In creation of one essence and soul
Sa'adi


Top
  8/22/2012, 3:48 PM
Joined 8/3/2012
Last visit: 9/14/2012
Posts: 45
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
They are all SR flip-flops and none is set to 1 by default.

Please see my whole program attached. I already pasted what's in OB100.

Attachment: OB1 (1).pdf  (19 Downloads)

Top
12» Page 1 of 2 (12 items)
Actions