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.

Array (File)/Misc. <strong>Instructions</strong> (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE) 383Example 2:Calculate the standard deviation of dint_array, which is DINT[4,5].dimension 1subscripts0 1 2 3 40 20 19 18 17 16AVE20------------------------------------------------------+ 19 + 18 + 17 + 16 90= = ----- = 1855dimension 012315 14 13 12 1110 9 8 7 65 4 3 2 1STD〈 20 ∠ 18〉 2 〈 19 ∠ 18〉 2 〈 18 ∠ 18〉 2 〈 17 ∠ 18〉 2 〈 16 ∠ 18〉 2= ------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + + +=〈 5 ∠ 1〉1.581139real_std = 1.581139Relay LadderStructured TextSIZE(dint_array,1,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!