aArray | (Array) The array over which the operation is performed (PmArray object for JavaScript or Array data type for VBScript). |
---|---|
sType | (String) Type name of the performed operation:
"Min" - Minimum value of all array items. The items must be numeric, of the String type or Date type. For the String type, the items are sorted alphabetically.
"Max" - Maximum value of all array items. The items must be numeric, of the String type or Date type. For the String type, the items are sorted alphabetically.
"Sum" - Sum of the array items values. The items must be numeric and the result is a value of the Double type.
"Mean" - Mean value of the array items. The items must be numeric and the result is a value of the Double type.
"StdDeviation" - Standard deviation of the array items values. The items must be numeric and the result is a value of the Double type.
"CRC1" - CRC-16-CCITT, 2 bytes Cyclical Redundancy Check with CCITT polynomial [0x1021 = x16+x12+x5+1]. Cyclical Redundancy Check of the array value bytes. The items can be of any type and the result is the value of the Integer type, i.e. 2 bytes value. This check sum is used, for example, at the PmSBUS communication. It is possible to enter the sub-option: "CRC1,Be" that performs the sum over the values converted into Big-endian format.
"CRC2" - CRC-16-IBM, 2 bytes Cyclical Redundancy Check with CCITT polynomial [0xA001 = x16+x15+x2+1]. Cyclical Redundancy Check of the array value bytes. The items can be of any type and the result is the value of the Integer type, i.e. 2 bytes value. This check sum is used, for example, at the Modbus communication protocol. It is possible to enter the sub-option: "CRC2,Be" that performs the sum over the values converted into Big-endian format.
"CRC3" - CRC-16-IBM, 2 bytes Cyclical Redundancy Check with CCITT polynomial [0x8005 = x16+x15+x2+1]. Cyclical Redundancy Check of the array value bytes. The items can be of any type and the result is the value of the Integer type, i.e. 2 bytes value. This check sum is used, for example, at the PmABradleyDF1 communication. It is possible to enter the sub-option: "CRC3,Be" that performs the sum over the values converted into Big-endian format.
"CSumB1" - Checksum of the "byte values sum" type. The values of the array are stored linear into the memory and then the sum of such stored bytes is performed. The result sum is converted to the value of the Byte type (i.e. sum 256 modulo).
"CSumB2" - the same as CSumB1 but the result sum is converted to the value of the Integer type (i.e. sum modulo 65536). |
var arr = pMe.Pm("/Data").GetVarArray();
Pm.Debug("Sum=" + Pm.ArrayOper(arr, "Sum"));
Pm.Debug("Min=" + Pm.ArrayOper(arr, "Min"));
var arr = Pm.Array1("abc", "xyz", "fgr");
Pm.Debug("Min=" + Pm.ArrayOper(arr, "Min"));
Pm.Debug("Max=" + Pm.ArrayOper(arr, "Max"));
Min = abc
Max = xyz