You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old May 7th, 2009, 03:05 AM   #1
O_P
Member
Sweden

O_P is offline
 
Join Date: Apr 2009
Location: Sweden
Posts: 11
Siemens S7 314, First Scan bit?

Hi!

Is there any "system bits" in siemens PLC's?

I whould like to find a bit that is "1" only in the first scan cycle. Or at the start up of CPU..

I've searched a litle in different manuals and online-help.
But I've only found small instruktions with OB100 and such.

So are there no default system bits for this function??

Regards
OP
  Reply With Quote
Old May 7th, 2009, 03:18 AM   #2
RMA
Member
Scotland

RMA is offline
 
RMA's Avatar
 
Join Date: Sep 2004
Location: North of Hamburg, Germany
Posts: 2,046
Unlike some other PLCs the Siemens CPUs don't have a "first scan" Bit, however, you can easily do it yourself by setting a bit TRUE in OB100, which is automatically run on start-up (or after power up, if the switch is in the RUN position). Then at the end of OB1, reset the bit back to FALSE.

Since it's quite common for programmers to use Bits M0.0 and M0.1 as FALSE and TRUE flags, then M0.2 offers itself as a convenient Bit for the "First scan" flag.

Just be sure that you don't use the same Byte as is used to generate the standard frequency generator Bits - this Byte is defined in the CPU parameters.
  Reply With Quote
Old May 7th, 2009, 06:10 AM   #3
PeterW
Member
Canada

PeterW is offline
 
Join Date: Jun 2006
Location: Edmonton
Posts: 2,486
I usually keep MB0 for the cycle clock.

Usually the first scan bit is used to initialise parts of the program, in Siemens you would usually initialise these parts of the program within blocks called from the start up blocks, this saves having to use up scan time during the normal program sequence.

The only time I have seen a first scan flag used in a Siemens program was where this was used to set up pointers within instance DB's.

Apart from advanced programming such as that, any other thing (such as presetting states etc) can all be done within the OB100 calls.
  Reply With Quote
Old May 7th, 2009, 06:18 AM   #4
O_P
Member
Sweden

O_P is offline
 
Join Date: Apr 2009
Location: Sweden
Posts: 11
Thanks for all your anwers!!

I solved it like this:


OB100:
Code:
      SET   
      S     "First_Scan"
      S     "Always_1"
      R     "Always_0"
      SAVE
OB1: In last Network

Code:
      SET   
      R     "First_Scan"
      S     "Always_1"
      R     "Always_0"
      SAVE
I realy hope this works
  Reply With Quote
Old May 8th, 2009, 07:53 AM   #5
O_P
Member
Sweden

O_P is offline
 
Join Date: Apr 2009
Location: Sweden
Posts: 11
I've change it.. Now i looks like this:

M0.1 = Allways 1
M0.2 = First Scan


OB1:

NW1:
M0.1 M0.2
-|/|---------( )

NW2:
M0.1 M0.1
-|/|---------( )
|
M0.1 |
-| |--

  Reply With Quote
Old May 8th, 2009, 08:35 AM   #6
L D[AR2,P#0.0]
Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 4,896
You should also check that your always 1 and always 0 are exactly as they should be at the end of OB1 - if they are not flag up an error. You may make a typo and accidently modify the always 1 always 0 flags within your program.
  Reply With Quote
Old May 9th, 2009, 10:22 AM   #7
O_P
Member
Sweden

O_P is offline
 
Join Date: Apr 2009
Location: Sweden
Posts: 11
Quote:
Originally Posted by L D[AR2,P#0.0] View Post
You should also check that your always 1 and always 0 are exactly as they should be at the end of OB1 - if they are not flag up an error. You may make a typo and accidently modify the always 1 always 0 flags within your program.

Ah good thinking! Thanks for the advice!
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
bit on special internal S7 200 ? paris LIVE PLC Questions And Answers 4 April 24th, 2009 05:14 PM
Siemens S5 and S7 Dual Masters for Profibus daveswerld LIVE PLC Questions And Answers 15 December 16th, 2008 02:15 AM
Siemens CP343-1 U_SEND & U_RECV and S7 connection protocol Esa LIVE PLC Questions And Answers 6 August 14th, 2006 03:19 AM
New to Siemens S7......and programming scimdarren LIVE PLC Questions And Answers 20 September 2nd, 2005 08:36 AM
cx-supervisor with siemens s7 314 neroni LIVE PLC Questions And Answers 1 July 21st, 2005 01:03 AM


All times are GMT -5. The time now is 10:19 PM.


.