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: 

Create a Timer (with memory ) to use for more than one action

Hi

Problem:

I have created a Timer with an ON/OFF button . But the Timer reset to zero after one action.

 

**The Timer should be reset to zero only when i colse it with the off Button (Or when i change the value to zero )   otherweise  i wante it  to save the initial value and be ready to use for other actions .

Any help is welcome !

Thanks

 

0 Kudos
Message 1 of 11
(3,635 Views)

Please post your code. Otherwise, we don't understand where your issue might be.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 11
(3,634 Views)

Hiere is the code

Download All
0 Kudos
Message 3 of 11
(3,629 Views)

Hi bibo,

 

there is no code, there are just 3 images!

Please attach real code!

 

(And before you do this think about cleaning up, replace locals by wires, think about proper program design…)

 

Why is there a control without a label?

Why do you set the visibility of this labelless control always to TRUE? Why set the visibility at all?

Best regards,
GerdW


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

Hi GerdW,

 

To be honest i am not the one who wrote this code , i just  have to improve the timer function .

The visibility is used so that when the Button ON/OFF is true  the timer will be visible . But i thinik it s not necessary ..

 

 

0 Kudos
Message 5 of 11
(3,590 Views)

Hi bibo,

 

when you want us to improve the "timer function" then you should also attach the missing subVIs…

 

To be honest i am not the one who wrote this code

But you are responsible for this code now - and it is awful!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 11
(3,582 Views)
Hi bibo, Now you are responsible so redesign it . here i am pasting a link this snipet will help you http://forums.ni.com/ni/attachments/ni/170/988115/1/Log%20data.png
Venugopal
0 Kudos
Message 7 of 11
(3,559 Views)

VenuGopal@57 wrote:
Hi bibo, Now you are responsible so redesign it . here i am pasting a link this snipet will help you http://forums.ni.com/ni/attachments/ni/170/988115/1/Log%20data.png

I'm not sure I would refactor that monster.  There are so many potential race conditions and bad practices that fixing stuff would probably break the heck out of it.  I would begin by trying to organize it by cleaning it up cosmetically.  Then try to understand what each section of code does before even attempting to optimize.

 

This will be no small task for even an experienced LabVIEW developer, and quite possibly too big a job for someone whose experience level is indicated by the question that is being asked.

 

I'm in no way knocking the OP; we've all had to start somewhere.  🙂

 
 
 
Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 11
(3,533 Views)
Hi bill, I can understand that, In the above post i have attached a snipet link for timer did u checked it out?
Venugopal
0 Kudos
Message 9 of 11
(3,508 Views)

Hi GerdW ,

I couldnt attach the missing subVis so i linked them in this Dropbox link .

 

https://www.dropbox.com/s/b8bgtvstblawk82/ReMa_v2.0.zip?dl=0  

 

Path: ReMa_v2.00\ReMa_v1.3.7_Trial1\quelltext für ReMa 1.3.7 then simplecurvetrace.vi

I hope you guys are gonna help me even if the code is awfull .

 

Best regards

 

 

 

 

0 Kudos
Message 10 of 11
(3,496 Views)