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,242
Hello, I'm looking for a dirt cheap digital display + input, that would be wired to an analog input and analog output. This would be for my home...
Replies
10
Views
233
Hello, I am trying to read a barcode scanner input using a cognex dataman 280 barcode reader, store it another string, the compare with another...
Replies
1
Views
62
All, I have a PowerFlex 525 driving an agitator motor. The goal is to have the agitator start automatically after a power loss or a comm loss. I...
Replies
2
Views
81
Hi, I have a ControlLogix system with 1756-IF16 analogue inputs. I can't scale the inputs at the card as there is a requirement to facilitate...
Replies
14
Views
386
Back
Top Bottom