annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

Problem with timing in my data logger

Risolto!
Vai alla soluzione

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.

0 Kudos
Messaggio 1 di 6
1.892Visualizzazioni

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!)

0 Kudos
Messaggio 2 di 6
1.854Visualizzazioni

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

0 Kudos
Messaggio 3 di 6
1.825Visualizzazioni

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 after WHEN 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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Messaggio 4 di 6
1.819Visualizzazioni

This is indeed much neater but when I run it, it ask me for a filename to save?

 

Best regards

Mark

0 Kudos
Messaggio 5 di 6
1.811Visualizzazioni
Soluzione
Accettato da vtiu

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.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Messaggio 6 di 6
1.808Visualizzazioni