Chapter 8
Array (File)/Misc. Instructions (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE)
File Standard Deviation
(STD)
Mnemonic
Data Type
.EN
BOOL
.DN
BOOL
.ER
BOOL
.LEN
DINT
.POS
DINT
390
The STD instruction calculates the standard deviation of a set of values in one
dimension of the Array and stores the result in the Destination.
Operands:
Relay Ladder
Operand
Array
Dimension to
vary
Destination
Control
Length
Position
CONTROL Structure
Description
The enable bit indicates that the STD instruction is enabled.
The done bit is set when the calculation is complete.
The error bit is set when the instruction generates an overflow. The instruction stops executing until the
program clears the .ER bit. The position of the element that caused the overflow is stored in the .POS
value.
The length specifies the number of elements in the array on which the instruction operates.
The position contains the position of the current element that the instruction is accessing.
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Type
Format
SINT
Array tag
INT
DINT
REAL
A SINT or INT tag converts to a DINT value by sign-extension.
DINT
Immediate
(0, 1, 2)
REAL
Tag
CONTROL
Tag
DINT
Immediate
DINT
Immediate
Description
Find the standard deviation of the values in
this array
Specify the first element of the group of elements
to use in calculating the standard deviation
Do not use CONTROL.POS in the subscript
Which dimension to use
Depending on the number of dimensions, the order
is:
array[dim_0,dim_1,dim_2]
array[dim_0,dim_1]
array[dim_0]
Result of the operation
Control structure for the operation
Number of elements of the array to use in
calculating the standard deviation
Current element in the array
Initial value is typically 0