First Scan bit???

Latzi

Lifetime Supporting Member
Join Date
Nov 2007
Location
Brisbane
Posts
118
Hi,

I've posted quite a few questions in the last 2 weeks or so trying to understand Step 7 .I have a PLC programming background for AB,GE,OMRON,MITSUBISHI.Now in all PLC programming languages there is a bit called "First Scan".By the looks of it Siemens is different again and the HELP is not helpful again.I think if the guys from Siemens could make that help system just a bit more user friendly they would take a good chunk of the market share for themselves as as far as I saw the software is quite powerful but for a newbie like me is very hard as you have to know certain things.It is impossible to find out from the help.Anyway my problem is this:
In have program which works perfectly machine comissioned no problems.However when I turn power off from the machine(and PLC) by the looks of it certain bits from addresses like M0.1,M0.0,MO02 etc stay on when the power is restored.They remember their last state and when the PLC is powered back again I can have strange and unexpected movement if the power was lost when the machine was in a particular state with those control bit on true state.So I will need to reset all those bits on the first scan.When I tried to do this I had the unpleasant surprize to find out that there is no first scan bit but there are a series of OB's you can use but that is unclear as well for me.I did read the help on this and they managed to confuse me totally with all those hot warm cold restarts.I don't even know what they exactly mean.What is happening when you lose power for ex. and then the power comes back?? What kind of restart that will be? Hot? Cold? warm? or it depends where the keyswitch is on that moment??/?
Also let's say if the PLC is in RUN mode when power is lost when is back can I use the OB101 RESTART Block??? If yes do I have to call it from my OB1? Or is executed automatically once for 1 scan ?So I can set a bit M1.1 FOR EX in that OB101 and reset it at the end of OB1?? Do I get it right? Could you help me please.Many thanx
 
Fairly simple, no first scan bit is needed.
In your hardware configuration make sure the M0.0 to M0.x bits are NOT retentive.(A whole range can be set as such)
All you have to do is uncheck the check mark.
 
Yes, with Siemens you have to generate your own first scan bit.
With an S7-300 you program a bit to be set in OB100, then reset it at the end of OB1.

You don't have to call OB100, it runs automatically any time the processor restarts. I only have experience with S7-300, and a Warm restart is the only option I get with the processors I've used (mainly 315-2DP). When the PLC restarts for any reason, OB100 runs first automatically, so this is where you set/reset any initial conditions.

Does the program already have an OB100? Or any of the M bits causing you problems being set in there? Most programs I've seen set a first scan bit, an always on bit, and an always off bit in OB100. Theses have usually been using low memory bits (i.e. M0.0 for always off, M0.1 for always on, M0.5 for first scan). There may also be another memory byte designated as a clock byte (MB1 is typical for programs I've seen). Each bit in this byte will toggle at a predeined frequency.

There can also be items defined as retentive in the hardware configuration. Open the hardware configuration for the project, double-click on the CPU row and look around on the tabs on the dialog box that opens. (I don't have STEP 7 available right now can't tell you exactly what tab to hit)

With an S7-400 I think you get the Warm/Cold/.. restart options. Depending on the type of restart it may be other blocks that start first (OB100, OB101, (not sure for the 400))
 
I am using STEP 7 Lite over there I don't have an option to chekc unchek any individual memory bits.So because I already written the program I have only 2 options.
1 Make the range of retentive memory between MB0 to 0 which will give me no retentive memory bits at all.Which is good from my point of view as if there is a power outage I want the machine to go dead and react only on external I/O.
2 Make up the first scan bit so I reset only the bits which are of interest to me if they were "captured" true when the outage happened.
Which one you recommend.Also would you be nice in two rows explain to me what is the story with the hot,cold,warm restarts? And if you use the OB101 do you have to call it from OB1 or it executes anyway for 1 scan?? Thanx
 
And there is another big mistery surrounding a CPU 313C with onboard I/O.WHen I downloaded the program first time it downloaded ok but every time i go online I get on STEP7 Lite the hardware error red circle on top of green square.And when I try to check the online file with my offline one the CPU's are exactly the same.I don't have any I/O card or power supply with this CPU.Everything is inbuilt.When I change something in the program and try to download I get the error as in the picture.So what I have to do is close the program Step7 reopen it go online then download only the OB1 which I changed.I cannot do a full download.??? Why?

siemsns_error.JPG
 
OB100 = Warm restart => Normal start. Retentive memory retains values, rest is resetted
OB101 = Hot restart => Only in S7-400. Process image will not be cleared, the machine will continue from where it stopped. Dangerous imo
OB102 = Cold restart => Resets all retentive memory, loads all DB's with initial values.

S7-300 can only use the OB100
S7-400 can use all 3. (except the H-system which cannot use OB102)

OB10x will be the very first part of your program that runs when PLC is powered up. And it will run only once.

I'd use the rewire option to replace your currently used memory range to a range outside the retentive memory.
 
So when I am online I cannot access that dialog box to uncheck the retentive memory nor can I download it from my PC to the CPU because of the error on the above picture.Picture which is a nonsense for me as the very purpose I am trying to download for is to change the online system hardware config.How can I do it when I cannot access it when I am online with the CPU but I cannot access that dialog however the machine and the PLC work beautiful.But I have some sort of error which will prevent me to disable the retentive memory.Unless there is another way.If not silly as it sound I will have to program in a first scan bit and reset all "dangerous" bits.
 
Guys,

🍻 🍻 🍻
Things are becoming clearer now.I understand I think.The only problem I have is that error message and why the PLC CPU 313C runs happily but when I go online I have the red circle on top of green square? So I can't access the hardware config screen to disable the retentive memory alltoghether as that would be the easiest fix.5 seconds fix.To rewire I will need to see how rewire works first.As I said I can write code and make sure the logic works because of my solid PLC background but with these features like rewire I have no experience so it is time to try I guess.I'll try right now with SIMU.
 
Did you try not going online and then transfer the HW-Config?

I haven't used S7 Lite before, but I can tell that the red circle when you go online is because there are differences between the offline and online HW-Configuration. (Deducted from the red circle also being next to the Hardware)

Close all online windows/apps/whatevers, then try to download again.
 
OK.Rewire is cool.Except that I loose all my description for the tags.Symbol names as they are called in Step7.Can this be avoided.Like transfer the symbol name to the new rewired address??
 
Hi Jeebs,

I tried that as well.Didn't work.But the funny thing is that this is whay I MUST download to make the error go away but the sofware won't let me.
 
I use Step 7 PRO as well, no experience with Lite.
Can you make all changes offline (hardware configuration, programming blocks and such), recompile the entire project and attempt to download again?
Since you have the code, try clearing the CPU via the key switch.Be carefull though!! It will wipe out "everything". Then try loading your new project.
You should be good to go.
 
I've tried that as well.Clear everyrthing with reset switch and it doesn't work.However I can download the OB's.What I don't understand is how is it possible that after I cleared everything with the swtich and try to download I have this error so I cannot download the HW config but only the porgram.Looks like the CPU still remembers the HW config I downloaded the very first time.Since that I wasn't able to do a full download including HW.wHY??
 
Clueless!
Does the MMC somehow load the "pre-existing" program?
Can you "reset", keep the CPU is STOP Mode after a master reset and try writting to the MMC?
 

Similar Topics

Hello. Does anyone know the equivalent of the first scan bit in a L32ER compactlogix? Do o need to obtain it via GSV? I’m looking to regain...
Replies
3
Views
451
I want to know how to make a flip flop rung that will change states every scan. This is for a fast sequencer. Is there a special bit similar to a...
Replies
8
Views
2,183
Dear Sir, Can you please tell me how to use the first scan bit, S2:1/15 in RsLogix 500 to Prevents the latch output to be ON when the power...
Replies
22
Views
10,237
hello all, I am trying to set up a latch bit like this S:FS----- true condition------OTL. I tried in rs emulator and it the bit latches but in...
Replies
13
Views
1,840
Do we have to enable the first scan bit somewhere in compact logix? For some reason my S:FS is not working? Also, if you want to have the CPU...
Replies
13
Views
6,789
Back
Top Bottom