Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

in what circumstances "OB1" is not used or not preferred ?

Status
Not open for further replies.

phatcreators

Full Member level 5
Joined
Sep 2, 2011
Messages
315
Helped
24
Reputation
48
Reaction score
24
Trophy points
1,298
Activity points
3,458
in what circumstances "OB1" is not used or not preferred ?

what is OB1 ?

thanks
 

Siemens Simatic programming language supports Organization Blocks (OBs)

The interface between the user program and the operating system is done via Organization Blocks (OBs).
The CPU will call an OB when a special event occurs.
OB1 is the organization block which is called by the operating system during the PLC scan.
This means that OB1 must contain the users program.
The other OBs have permanently assigned numbers based on the event they are called to handle.

http://moorerobotics.com/attachments/File/10_User_Blocks.pdf


Program Cycle Organization Block (OB1)

The operating system of the S7 CPU executes OB1 periodically.
When OB1 has been executed, the operating system starts it again.
Cyclic execution of OB1 is started after the startup has been completed.
You can call other function blocks (FBs, SFBs) or functions (FCs, SFCs) in OB1.

Understanding the Operation of OB1

OB1 has the lowest priority of all of the OBs whose run-times are monitored, in other words,
all of the other OBs except OB90 can interrupt the execution of OB1.
The following events cause the operating system to call OB1:

· The startup is completed.

· The execution of OB1 (the previous cycle) has finished.

When OB1 has been executed, the operating system sends global data. Before restarting OB1,
the operating system writes the process-image output table to the output modules, updates
the process-image input table and receives any global data for the CPU.

S7 monitors the maximum scan time, ensuring a maximum response time.
The value for the maximum scan time is preset to 150 ms. You can set a new value or you can restart
the time monitoring anywhere within your program with SFC43 "RE_TRIGR."
If your program exceeds the maximum cycle time for OB1, the operating system calls OB80 (time error OB);
if OB80 is not programmed, the CPU changes to the STOP mode.

Apart from monitoring the maximum scan time, it is also possible to guarantee a minimum scan time.
The operating system will delay the start of a new cycle (writing of the process image output table to
the output modules) until the minimum scan time has been reached.

Generally, it is recommended to use the OB1
There are some exceptions,
for example, precisely the time-bound program sections
where should consider the use of OB3x (Cyclic interrupts)
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top