Organization Blocks

Top  Previous  Next

 

Organization blocks (OB) are always called by the operating system. Within a real PLC plenty of OBs are existing which are called at the most different events. In TrySim only five OBs are called by the operating system: the OB 1, 2 and 3 as well as the OB 35 and the OB 100. You are able to program more OBs although you have to call them explicitly, however.

 

1        OB 1

OB 1 contains the main program. Every time the simulation of the machine is finished, this block is called. When the OB 1 is executed the simulation of the machine is started again. OB 1 normally calls mainly functions and function blocks. However you can also program quite normal in OB 1. Small programs that do not need any structure are completely programmed in OB 1 which is the only block of the program then.

 

2        OB 100

OB 100 is the start-up block. Here initializations are done and in a real PLC special modules are prepared. In TrySim the OB 100 will be executed if you start the program for the first time or after you have reset the PLC by the menu item PLC|Reset PLC.

 

3        OB 2 and 3

Here you can program operations that are only needed for simulation.

If you program an activity check for contactors, for example, this will signal errors permanently without taking precautions. To avoid this just program in the OB 2 or OB 3 that the check input will always be set if the output is set as well.

 

The OB 2 is processed before the OB 1, the OB 3 after it. Of course you do not have to export these blocks to STEP®7 with your program.

 

4        OB 35

The OB 35 is accessed in fixed intervals of the virtual time. You can adjust these intervals in PLC|CPU-Properties|Interrupts.

 

In organization blocks you can declare Temporary variables, as in all other code blocks.

 

See also:

Functions

Function Blocks

 

STEP®7 is a registered trademark of the Siemens AG.