11-20-2020 06:12 AM
Hello.
Another one of my building blocks is causing me trouble. It works, sort of but not the way I want it.
As an example I have included a test VI.
I want to display two random numbers on my Front Panel and update them every 500ms. I can activate a boolean switch and start a logger. The logger interval has a different timing to the display. At present the display updates according to the logger interval when turned on.
I know I have done something wrong but I need a pointer in the right direction.
Many thanks.
Mark.
Solved! Go to Solution.
11-20-2020 08:58 AM
That's because you have a multi-second delay you've added to your execution data flow path when you start logging.
If you want the the display to update more frequently, don't put a delay in the logger. Put the logging in a case that runs when Logging?=True and Elapsed Time>= the desired rate.
The Elapsed Time Express VI is one of the few good Express VI's and is appropriate for this.
(Why did you take a boolean value, convert to 1:0, then wire that to a case structure? Just wire the boolean!)
11-23-2020 05:28 AM
So I have tried to clean up my VI and implement Elapsed Time. I still have a mistake but cannot see it.
The display works with the update rate as required. When the Logger switch is turned on, firstly it should write the header information and data points should reset to zero (does). Then after the interval has been reached, the data should be written,the data points incremented by one and the elapsed time reset.
What happens is that the data is written every 500ms.
Best regards
Mark
11-23-2020 05:51 AM
Hi vtiu,
@vtiu wrote:
So I have tried to clean up my VI…
Well, you could do better. (See attachment.)
@vtiu wrote:
When the Logger switch is turned on, firstly it should write the header information and data points should reset to zero (does).
Then afterWHEN the interval has been reached, the data should be written,the data points incremented by one and the elapsed time reset.What happens is that the data is written every 500ms.
Whenever you write "WHEN xyz THEN abc" you should use a case structure, with "xyz" connected to the case selector and "abc" in the TRUE case.
Right now you have not setup the cases and conditions as per your requirement…
11-23-2020 06:23 AM
This is indeed much neater but when I run it, it ask me for a filename to save?
Best regards
Mark
11-23-2020 06:27 AM
Hi Mark,
@vtiu wrote:
This is indeed much neater but when I run it, it ask me for a filename to save?
This was just an example of how a VI may look like after "cleaning up"…
You still need to implement your requirements as written before.