
adccommunitymod (AutomationDirect) asked a question.
Created Date: August 22,2006
Created By: trevorstripling
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
I have a DL06 that is calculating RPMs of a motor and want to log the RPMs to memory every so often. I need about 500 to 1000 memory slots to hold the RPMs for each run of the motor. Should I use a table or is the a better way? Also, it appears that tables have a limit of 256 memory locations. What is the best way to deal with this? Fill one table, then write to another or fill one and copy the data to a different table, then re-write to the original table. Trevor
Created Date: August 23,2006
Created by: marksji
I would just use a pointer and create your own "table " in vmem. Actually I have done this for storing the last 500 error codes along with time/date in all our machines.
Created Date: August 23,2006
Created by: trevorstripling
Can you give me an example of how to setup and increment the pointer? Maybe a sample of the code you used in your application?
I am not sure how to increment the address each load and also the addresses skip 8 and 9.
Also, where in memory is it safe to store the data.
Created Date: August 23,2006
Created by: clasentech
I use the MOV instruction.
LD K40 (number of memory slots)
LDA O10000 (current info)
MOV V10001 (starting slot for data)
Created Date: August 23,2006
Created by: marksji
classentech is on the right track.
Lets say you want to store the last 1000 readings at V2000 - V3750 where v2000 is the newest reading and v3750 is the oldest reading...
1) move the table starting at v2000 to v2001:
LD K3E7 (999 in hex)
LDA O2000 (start of table)
MOV O2001 (moves table over one position)
2) store your current reading in V2000
That's all there is to it.
Created Date: August 23,2006
Created by: trevorstripling
Please bear with me, I am a rookie at this stuff.
So in this example, I load my current reading into V2000, then do the LDK3E7, then the LDA and MOV to move values in the table down one location.
Then on the next time I need to store the data, do the same thing again.
After 4 executions the table would look like:
V2000 last value
V2001 previous value 1
V2002 previous value 2
V2003 previous value 3
Is my understanding correct?
If so, then what if I want to add the last value to the bottom of the table instead of the top?
Thanks for your help!
Created Date: August 23,2006
Created by: testone
Log to a flash card... www.ljbeng.com
Created Date: August 23,2006
Created by: clasentech
You only want to move the "last value " and that is it?
Then do a LD and OUT (Box) instruction to place it where ever you want it.
Created Date: August 23,2006
Created by: trevorstripling
I want to log the rpm of the motor a few times a second and store a few second run on the motor. So I have a timer that counts the RPM for each time period. What I want to do is at the end of each time period calc the RPM and write it to memory so that I can download it later. There will be 500-1000 times that I need to capture the RPM per run.
Created Date: August 23,2006
Created by: AZRoger
If I did the math right, a table MOV of 1000 words will take about 10ms.! That's a big hit to scan times. I'd compute an address and stuff it once.
Created Date: August 23,2006
Created by: marksji
Originally posted by trevorstripling:
Please bear with me, I am a rookie at this stuff.
So in this example, I load my current reading into V2000, then do the LDK3E7, then the LDA and MOV to move values in the table down one location.
Then on the next time I need to store the data, do the same thing again.
After 4 executions the table would look like:
V2000 last value
V2001 previous value 1
V2002 previous value 2
V2003 previous value 3
Is my understanding correct?
If so, then what if I want to add the last value to the bottom of the table instead of the top?
Thanks for your help!
Almost, you need to do the move and then place your most recent reading into v2000.