Limit Instruction in a PLC limit input value to specified maximum and minimum range. we can LIMIT instructions in ladder. in ANSI we create a limit function because ANSI Don\'t have limit instructions. so i am creating a simple limit instructions example. we can discuss more what is function in ANSI. we create a limit function with the help of conditional statement (if else). limit function that limits a value between a minimum and maximum range so first we create a Limit function.
In the above example, limit function takes three input arguments
now we call a limit function in main program and pass function parameter by new variable or constant value. if the input value within the range of maximum and minimum range then output is equal to input value. for example if the maximum value is 12.30 and minimum value is 1.0 so output of limit instruction is not greater then 12.3 and not less then 1.0. if the input value is greater then 12.30 then output is 12.30 and if the input value is less then 1.0 so the output is set to 1.0. in this program we all real data type.
we can use same limit function multiple time so we in second line of program we use limit function for a constant value. in this declaration we pass constant value as function arguments.12.0 is minimum range, 98.0 is maximum value and 13.0 is a input value. limit instruction in ladder and Structured Text visit link