Posted 29 Feb 2016 Im working on a way to reset a RTO (retentative timer) that counts how long a motor runs above alarm current levels and keeps a record of the highest current recorded... currently it just counts forever but I want to reset it each month... and to possibly move data into monthly registers to evaluate and compare. I have my GSV setup monitoring the clock and am trying to think of a way to monitor my WALLCLOCK[1] DINT that houses the month (Currently 2) I want to trigger a reset anytime that DINT changes state.... any ideas?? Share this post Link to post Share on other sites
Posted 29 Feb 2016 here is an image of the part of the code im working on.... this was all designed and modified years ago by germans and the only modifications I've made so far is adding the system clock on line 40 Share this post Link to post Share on other sites
Posted 29 Feb 2016 (edited) Maybe something like this? Oops - That should be wallclock[1] Steve Edited 29 Feb 2016 by nehpets Share this post Link to post Share on other sites
Posted 29 Feb 2016 Thanks nehpets, that was just the inspiration I needed I think. I didn't understand the adding 1 to an index but check out what I have now, I think it gets done what I need... i'll just have to extract the data each month before the rollover. thanks again Share this post Link to post Share on other sites
Posted 1 Mar 2016 The Variable 'index' is incremented to increment the array, so on the first iteration of the rung, the value you want to save would be written (MOV'ed) to 'month_store[0]' then 'index' would be incremented so that on the next iteration of the rung the value to save would be written to 'month_store[1]' etc. etc. I noticed that the value you are saving is a REAL, the example I've shown is using a DINT you may or may not want to change this. To save Hi_Amp_in_Minutes Move to month_store[index] To save Highest_Amp_Temp_Storage Move to month_store[index+1] Put in the ADD and change the add to 2 Steve Share this post Link to post Share on other sites
Posted 2 Mar 2016 Look up the DTR (Data Transitional) instruction. It will provide a one-shot action on any change. Share this post Link to post Share on other sites
Posted 2 Mar 2016 thanks guys, I love learning cool stuff like that. Share this post Link to post Share on other sites
Posted 3 Mar 2016 You can archive the monthly totals by moving the data into an indexed array, with logic to reset the indexer and start over. Share this post Link to post Share on other sites