3 . I ns t r uc ti on Se t3- 1 7 1API Mnemonic Operands Function ControllersES2/EX2 SS2 SA2SESX267 D RAMP Ramp variableValueTypeOPBit Devices Word devices Program StepsX Y M S K H KnX KnY KnM KnS T C D E F RAMP: 9 stepsDRAMP: 17 stepsS1 *S2 *D *n * * *PULSE 16-bit 32-bitES2/EX2 SS2 SA2SE SX2 ES2/EX2 SS2 SA2SE SX2 ES2/EX2 SS2 SA2SE SX2Operands:S1: Start of ramp signal S2: End of ramp signal D: Current value of ramp signal (occupies 2consecutive devices) n: Times for scan (n: 1~32,767)Explanations:1. This instruction creates a ramp output. A ramp output linearity depends on a consistent scantime. Therefore, scan time has to be fixed before executing RAMP instruction.2. When RAMP instruction is executed, the ramp signal will vary from S 1 to S2. Current value oframp signal is stored in D and D+1 stores the current number of accumulated scans. Whenramp signal reaches S2, or when the drive contact of RAMP instruction turns OFF, the content inD varies according to the setting of M1026 which is explained later in Points to note.3. When n specifies a D register, the value in D cannot be modified during the execution of theinstruction. Please modify the content of D when the instruction is stopped.4. When this instruction is applied with analog output function, Ramp start and Ramp stop functioncan be achieved.Program example:1. Before executing the instruction, first drive M1039 = ON to fix the scan time. Use MOVinstruction to write the fixed scan time to the special data register D1039. Assume the scan timeis 30ms and take the below program for example, n = K100, the time for D10 to increase to D11will be 3 seconds (30ms × 100).2. When X20 goes OFF, the instruction will stop its execution. When X10 goes ON again, thecontent in D12 will be reset to 0 for recalculation3. When M1026 = OFF, M1029 will be ON to indicate the completion of ramp process and thecontent in D12 will be reset to the set value in D10.4. Set the Start and End of ramp signal in D10 and D11. When X20 = ON, D10 increases towardsD11, the current value of the variation is stored in D12 and the number of current scans is storedin D13.X20RAMP D10 D11 D12 K100