03.01.2013 Views

Toshiba PROSEC T1-16S PLC User's Manual - CTi Automation

Toshiba PROSEC T1-16S PLC User's Manual - CTi Automation

Toshiba PROSEC T1-16S PLC User's Manual - CTi Automation

SHOW MORE
SHOW LESS

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

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

FUN 056 MAVE Moving average<br />

Expression<br />

Input −[ A MAVE (n) B → C ]− Output<br />

6F3B0253<br />

7. Instructions<br />

Function<br />

When the input is ON, this instruction calculates the average value of the latest n scan’s register A<br />

data, and stores it in C. The allowable range of n is 1 to 64.<br />

This instruction is useful for filtering the analog input signal.<br />

The latest n scan’s data of A are stored in n registers starting with B, and C+1 are used as pointer.<br />

Execution condition<br />

Input Operation Output<br />

OFF No execution OFF<br />

ON Execution ON<br />

Operand<br />

Name Device Register Constant Index<br />

X Y R S T. C. XWYWRWSW T C D I J K<br />

A Input data √ √ √ √ √ √ √ √ √ √ √<br />

n Data size 1 - 64<br />

B Start of table √ √ √ √ √ √<br />

C Output data √ √ √ √ √ √ √ √<br />

Example<br />

The latest 5 scan’s data of XW04 is stored in D0900 to D0904 (5 registers), and the average<br />

value of them is calculated and stored in D0010.<br />

D0011 is used as internal work data.<br />

XW04 D0010<br />

1st scan 1000 200 = (1000) / 5<br />

2nd scan 1005 401 = (1000 + 1005) / 5<br />

3rd scan 1009 603 = (1000 + 1005 + 1009) / 5<br />

4th scan 1012 805 = (1000 + 1005 + 1009 + 1012) / 5<br />

5th scan 1007 1006 = (1000 + 1005 + 1009 + 1012 + 1007) / 5<br />

6th scan 1004 1007 = (1005 + 1009 + 1012 + 1007 + 1004) / 5<br />

7th scan 998 1006 = (1009 + 1012 + 1007 + 1004 + 998) / 5<br />

8th scan 994 1003 = (1012 + 1007 + 1004 + 998 + 994) / 5<br />

Basic Hardware and Function 159<br />

<strong>CTi</strong> <strong>Automation</strong> - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net

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

Saved successfully!

Ooh no, something went wrong!