Siemens TIA Portal & s7-1200 PLC & Bit Logic Operations & Timers [4]

In this tutorial, you will learn when should use the different bit logic operations most used and the Timers Operations. Check out the last post, if you miss it, where we explain how to configure the Inputs and Outputs in your TIA Portal.

Parts Required

Software:

  • Siemens TIA Portal

Hardware:

  • s7-1200 1214 DC/DC/DC PLC

Bit Logic Operations

To have access to the Logic operations you should click on Instructions and then on Bit Logic Operations Figure[1].

Figure [1] – Acess the Logic Operations

As you can see, there are many Bit Logic Operations options. In this post, we will learn how and when to use the first 7 Bit Logic Operations. Those are the most used. We will resume the program of the last post.

Normally Open Contact Figure[2]:

When the tag associated (in our case, a button) has the state “0”, means that the output is reset to “0”. If the tag associated changes the state to “1”, the contact closes and the output is set to “1”. E.g: If this contact is connected to a lamp, the lamp will light on if we press the button and light off when we release the button.

Figure[2]– Open Contact

Normally Closed Contact Figure[3]:

When the tag associated (in our case, a button) has the state “0”, means that the output is set to “1”. If the tag associated changes the state to “1”, the contact opens and the output is set to “0”. E.g: If this contact is connected to a lamp, the lamp will light on if we have not the button pressed and will light off when we press it.

Figure[3]– Closed Contact

Invert RLO Figure[4]:

This Operation inverts the signal of the condition made before. It means that, if the condition, has the signal state “0”, the output is set to “1” and if the signal state is “0”, the output is set to “1”. E.g: Imagine that, you have two buttons and if any of them were press, you want to light on the lamp. You could do a series of both buttons with Normally Open contact and then use this Invert RLO before the lamp Output.

Figure[4]– NOT

2ยบ Module

Assignment Figure[5]:

This Operation puts the signal of the bit to “1”. It means that, if the condition before, has the signal “0”, the output is set to “0” and if the signal is “1”, the output is set to “1”. E.g: If the condition before was just a button using a Normal Contact, and if you connect one PLC output tag to the Assignment signal, while you have the button pressed, the output will be “1”.

Figure [5] – Assignment

Negate Assignment Figure[6]:

This Operation puts the signal of the bit to “0”. It means that, if the condition before, has the signal “0”, the output is set to “1” and if the signal is “1”, the output is set to “0”. E.g: If the condition before was just a button using a Normal Contact, and if you connect one PLC output tag to the Negate Assignment signal, while you have the button pressed, the output will be “0”.

Figure [6] – Negate Assignment

Reset Output Figure[7]:

This Operation reset the signal bit to “0”. E.g: If the condition before was just a button using a Normal Contact, and if you connect one PLC output tag to the Reset Output signal, when you press the button, the signal bit will be “0”. The difference to the previous is that even if you release the button, the coil maintains the value of the output to “0”

Figure [7]– Reset Output

Set Output Figure[8]:

This Operation set the signal bit to “1”. E.g: If the condition before was just a button using a Normal Contact, and if you connect one PLC output tag to the Set Output signal, when you press the button, the signal bit will be “1”. Even if you release the button, the coil maintains the value of the output to “1”

Figure [8]– Set Output

Timer Operations

To have access to the Timer operations you should click on Instructions and then on Timer Operations Figure[9].

Figure [9] – Acess to Timer Operations

As you can see, there are 4 different blocks, TP (Timer Pulse), TON (Timer ON), TOF (Timer Off) e TONR (Timer ON with Reset. When you insert this type of block, you will have to name a Data Block where the data is saved.

For all fourth-timer Operations, you have 2 Inputs and 2 Outputs. On “IN” you can make your condition activate the Timer pulse. On “PT” you can describe the time information. On “Q” you will have the signal of the timer you create and on “ET” you can check the current time value.

Examples of “PT” inputs:

  • Time of 10 milisseconds = T#10ms
  • Time of 14 seconds = T#14s
  • Time of 1 minute and 3 seconds = T#63s
  • Time of 2 hours = T#2h

Timer Pulse Figure[10]:

This Block creates a pulse on “Q” output with the duration you have a program on “PT” input.

Figure [10]- Timer Pulse

Timer ON Figure[11]:

This Block creates a delay when the “IN” condition changes from “0” to “1”. It means that the “Q” output will be delayed from the True condiction of “IN” with the duration you have a program on “PT” input.

Figure [11]- Time ON

Timer OF Figure[12]:

This Block creates a delay when the “IN” condition changes from “1” to “0”. It means that the “Q” output will be delayed from the False condiction of “IN” with the duration you have a program on “PT” input.

Figure [12]- Timer OF

Timer ON with Reset Figure[13]:

This Block creates a delay when the “IN” condition changes from “0” to “1”. It means that the “Q” output will be delayed from the True condiction of “IN” with the duration you have a program on “PT” input. The difference between the TON to TONR is that, on TON when the “IN” condition changes from “1” to “0”, the output “Q” changes to “0” too. On TONR, even if the “IN” condition changes from “0” to “1”, the output “Q” only changes to “0” if the “Reset” Input changes from “0” to “1”.

Figure [13]- Timer On with Reset

This is the fourth post on Siemens TIA Portal. You have learned the 7 most used bit Logic Operations and the fourth Timers functions.

If you like this kind of post, if you want to know more about Siemens TIA Portal, or if you have doubts about the Industrial Automation area don’t forget to leave a comment.

Leave a Reply

Your email address will not be published. Required fields are marked *

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!

Hello! We have noticed you are using an ad blocker. Our website is funded by advertising which allows you to access all our content for free. By disabling your ad blocker, you are contributing to the sustainability of our project and ensuring we continue to provide high-quality, useful tutorials. We appreciate your support!