How to put input in memory???

kaveh_henry

Member
Join Date
Oct 2013
Location
Iran
Posts
2
Hi, I have an exercise about calculate average 10 Real input by using pointer for addressing, the problem is first I should put thess inputs in 10 memory, but when the first input come, it's going to md4, and when the second input come, the first input go from md4 to md8, and new input going to md4 and...
how should I write this in STL ???:sick:
thx.
 
Here's something to get you going. All named variables are temp variables.

rName=REAL
dwName=DWORD
iName=INT

Code:
      A     M    255.4; //mb255 =clock byte in cpu properties
      FP    M    254.0; 
      JCN   skip; 
      L     0.000000e+000; 
      T     #rSum; //zero sum
      L     P#4.0; 
      NEGD  ; 
      T     #dwDec; //to allow AR1 to be decremented
      L     10; //no of entries in filter
      T     #iNumberOfElements; 
      T     #iCount; 
      LAR1  P#M 4.0; //start of filter store, MD4
      L     #iCount; 
      +     -2; 
      L     P#4.0; 
      *D    ; 
      +AR1  ; //start read of (icount-1)th element 
      L     #iCount; 
      +     -1; 
L:    T     #iCount; 
      L     D [AR1,P#0.0]; //ripple down values
      T     D [AR1,P#4.0]; 
      L     #rSum; 
      +R    ; 
      T     #rSum; 
      L     #dwDec; 
      +AR1  ; 
      L     #iCount; 
      LOOP  L; 
      L     MD   100; //new value assumed to be in MD100
      T     D [AR1,P#4.0]; 
      L     #rSum; 
      +R    ; 
      L     #iNumberOfElements; 
      ITD   ; 
      DTR   ; 
      /R    ; 
      T     MD   104; //average shown in MD104
skip: NOP   0;
 

Similar Topics

Hi guys, I'm working on a RSView32 project, some of the tags i'm using is memory tag & type is 'String'. These are like product name, I've a...
Replies
4
Views
5,221
I'm having trouble calming down 2 Tempo Sonics. I'm using Studio 5000 CompactLogix my Raw value is jumping around from 8575.0 to 8755.0 at a...
Replies
4
Views
57
I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
7
Views
113
Hi, I have questions. I have Analog Input that need to put into Ignition Designer. But I don't know how to put?
Replies
1
Views
73
Omron AD081-V1 Analog Input Card Offset & Gain Adjustment Entering Adjustment Mode 1. Set the input card in adjustment mode (Turn ON Dip SW No-1)...
Replies
0
Views
49
Back
Top Bottom