Chapter 6 Applied Instructions Symbol S 1 : Minimum output value S 2 : Maximum output value S 3 : Input value D : Output value 6_ Explanation 1. The instruction compares the input value in S 3 with the minimum output value in S 1 and the maximum output value in S 2 , and stores the comparison result in D . If the input value in S 3 is smaller than the minimum output value in S 1 , the instructions stores minimum output value S 1 in D . If the input value in S 3 is larger than the maximum output value in S 2 , the instruction stores the maximum output value S 2 in D .
If the input value in S 3 is between the minimum output value S 1 and the maximum output value S 2 , the instruction stores the input value S 3 in D . 6-383 API Instruction code Operand Function 1221 D LIMIT P S1, S2, S3, D Confining a value within bounds Device X Y M S T C HC D FR SM SR E K 16# “$” F S1 S2 S3 D BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S1 S2 S3 D Pulse instruction 16-bit instruction 32-bit instruction ES3 ES3 ES3