Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Storing history of analog values
Jeremy Weatherford
Quick and dirty SIMPL solution is to use an ABUF to make a sort of
delay line, and send a WPULSE (single logic wave pulse) to the enable to shift everything by one: Value -> Value1 Value1 -> Value2 Value2 -> Value3 Value3 -> Value4 etc. Value1 will be the most recent saved, Value4 will be the oldest. Use an ARAM if it needs to survive program reboots. On Tue, Feb 22, 2011 at 10:01 AM, merriweather.randolph <merriweather.randolph@...> wrote: I want to keep a history of 5 to 10 changes to a single analog value. Does anyone have a suggestion of how I might accomplish this? -- Jeremy Weatherford |
Analog_input analogVal;
toggle quoted message
Show quoted text
Analog_output analogStored[maxNumToStore]; integer x; change analogVal { if(x>=maxNumToStore) x=1; else x++; analogStored[x]=analogVal; } function main() { x=0; } --- In Crestron@..., "merriweather.randolph" <merriweather.randolph@...> wrote:
|
?? What is this x++ dream?
_____ From: Crestron@... [mailto:Crestron@...] On Behalf Of Brian Sent: Tuesday, February 22, 2011 7:30 AM To: Crestron@... Subject: [Crestron] Re: Storing history of analog values Analog_input analogVal; Analog_output analogStored[maxNumToStore]; integer x; change analogVal { if(x>=maxNumToStore) x=1; else x++; analogStored[x]=analogVal; } function main() { x=0; } --- In Crestron@... <mailto:Crestron%40yahoogroups.com> , "merriweather.randolph" <merriweather.randolph@...> wrote: anyone have a suggestion of how I might accomplish this?
|
mjrtoo2000
I might use a ring buffer, and an ABUF with multiple selects defined driven by the ring buffer. Setup the ring buffer clock and Store/Recall on the ABUF as you see fit.
toggle quoted message
Show quoted text
--- In Crestron@..., "merriweather.randolph" <merriweather.randolph@...> wrote:
|
mjrtoo2000
ARAM, not ABUF
toggle quoted message
Show quoted text
--- In Crestron@..., "mjrtoo2000" <mjrtoo@...> wrote:
|
Yeah, wishful thinking :(
toggle quoted message
Show quoted text
--- In Crestron@..., "Kol Johnson" <kol.mstc@...> wrote:
|
Way cool shift register Jeremy.
toggle quoted message
Show quoted text
--- In Crestron@..., Jeremy Weatherford <xidus.net@...> wrote:
|
Thanks, Jeremy. I thought I had it figured out, but I'm getting an odd behavior that I don't understand.
toggle quoted message
Show quoted text
I setup the abuf as you suggested enabled by the wpulse and I have the output of the abuf feeding an aram (ones on store, recall and select1) whose output feeds the output side of the argument definition. Watching the signals in debugger the output of the buffer is correct, but I don't get an output from the aram until the program is reset. --- In Crestron@..., Jeremy Weatherford <xidus.net@...> wrote:
|
Jeremy Weatherford
To use an ARAM this way (with 1s on store, recall, and select1), the
input signal names need to be the same as the output signal names. While the program runs, it's just storing data to NVRAM. When the program starts up, it sees the 1 on recall and sends the stored values to the outputs. It doesn't output anything else until the program restarts. On Mon, Mar 7, 2011 at 12:43 PM, merriweather.randolph <merriweather.randolph@...> wrote: Thanks, Jeremy. I thought I had it figured out, but I'm getting an odd behavior that I don't understand. -- Jeremy Weatherford |
to navigate to use esc to dismiss