Delta Electronics — 6.13.2 Explanation of Data Processing Instructions

Chapter 6 Applied Instructions Symbol S : First device D : Device where the mean is stored n : Number of devices 6_ Explanation 1. This instruction adds up the values in the n devices starting from the device specified by S , and the stores the mean of the sum in D . 2. If a remainder appears in the calculation, the instruction discards it. 3. For 16-bit instructions, n must be between 1–256. 4. For 32-bit instructions, n must be between 1–128. 5. Only the 32-bit instructions can use the 32-bit counter, but not the device E. Example When X0.0 is ON, the instruction adds up the values in the three registers starting from D0. The instruction divides the sum by 3.

The instruction stores the quotient in D10, and leaves out the remainder. 6-357 API Instruction code Operand Function 1208 D MEAN P S, D, n Finding the mean Device X Y M S T C HC D FR SM SR E K 16# “$” F S        D        n            BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S      D      n      Pulse instruction 16-bit instruction 32-bit instruction AS AS AS