LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Taking last timer value

Solved!
Go to solution

Hello,

 

Looking for some help storing timer values.

 

Program backround: Will be used to collect data for life cycle testing on mechanical switch sump pumps.

 

Needs to: Count cycles (on-off-on) , Count times stuck on or off (allowed time is expected time for sump to fill/drain), show amount of time stuck on or off.

 

I have gotten all this functionality to work, but my issue is that when i save to spreadsheet each incriment of time stuck on/off is being saved. This could lead to a large number of unnecessary data points. Instead I want only the last non zero value of the stuck on/off timer saved. 

 

Any help is greatly appreciated.

 

~Andrew

 

 

 

 

 

 

 

0 Kudos
Message 1 of 7
(2,703 Views)

You can write to your file after your while loop is finished iterating. When you pass the value you want out of the loop, right click the tunnel and make sure the Tunnel Mode is "Last Value."  When you write that value once outside the loop it will be the last value.

0 Kudos
Message 2 of 7
(2,673 Views)

See if this does what you are looking for.  I used boolean crossing detection to trigger the Write To Spreadsheet function and simplify your counters.

Message 3 of 7
(2,665 Views)

Thank you for taking your time to help me with this!

 

However I was unable to open your work as I hav LV2010 not 2012, can you save as previous version for me and resend?

 

Thanks again

0 Kudos
Message 4 of 7
(2,660 Views)

Excuse me my current LabView version is 2011

0 Kudos
Message 5 of 7
(2,658 Views)
Solution
Accepted by topic author AnDroid1988
Message 6 of 7
(2,652 Views)

MStewart,

 

That worked great! Very clean and streamlined. This was my first attempt at Labview program and its very helpful to see other peoples ideas.   

 

The boolean crossing PtByPt VI is something new to me. I was trying to impliment the same idea using the event structure case but could never get it to function as I wanted.

 

My next step is to ramp this up to handle several setups (channels) at once.

 

Thanks to everyone who took the time to respond and help me with this.

0 Kudos
Message 7 of 7
(2,625 Views)