AH500 Programming Manual API 1221 Symbol: S 1 : Minimum output value Word/Double word S 2 : Maximum output value Word/Double word S 3 : Input value Word/Double word D : Output value Word/Double word Explanation: 1. The input value in S 3 is compared with the minimum output value in S 1 and the maximum output value in S 2 , and the comparison result is stored in D . If the minimum output value in S 1 is larger than the input value in S 3 , the output value stored in D is equal to the minimum output value in S 1 . If the maximum output value in S 2 is less than the input value in S 3 , the output value stored in D is equal to the maximum output value in S 2 .
If the input value in S 3 is within the range between the minimum output value in S 1 and the maximum output value in S 2 , the output value stored in D is equal to the input value in S 3 . If the minimum output value in S 1 is larger than the maximum output value in S 2 , the instruction is not executed. 2. Only the 32-bit instructions can use the 32-bit counter. When X0.0 is ON, the state of X1 is converted into the binary value, and the conversion result is stored in D0. Besides, the value stored in D0 is compared with 500 and 5000, and the comparison result is stored in D1. Example:
6-300 Instruction code Operand Function D LIMIT P S , S , S , D 1 2 3 Confining the value within the bounds Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1 S 2 S 3 D Pulse instruction 16-bit instruction (9 steps) 32-bit instruction (9 steps) AH500 AH500 AH500