From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuosly need a running time for a elapsed time

Hello all , 

i need to find a elapsed time for time consumed. I have used a " Get date and time in seconds " ,

" Tick count " for the process..it throwing answer  directly. 

 i need a continuous running Indicator . post  your views

i have an attached a VI

0 Kudos
Message 1 of 13
(3,748 Views)

Hi Bhuvanesh,

 

My interpretation is that you want to see how much time has elapsed while your code is running. For that, you have a couple of options:

  1. Break your code up into smaller chunks. For example, if you are doing a calculation over and over, you can do calculation > check the time > do calculation > check the time... etc. A state machine might aid you in this.
  2. If you cannot break up your code, you will need your timer running in a parallel loop, and establish any communication between the loops that you find necessary. 

Also, instead of using the express VI, you may look at High Resolution Relative Seconds, found in the hidden gems installed through VIPM.

temp.png

0 Kudos
Message 2 of 13
(3,726 Views)

I am getting more confused as I read your description versus your code.  Maybe this will point you in the right direction.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 13
(3,720 Views)

@Gregory wrote:

Also, instead of using the express VI, you may look at High Resolution Relative Seconds, found in the hidden gems installed through VIPM.

 


I don't remember which version started it, but that function is an actually released function now in the Timing palette.  No need for the Hidden Gems package to find it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 13
(3,716 Views)

@Mrtechie wrote:

 

 i need a continuous running Indicator


Nothing In LabVIEW is "continuous". An indicator is updated when your code writes to it.

 

If you want a countdown during the inner sequence frame, you need to re-architect your code as a state machine and write to the time indicator more often. What kind of "code" is in that inner frame? A loop?

 

Depending on the nature of the inner code, you might need to run the timer in a parallel loop and start/pause/reset/etc. it from the main loop.

 

I would also recommend to use a relative time format for your time indicators. More intuitive to read.

0 Kudos
Message 5 of 13
(3,705 Views)

Hi All, 

I have tried these methods ( tick count, Get-Date & time in seconds, High-Resolution Milliseconds ) these are directly throwing an answer. I need to find elapsed time starting from  (0.1  to end ) .

 

i have a used a state machine architecture for my application. i have attached a code. ( in last frame I have done using tick count to find the elapsed time  ) 

 

Yes , i want to see how much time has elapsed while my code was running

0 Kudos
Message 6 of 13
(3,659 Views)

Hi Gregoryj , 

 you want to see how much time has elapsed while your code is running.

Yes exactly. !!!

i need a continuous running indicator ( elapsed time -> 0.1 to end ) 

0 Kudos
Message 7 of 13
(3,656 Views)

You are clearing out your start time in at least the state you are showing.  You have a bunch of tunnels you are using the Use Default If Unwired.  That is typically a bad idea because it causes errors like this.  You need to wire your values through the cases that do not update the shift register.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 13
(3,633 Views)

hello crossrulz , 

ya  i have the bunch of tunnels. but i have done that for elapsed time Shift register tunnel completely .

 i want a countdown from 0.1 to end . that's it . 

or tell some other way to find the elapsed time while my code was running . 

shall i use a event structure time node ?? 

 

Spoiler
Maybe this will point you in the right direction.

ya i have tried your code too. in that also directly throwing the answer . it needs to starts from 0.1 to end .( update like a elapsed  time express Vi )

 

0 Kudos
Message 9 of 13
(3,624 Views)

So you want something more like this?

 

I just used 2 to make it more obvious what is happening as you try the code out.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 13
(3,615 Views)