 Hello everyone welcome to this video session on PLC programming using structured text method. So at the end of this session you will be able to examine the basic operators which are used in structured text programming method. You can also write small structured text programs for some of the logic functions. So we know that there are 5 programming methods which are supported by standard IEC 61131 part 3. So let us learn structured text programming method in detail in this video session. So this is a textual language in which core part consists of a sequence of statements separated by semicolon. This is high level language consists of a combination of structured text keywords which controls the program execution and so called expressions. So expressions consisting of operators or functions or sometimes operands are normally re-evaluated at the runtime. So this structured text program method offers a large range of abstract statements describing complex functionality in a very compressed way. A normal structured text algorithm is divided into several steps or statements. So what this statement is, let us take some small example. Statement is used to compute and assign values or to control the command flow or to call or leave a program organization unit that is POU. So here one example is shown. So this statement light colon equal to switch A. So this is a simple example of a structured text statement. So when the switch is on, light is on and switch is off, light is off. So this is a direct statement assignment example in structured text programming method. So this is a structured text statement and its equivalent ladder-run diagram having one switch and one coil. So let us go through these operators before going to the details of structured text programming. So these are the operators from listed here with the highest precedence to the lowest precedence. So brackets are having highest precedence whereas R operator is having lowest precedence. So function in comes with the brackets, then you have raising to a power operator, then not operator, then multiplication, division, mod, then we have arithmetic addition and subtraction operator, then less than, greater than, less than equal to or greater than equal to then equality, inequality, Boolean AND, Boolean XR and Boolean R. These are the operators which are commonly used in structured text programming language. Now let us go through this category of statements. First one is the conditional statements. So first is if then else which is used when selected alternative statements are to be executed whenever a certain condition occurs which is defined by a Boolean expression. So here is one example if fluid temp then. So this statement indicates that if the fluid temp variable is on that is one which is true, the action following that the line in the program will be executed. So here is one example if switch A then light is on else light is off. And this is the end of this conditional statement and underscore if. So this is a simple if then else conditional statement which is used in structured text programming. Next is the case statement. So case of else which is used to give the condition that selected statements are to be executed if a particular integer value or value of expression occurs else some other selected statements will be executed. So here is one example of a case statement case F of 1 colon G colon equal to 11 else G colon equal to 0 0. So the meaning is if the value of F is 1 then G is equal to 11 else G is equal to 0 and this is the end of this case statement. So this is a conditional case statement example. Next are the iteration statements. So iteration statements repeats for a number of times. So first iteration statement is for do statement which allows a set of statements to be repeated depending upon the value of iteration integer value defined. So here is one example for input 10 to 0 by minus 1 do output is equal to input. So this look gives you output decremented by 1 each time when the input decrements by 1. So this is an example of for do iteration statement. Let us go to the next iteration statement while do. So the while do statement allows a set of statements to be executed while a particular Boolean expression remains true. So again here is one example is shown. So initially output Q is equal to 0 and this is the while do statement. So while input A and input B is true do output Q is equal to output Q plus 1. So what is the meaning if these two statements are ending of these two statements are true then increment Q each time. Next iteration statement is a repeat until so this repeat until iteration statements allows statements to be executed and repeated while a particular Boolean expression remains true. So here the syntax is repeat i is equal to i into j until i is less than 1000. So in the repeat until iteration statement condition is check at the end while in while do statement the condition is first checked and the statements executed later. So this is the difference. So let us go through some examples how to write structured text programs or course for a simple operations. So here let us write a structured text code to turn a wall on when a sensor output is satisfactory. So this is a simple assignment you can use here as shown. So here wall 1 is equal to sensor 1. So this is the first possible solution you can have and here the equivalent ladder diagram is shown with a one switch and one coil. So the meaning of this wall 1 will be on if the sensor 1 output is satisfactory or true. Another solution for this example is using if then conditional statement. So here if sensor 1 then wall 1 is equal to 1 and so meaning of this if else block is if the sensor 1 is true then wall 1 is 1 otherwise 0. Now let us take one more example a wall is to be switched on if outputs of two sensors sensor 1 and sensor 2 are satisfactory or if output of sensor 3 is satisfactory. So let us develop a structured text code for this given task. So let us convert this statement into a simple Boolean expression which will help you to write the corresponding structured text statement. So after the conversion if you read this statement carefully you can write a expression for wall 1 is equal to sensor 1 and aid with sensor 2 and odd with sensor 3. What is the meaning of this? If the outputs of sensor 1 and sensor 2 are satisfactory then the wall will turn on or if the sensor 3 output is satisfactory then also wall 1 will be on. So let us write corresponding structural text code for this statement. So the first solution will look like this wall 1 is equal to sensor 1 and aid with sensor 2 odd with sensor 3 and the equivalent ladder diagram will look like this. So sensor 1 sensor 2 switches are in series with wall 1 and sensor 3 is placed in parallel with sensor 1 and sensor 2. So these and ending of 2 sensor 1 and sensor 2 is equivalent to connecting sensor 1 switch and sensor 2 switch in series while this oring is equivalent to adding sensor 3 in parallel with sensor 1 and sensor 2. Second solution using if then block which will read like this if sensor 1 ended with sensor 2 then wall 1 is on else if sensor 3 then wall 1 is 1 ended. So what is the meaning? So first condition is ending of sensor 1 and sensor 2 what is the meaning of this? If sensor 1 output and sensor 2 outputs are satisfactory then turn wall 1 on else if sensor 3 output is satisfactory then also turn wall 1 on and the end if is the end of this if then block. These are the reference books you can refer. Thank you.