[?]: Step 7: set initial values on OB100

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Post Reply
krneki
Posts: 21
Joined: Fri Jun 24, 2011 8:56 am

[?]: Step 7: set initial values on OB100

Post by krneki » Wed Aug 22, 2012 1:30 pm

How could I set initial values in Step7 SIMATIC Manager which would run before OB1?
I heard that could be done with OB100, so I inserted there:

Code: Select all

CLR 
= M 1.0
= M 1.2
= M 1.6
= M 2.1
= M 2.2
But that unfortunately doesn't work.
When I switch from STOP to RUN-P mode, nothing gets resetted.

Thanks for help in advance.

Guille
Posts: 32
Joined: Fri Oct 03, 2008 2:17 am
Location: America

Re: [?]: Step 7: set initial values on OB100

Post by Guille » Wed Aug 22, 2012 2:11 pm

Try using in OB100:

SET
R M 1.0
R M 1.2
...

it should work

there are another OB available for a different method of startup, such as OB101 and OB102, you can try using that OBs too

greetings
Last edited by Guille on Thu Aug 23, 2012 2:33 am, edited 1 time in total.

krneki
Posts: 21
Joined: Fri Jun 24, 2011 8:56 am

Re: [?]: Step 7: set initial values on OB100

Post by krneki » Wed Aug 22, 2012 4:36 pm

Why did you put SET to code as well?

Here is what I put into OB100 just in case:

Code: Select all

      CLR                               //=0
      =     M      1.0
      =     M      1.2
      =     M      1.6
      =     M      2.1
      =     M      2.2
      =     Q      0.1
      =     Q      0.2
      =     Q      0.3
      =     Q      0.4
      =     Q      0.5
But it still won't put them to 0 if I switch CPU from STOP to RUN-P :( . Perhaps I should put something to OB1 as well?
Is there any way to diagnose why this doesn't work?

You can see my program here: http://www.qfpost.com/file/d?g=EaOJFEy48

CoMod
Site Admin
Posts: 3975
Joined: Thu Feb 16, 2006 3:25 pm
Location: Russia
Contact:

Re: [?]: Step 7: set initial values on OB100

Post by CoMod » Wed Aug 22, 2012 6:32 pm

STOP
RUN
OB100 // Reset/Set to 0 only 1 time (< 1 ms)
Image

MainProgram: OB1 // Set/Reset by Logic
Image
,,,
GoTo MainProgram

Guille
Posts: 32
Joined: Fri Oct 03, 2008 2:17 am
Location: America

Re: [?]: Step 7: set initial values on OB100

Post by Guille » Thu Aug 23, 2012 2:41 am

krneki im sorry i dont know what hapened with the code y didnt see the preview before posting.
I corrected the post,
you have to put in OB100

SET

R M 1.0
R M 1.2
R M 1.6
R M 2.1
R M 2.2
R Q 0.1
R Q 0.2
R Q 0.3
R Q 0.4
R Q 0.5

the set put the RLO to "1" and then de R clear the bit (R M1.0 ....).
If fou need to set one bit at startup you can use S (for instance S M1.0) instead of R

I used this code in some programs and works OK.

Sorry for the mistake

good luck

krneki
Posts: 21
Joined: Fri Jun 24, 2011 8:56 am

Re: [?]: Step 7: set initial values on OB100

Post by krneki » Thu Aug 23, 2012 1:43 pm

Hello,

your solution works, thank you very much :wink:

Post Reply