Siemens S7/TIA v18: Is there a "first scan" in TIA portal?...

Mas01

Member
Join Date
Oct 2020
Location
Leicester, England
Posts
1,109
Hi, I want to initialise some tags on first scan only. As they are related to wall-clock time, I want to do the initialisation when the PLC first goes into RUN mode, rather than give the tag a 'start up' value in the datablock.

Is there a built-in tag that I can use for this?

I *think* it might be %M0.0 but I'm not sure.

Thanks
 
Go to properties of the CPU.

Go to System and Clock memory

Here you can enable System Memory bits. And then it is possible to select a MB.

Then you have a bit for First scan.
 
For S7-1200/1500 you can activate the system bits. I think you can find them in the CPU properties under "system/clock bytes" or something to that effect. It is described in the dialog what are the merker addresses and their function.
In S7-300/400 you have to use OB100, OB101 and/or OB102.
 
Hi, I want to initialise some tags on first scan only. As they are related to wall-clock time, I want to do the initialisation when the PLC first goes into RUN mode, rather than give the tag a 'start up' value in the datablock.

Is there a built-in tag that I can use for this?

I *think* it might be %M0.0 but I'm not sure.

Thanks


Couple options, in theory:

  • OB1 has an "Initial Call" bit, which the help says is true after startup, or after the OB has been redownloaded.
  • You can activate the system byte, which includes the First Scan bit you mentioned.
  • You can create a startup OB (OB100 by default) which is called as the PLC starts up, before the first call of OB1.
 

Similar Topics

Context: PLC= S7-1212C, HMI=KTP1200 Basic. Hi again, When the "REPORT" button is pressed (on a different screen), it takes the operator to the...
Replies
7
Views
667
Context: PLC= S7-1212C, HMI=KTP1200 Basic. Hi, The operator has reported that, from time-to-time, when he presses the "Generate Report" button...
Replies
5
Views
465
General Question: The PLC and HMI that I've been working on (a laser measurement system) is soon to be transported to the site where it will be...
Replies
2
Views
701
Hi, I'm not sure how to do this... Basically, I want to restrict the user input values for this tag to be in the range 20.001 to 25.0. I...
Replies
17
Views
1,635
Can someone help me with this? I'm no good at SCL - virtually everything I've done so far has been ladder logic. The return value from the...
Replies
13
Views
1,109
Back
Top Bottom