LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Expected time to complete a measurement (for while loop structure)

Solved!
Go to solution

Hello LabVIEW enthusiasts,

 

I'm doing a project work using LabVIEW where I'm doing some measurements using multiple function generators. For each measurement I want to show how long (Remaining time HH:MM:SS format) a measurement (for one function generator) will take to be accomplished. 

 

Note: all my measurements have been done using while loop structure.    

 

Looking for an urgent help!

 

Thanks.

- Reduanul 

0 Kudos
Message 1 of 12
(2,847 Views)

Hmm.... Without some sort of live measurement status updates from the instrument itself all you can really do is guess.

 

If you are taking several measurements you could use a simple status indicator that counts them down. Like "Measurement "X" of "Y" in progress"...

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 12
(2,814 Views)

Hi REDUANUL,

 


@REDUANUL wrote:

For each measurement I want to show how long (Remaining time HH:MM:SS format) a measurement (for one function generator) will take to be accomplished. 


So what have you tried and where are you stuck?

To show the remaining time you just need to subtract the elapsed time from expected complete execution time!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 12
(2,813 Views)

Hello GerdW,

 

Thanks for your suggestion. Sorry to say I am totally stuck in while loop condition.I could show the progress of measurement (attachment available) using a slider but that works in for loop instead of while loop. In while loop there is no such condition "Loop count", this is the problem I'm dealing with because in my developed program I used while loop. 

 

- Reduanul   

0 Kudos
Message 4 of 12
(2,784 Views)

While Loop or For Loop it does not matter.

 

Without knowing how long each measurement "should" take, how can you know how much time is left?

 

If you want a countdown timer then you are going to have to first figure out how long it takes to complete all of your measurements.

 

Then you could start an elapsed time timer and subtract the elapsed time from the total time it should take.

 

Of course this will not be accurate if something gets "hung up" or something causes a time delay that you have not accounted for. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 12
(2,776 Views)

These lines are at the very bottom of @RTSLVU's replies to your post:

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)

 

Post your code, then we can make "sensible" suggestions (such as "Learn to use the functions on the Timing Palette", or "Pay attention in class", or "Understand what happens when you use DAQmx" ...).

 

Bob Schor

0 Kudos
Message 6 of 12
(2,764 Views)

One of my measurement is Frequency sweep. I have attached my VI file. please have a look and enlight some knowledge for calculating remaining measurement time within this structure.

 

Thanks. 

0 Kudos
Message 7 of 12
(2,736 Views)
Solution
Accepted by topic author REDUANUL

I don't have the DWF VIs you use, so I will have to guess.

 

Request 1. show remaining time:
If you know the time, just place a numeric indicator and set it to display time.

 

Request 2. calculate remaining time:
I would create the inputs for each test steps first and run a for loop instead. I have attached a version of your code with only the logic from your VI and made modifications on that. It looks like this:

thols_0-1614670277446.png

This assumes you know the time for each step and that it is the same for all steps. If not, then you can probably calculate each step's time from the input data. 

 

You can run my VI and see the time indicator update with time left.

 

 

Certified LabVIEW Architect
Message 8 of 12
(2,722 Views)

@REDUANUL wrote:

One of my measurement is Frequency sweep. I have attached my VI file. please have a look and enlight some knowledge for calculating remaining measurement time within this structure.

 

Thanks. 


Again you are going to have to know how long it should take, or at least how long each step should take to have any sort of a countdown timer.

 

How about instead of displaying the time remaining you display the steps completed using a %0-%100 progress bar.

========================
=== Engineer Ambiguously ===
========================
Message 9 of 12
(2,707 Views)

 Thanks for the solution thols 🙂 

0 Kudos
Message 10 of 12
(2,705 Views)