Mitsubishi — 5.6 Application Instructions

5 Categories and Use of Basic Application Instructions Operands: S 1 : Source value S 2 : Slope (unit: 0.001) S 3 : Offset D : Operation result Range of operands S 1 , S 2 , S 3 : -32767~32767. Explanations: 1. SCAL instruction performs a proportional calculation according to the internal slope equation. 2. Operation equation in the instruction: D = ( S 1 Ч S 2 ) ч 1000 + S 3 3. Users have to obtain S 2 and S 3 (decimals are rounded up into 16-bit integers) by using the slope and offset equations below. Slope equation: S 2 = [(max. destination value – min. destination value) ч (max. source value – min. source value)] Ч 1,000 Offset equation: S 3 = min. destination value – min.

source value Ч S 2 ч 1,000 4. The output curve is shown as the figure: Destination value Source value Max. source value Min. Program Example 1: 1. Assume S 1 = 500, S 2 = 168 and S 3 = -4. When X0 = ON, SCAL instruction executes and the result of 2. Equation: D0 = (500 Ч 168 ) ч 1000 + (-4) = 80 proportional calculation will be stored in D0. X0 DVP-PM Operation Instruction 5-134 API Mnemonic Operands Function Controllers 20PM 10PM 202 SCAL P Proportional calculation Type OP Bit Devices Word devices Program Steps X Y M S K H KnX Kn Y KnM KnS T C D V Z SCAL,SCLAP: 9 steps S 1 * * * S 2 * * * S 3 * * * D * D Max. Destinati e value Min. destinatio SCAL K50 0 K168 K-4 D0