In previous articles we started discussing different Organization blocks of TIA Portal PLCs, we talked about what OBs are, and we discussed some of the OBs like OB1- Main cyclic, OB10, and OB20 the time of day delay and time delay interrupts respectively. In this article, we will talk about the OB100 or the startup organization block in Siemens Tia Portal.
Contents:
OB100 or the startup OB is an organization block that is called and executed by the operating system once at the startup of the PLC, meaning once each transition from STOP to RUN mode.
The main cycle OB1 will not be called and executed until all startup functions inside OB100 are executed.
You can have more than one start-up OB in your PLC logic if that happens then the operating system will call and execute all of them one by one starting from a lower OB number to a higher number. I.e. if you have OB100 and OB123, then OB100 will be called and executed first then OB123.
After the OB100 is executed the operating system will read the input modules into the PII and starts the main cycle program OB1.
You use OB100 for a lot of tasks that you might want or need to perform before you start your cyclic logic, for these reasons are:
Even if you haven’t created a startup OB for your logic, the operating system still has many tasks that it needs to execute before starting your main logic, some of these tasks are:
Did you notice that the last task of a startup routine is to enable the outputs? That is why the first step of executing the main cycle program OB1 is to write the PIQ into the output module.
Note the following points regarding the “STARTUP” mode:
In this example, we will add a start-up OB100 to our PLC logic and see how many times the OB100 is executed. See picture 1 for adding a new OB100.
As you see from the last picture, you add startup organization blocks the same way we add a function of a function block.
Inside the OB100 we just created we will add a simple ADD instruction, to accumulate how many times the OB100 is called and executed. See picture 2.
Now, compile and run your program and see what will happen. See the following animation for a simulation of the PLC program.
As you can see from the above animation, the OB100CycleCounter is 1 and it doesn’t change when the PLC mode transitions from STOP to RUN.
Well, it does change but you don’t see this change. Each time the PLC goes into STOP mode and then to RUN mode again. The counter will be reset to zero and then to 1 again after the OB100 is executed. You can also see the main OB1 cycle counter changing, and the PLC stops and then runs again the OB1CycleCounter will start accumulating again.
To see the change in the startup counter, we need to retain the value of the tag memory. See picture 3.
After we retain the OB100CycleCounter tag, now run the PLC simulation again and see what will happen. See simulation animation 2.
You see now from the above animation, that the startup counter increases each time I stop the PLC and then start it again. As the tag memory is now retained, the value will not be reset to zero, and that is why you see the value of the OB100CycleCounter accumulates.
Now, I need to add extra functionality to my startup PLC logic, which is to know when the last startup of the PLC was. We will achieve that through a simple logic where I read the local time of the PLC at startup and move the date and time to a certain memory area. See picture 4.
After you add your logic, compile and run the simulation again. See the PLC simulation animation 3.
You can see from the above animation, that each time the PLC starts the startup date and time will be recorded in the memory area we assigned. So now I have the information regarding how many times my PLC started and when was the last start-up time.
Downloads:
Startup OBs are very important if you want to evaluate some functionality before you can run your cyclic process. You can use start-up OBs to initialize parameters, calibrate sensors and even check for safety conditions before allowing your process to run.
You can find more news about the PLC in Europe on IndustrieVandaag.
If you liked this article, then please subscribe to our YouTube Channel for Instrumentation, Electrical, PLC, and SCADA video tutorials.
You can also follow us on Facebook and Twitter to receive daily updates.
Read Next:
Electrical Drives control the motion of electric motors. Motion control is required in industrial and…
PLC ladder logic design to control 3 motors with toggle switch and explain the program…
VFD simulator download: Master the online tool from the Yaskawa V1000 & programming software for…
The conveyor sorting machine is widely used in the packing industries using the PLC program…
Learn the example of flip-flop PLC program for lamps application using the ladder logic to…
In this article, you will learn the STAR DELTA programming using PLC controller to start…