Forum

Notifications
Clear all

[Solved] S7-300 goes to STOP with SF, diagnostics buffer says OB 121 not loaded

6 Posts
4 Users
0 Reactions
83 Views
(@bram99)
Trusted Member
Joined: 1 year ago
Posts: 33
Topic starter   [#210]

Sorry if this is basic. I'm doing an internship at a small workshop and they've let me add a recipe copy function to an old machine. CPU 315-2 PN/DP, STEP 7 V5.6 on the laptop.

Since my change the CPU goes to STOP after some minutes, SF LED on. Buffer says:

"STOP caused by programming error (OB not loaded or cannot be loaded)"
"OB 121 not available"
"Area length error when writing. DB 10, byte address 2048"

My FC uses SFC20 BLKMOV with an ANY pointer that I build from a counter, copied off a forum post. I did a memory reset and loaded everything again and it runs for a while and then stops again. The battery in the CPU is old, might be that? Or is it that ANY pointer, I'm not sure I understand what I copied.


Advertisement

   
Quote
(@jcasey)
Trusted Member
Joined: 1 year ago
Posts: 59
 

> OB 121 not available

That line is the one that matters, not the battery. On a Logix box this would be a major fault with a code and the controller stops the same way. On a 300 it means the CPU hit a programming error and went looking for the block that handles it, which is OB121, and you haven't got one.

What exactly did the change touch? The ANY pointer length, or where it points?


Advertisement

   
ReplyQuote
(@bram99)
Trusted Member
Joined: 1 year ago
Posts: 33
Topic starter  

The pointer. The counter picks the recipe number and I multiply it by the recipe size to get the byte offset in DB10. The length in the ANY I set to 100 words because the recipe is 100 bytes, I thought the length field was in words.

I also thought OB121 was the cycle time OB, that's why I never added it.



   
ReplyQuote
(@sergio74)
New Member
Joined: 2 years ago
Posts: 0
 

OB121 is the programming error OB. Cycle time is OB80. Different things.

Without OB121 a 300 stops on every programming error. That is why it stops. The error itself is your pointer: 100 words is 200 bytes, so the last recipe runs 100 bytes past the end of DB10, byte 2048 in the buffer.

Two fixes, in order. Set the ANY length to match the data type, 100 bytes if the type is BYTE, 50 if WORD. Then add OB121, but not an empty one. Put a small network in it that copies OB121_BLK_NUM and OB121_PRG_ADDR into a DB so the next error tells you where it came from. An empty OB121 hides the error, a logging one shows it.



   
ReplyQuote
(@bram99)
Trusted Member
Joined: 1 year ago
Posts: 33
Topic starter  

Changed the ANY length to 100 with type BYTE, and added OB121 that writes the block number and the address into DB99. Loaded it this morning, ran the recipe copy for all twelve recipes, no STOP.

So my pointer length was in words instead of bytes, the last recipe ran past the end of DB10, and the CPU stopped because there was no OB121 to catch it.

One thing I still don't understand is why it ran for some minutes before stopping, maybe only the last recipe overruns. Thanks sergio74 and jcasey.



   
ReplyQuote
(@plctr_editor)
New Member
Joined: 2 years ago
Posts: 0
 

Retitled with the buffer text, that's what people search for.



   
ReplyQuote
Share: