12.07.2015 Views

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

382 Array (File)/Misc. <strong>Instructions</strong> (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE)Example 1:Calculate the standard deviation of dint_array, which is DINT[4,5].dimension 1subscripts0 1 2 3 40 20 19 18 17 16AVE16------------------------------------+ 11 + 6 + 1 34= = ----- = 8.54 4dimension 012315 14 13 12 1110 9 8 7 65 4 3 2 1STD〈 16 ∠ 8.5〉 2 〈 11 ∠ 8.5〉 2 〈 6 ∠ 8.5〉 2 〈 1 ∠ 8.5〉 2= -------------------------------------------------------------------------------------------------------------------------------- + + +=〈 4 ∠ 1〉6.454972real_std = 6.454972Relay LadderStructured TextSIZE(dint_array,0,length);sum := 0;FOR position = 0 TO (length-1) DOsum := sum + dint_array[position];END_FOR;average := sum / length;sum := 0;FOR position = 0 TO (length-1) DOsum := sum + ((dint_array[position] - average)**2);END_FOR;real_std := SQRT(sum / (length-1));Publication 1756-RM003I-EN-P - January 2007

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!