LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how inactive a button automatical in new program runing?

Solved!
Go to solution

Hello

I have some tab control in my program , containing some array . when I placement numbers in arrays, I use a button to show finish the importing numbers to arrays of that tab control. actually, I produce number 1 by button to show that. when all of tab control produces number 1, by total of these numbers, I understand that all of tab controls are ready (for example if we have 5 tabcontrol, we have five number 1 that produces by buttons), result, my program start (my program is in a case and my case activate by number of tab conrols (for example 5) ).

now, I have a problem with buttons. because when I run the program again, buttons are activate by last push yet. I want inactive that buttons when my program stop. can you help me?

 

 

 

Best Regards

 

 

 

 

 

 

 

0 Kudos
Message 1 of 12
(3,950 Views)

I think my english is not so great, I am finding It difficult to understand your problem. The only thing i recommend is :

 

There is a property node in LabVIEW which will allow you to disable the button.

 

Right click on button you want to disable

go to create

go to property node

select disable and place it on block diagram

connect constant to this property node and select appropriate option.

With Regards

Miraz
Kudos is better option to thank somebody on this forum
------------------------------------------------------------------------------
Message 2 of 12
(3,934 Views)

@behzad1 wrote:

Hello

I have some tab control in my program , containing some array . when I placement numbers in arrays, I use a button to show finish the importing numbers to arrays of that tab control. actually, I produce number 1 by button to show that. when all of tab control produces number 1, by total of these numbers, I understand that all of tab controls are ready (for example if we have 5 tabcontrol, we have five number 1 that produces by buttons), result, my program start (my program is in a case and my case activate by number of tab conrols (for example 5) ).

now, I have a problem with buttons. because when I run the program again, buttons are activate by last push yet. I want inactive that buttons when my program stop. can you help me?

 

Best Regards


 

I am not sure what your problem is, but I guess you have a problem with the buttons' latching mechanism. If so, here you can read about the options:

https://www.ni.com/docs/en-US/bundle/labview/page/changing-the-mechanical-action-of-a-boolean-object...

Also, if you open up the properties of your button with right click, you can change and also discover the latching mechanism of your buttons.

 

But the best would be if you could attach your problematic VI, it looks to me that what you want to do, could be done easier in a more simple way.

Message 3 of 12
(3,924 Views)

Hi Behzad 1,

 

Select "Latch when Released" mechanism (see the below picture). Try this and tell me

 

disabled.JPG

Message 4 of 12
(3,918 Views)

I think the poster knows how to disable/enable controls, see his previous post...

 

I have attached an example VI which shows you two different mechanical action of buttons.

I think you want a button with mechanical action: "latch when released". Actually you have this behaviour by default if you drop an "OK" button on your front panel.

If you read out the state of this button, the button will go back to the initial false state.

Does this help you?

Message 5 of 12
(3,911 Views)

thank you friends

I think I was very bad to explain the problem.

I attached a picture. and replace button by a switch for better explanation.

 

1. I have a switch. I run the ptogram and then, I turn it on. I want this mode untile program stop.

2. I stop the program, but switch is turn on yet.

3. I run the program again, but switch is turn on yet. I want switch off, when program start again.

 

why?

 

because user should active switch. when switch is off, a red light, alam the user to knowledge which tab control have not data. he should write data and turn switch on. this number, turn alarm off.

 

is it beter explanation?

 

 

Best Regards.

 

0 Kudos
Message 6 of 12
(3,898 Views)
Solution
Accepted by topic author behzad1

NEVER ever run your VI in continuous mode as you mark it on your screenshot!

This is not how to use LabView. Use a while loop for example if you need continuous execution.

I strongly recommend you to take some beginner training in LabView, there are different options, like online self-paced training, google for it.

 

If you post and attach your actual VI, people here can recommend you a better way probably how to fulfil your needs with your code. In this way you also learn from your mistakes, this is how to learn LabView...

I have attached an example, where at start of the VI all the things reinitialize via a invoke node.

regards,

Message 7 of 12
(3,887 Views)
Solution
Accepted by topic author behzad1

Do not use run continuous button, in order to contineously run the program use a while loop in background.

 

If you wat toggle switch to perticulat condition then initialize it with that condition before entering in to loop.

 

There are other ways to do it, I just showed crude way.

With Regards

Miraz
Kudos is better option to thank somebody on this forum
------------------------------------------------------------------------------
Message 8 of 12
(3,880 Views)

@Miraz_Automation wrote:

Do not use run continuous button, in order to contineously run the program use a while loop in background.

 

If you wat toggle switch to perticulat condition then initialize it with that condition before entering in to loop.

 

There are other ways to do it, I just showed crude way.


In this example what you show, it is totally OK to use local variable. Updating controls via local variables is a common practice. (but not indicators, be aware of possible race conditions!)

0 Kudos
Message 9 of 12
(3,871 Views)

thanks a lot Blokk

I will attach my final code, when it finish.

your suggestion is very good, but I delete a some of your block, and it work yet. can you explain why it happen and is unnecessary other part? I attatch changed code.

 

by the way, Reinitialize All To Default block is in property of Invoke Node block? I couldnt find it on that properties.

 

Best Regards

 

0 Kudos
Message 10 of 12
(3,863 Views)