The AVE and AVEP instructions calculate the average. When the AVE instruction is executed, S2 array elements beginning at address S1 are averaged and the result is saved in D1. The AVE and AVEP instructions are always conducted. When using the AVE and AVEP instructions, an error will occur if the variables specified in operands S1 and D1 are not the same type. Designate the same variable type in operands S1 and D1.
Refer to the following for specifying a constant.
When operand D1 is an integer variable
When operand D1 is an integer variable and you want to input hexadecimal values in operand S2
When 0x (zero and lower case "x") is input, the following values become hexadecimal values.
Confirming Execution Results
The instruction will not execute if the value in operand S1 or S2 (infinite or non-numeric value) cannot be recognized.
The error code (6706) is written to #L_CalcErrCode.
The result in D1 maintains the value from the previous successfully run instruction.