Chapter 5 Applied Instructions S 1 : Source device; S 2 : Parameter (Unit: 0.001); D : Destination device 16-bit instruction: The setting of S 2 is described below. Explanation If the 16-bit instruction is used, S 2 will occupy four consecutive devices. 32-bit instruction: The setting of S 2 is decribed below. If the 32-bit instruction is used, S 2 will occupy eight consecutive devices. Flag: M1162 is a decimal integer/binary floating-point value flag. (ON: Binary floating-point value) Equation:
D =[( S 1 –Minimum source value)Ч(Maximum destination value–Minimum destination value)]ч(Maximum source value–Minimum source value)+Minimum destination value Relation between the source value in S 1 and the destination value in D : y=kx+b y=Destination value ( D ) k=Slope=(Maximum destination value–Minimum destination value)ч(Maximum source value–Minimum source value) x=Source value ( S 1 ) b=Offset =Minimum destination value–Minimum source valueЧSlope After the parameters above are substituted for y, k, x, and b in the equation y=kx+b, the equation below will be obtained.
y=kx+b= D =k S 1 +b=SlopeЧ S 1 + Offset = SlopeЧ S 1 + Minimum destination value–Minimum source valueЧSlope=SlopeЧ( S 1 –Minimum source value) + Minimum destination value =( S 1 –Minimum source value)Ч(Maximum 5-119 API Instruction code Operand Function 203 D SCLP P S , S , D 1 2 Parameter scale Device Xn.n Yn.n M S K 16# F KnM KnS D W T C V Z S 1 S 2 D Pulse instruction 16-bit instruction (7 steps) 32-bit instruction (9 steps ) Device Parameter Setting range number S 2 Maximum source value -32768~32767 S +1 2 Minimum source value -32768~32767 S +2 2 Maximum destination value -32768~32767 S +3 2 Minimum destination value -32768~32767 Setting range Device Parameter Floating-point value number Integer S , S +1 2 2 Maximum source value -2,147,483,648~ 2,147,483,647 32-bit floating-point values available S +2, S +3 2 2 Minimum source value S +4, S +5 2 2 Maximum destination value S +6, S +7 2 2 Minimum destination value