• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 115
  • Last Modified:

Random Data Generator part 3

EE Pros,

I have a great WS that is used to generate random sensor data and it works great.  However, I need to add a refresh capability so that certain columns are randomly refreshed based on a "Interval Update".

File attached!

Thank you in advance.

B
D--Data-Business-Programs-Archieve-Macro
0
Bright01
Asked:
Bright01
  • 7
  • 4
2 Solutions
 
gowflowCommented:
the file you attached has no extension what type is it ?
gowflow
0
 
Bright01Author Commented:
Gowflow,

Greetings!  It's an .XSLM file.

B.
0
 
gowflowCommented:
C11 has No
D11 has Yes
Which one you want to trigger the refresh ?

and presume by refresh you mean like manually pressing on Random button right ?
gowflow
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
gowflowCommented:
Try this
I made it so if you put both C11 and D11 yes it will refresh auto as per value in C7. Try changing the value while it is refreshing and see if it picks it up. To stop just put No in C11.

If you noticed I suppressed the Done message when timer is activated. Don't really know why you have D11 but you may comment on that.

gowflow
D--Data-Business-Programs-Archieve-Macro
0
 
Bright01Author Commented:
Almost.  If I have "Yes" in C11, then the time should also advance by the "Interval" time.  So if the Interval time is 5 seconds, then the timing advances by 5 seconds every 5 seconds.   If D11 is also "YES", then the numbers in col. D also are updating.   We can take out the "DONE" notice.

Thank you.   Here's the latest with a button added for starting the auto. feature.
D--temp-Realtime-v4.xlsm
0
 
gowflowCommented:
Sorry do not follow you !
What is this time thing you did not mention it before and no clue what your talking about where you want the time to reflect ?
and why this button Auto ?
gowflow
0
 
Bright01Author Commented:
Sorry.  I should have been more clear.  I thought the comments in the WS would explain.

More Detail;

I'm trying to generate random sensor data to demonstrate a realtime data feed.  So when you pick the "refresh" interval, that represents the timing of a refresh to specific columns (C and D).  At the same time, I want to control if the time (col. C) or the reading (col. D), or both are refreshed by saying YES or NO over the column.  If YES, then the Column, be it C or D or Both, get the new values.

Does that make sense?  If it's way beyond easy, then let me know.

Thank you again,

B.
0
 
gowflowCommented:
Still not clear

you mean to say that you macro 'Generate_Samples' need to be modified so it increment in the time that is in col C each pass by the value that is in cell C7 ???

If yes then I did not look into the logic of this procedure 'Generate_Samples' as assumed it is working as you intend.

I do not understand what it adds to get the time the formula I see is:
Cells(r + 13, 3).Value = dtStart + (dblTime * r)

you mean to say we need to change the logic ? if yes I need to understand the components.
gowflow
0
 
gowflowCommented:
Well I think I guessed it.

This is how it works: (pls correct me if I am off)
you may put yes or no in any of C11 or D11 and you may set seconds in units in cell C7

depending on the value of C7 say 3
if C11 has yes and D11 has yes then what will the macro do is the following
at every 3 seconds it will refresh the data and do the following it will add to the existing time in cell D6 3 seconds to show a new value and all the other items in col C11 to end and D11 to end will be incremented by 3 seconds in the time and the random values will be displayed.

if any of the Cell C11 or D11 show a no then whatever value there will be frozen and will stop incrementing and will remain as last seen. so you may put no in C11 all dates will b frozen and readings will keep changing by 3 seconds and likewyse if D11 has no then reading are frozen and dates if yes will keep incrementing by 3 seconds.

You may at anytime increase the seconds and automatically it will pickup the new interval and act accordingly.

I also added the button Start / Stop in green that will toggle each time you press it and this will start or stop the timer but action will only depend on values of C11 and D11 to be either yes or no or both

Pls correct me if I am wrong specifying exactly what need to be done.

gowflow
D--temp-Realtime-v5.xlsm
0
 
Julie ThomasCommented:
I think this will do what you're looking for.

The "Random" button will start the autorun if your value of seconds is greater than zero.
If the seconds value is zero or blank, it runs once.

The "Stop Autorun" button will stop the autorun.

You can get a little better performance if you write your values to an array and write out the array to the range on the sheet, rather than looping over the cell range on the worksheet.

The last run time also appears in cell F7.
D--Data-Business-Programs-Archieve-Macro
0
 
Bright01Author Commented:
Great job you guys!  Julie, I liked your design but gowflow's work does the job without any changes to the value of seconds.  I also appreciated your comments on making this an array to run faster.  I'm authoring another question to get that done.  

Gowflow...... excellent work as usual.

B.
0
 
gowflowCommented:
your welcome and glad I could help
gowflow
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now