LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create new vi by clicking on a button in front panel

Solved!
Go to solution

Hi. I'm quite new with Labview.

I have to use an if statment to enable a button(I dont know whether it is possible or not in LabVIEW) then when the button is enabled to user should click on the button(lets say NEXT button) to close that vi and open another vi from a specific address.I don't need to save anything from the previous vi I just need to close it and open another one .

Does anybody know how to first enable a button as a result of getting correct answer from an if statment and also how to close and open new vi by clicking on that button.

 

Many thanks.

0 Kudos
Message 1 of 13
(4,552 Views)

Hi again.plz let me know If i need to provide more information. Iwould really appreciate your help.

0 Kudos
Message 2 of 13
(4,537 Views)

enable/disable buttons is done through property nodes.

Launching a vi from an address is done through dynamic vi calls but there is usually an easier way.

What is the end goal of the application?

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 13
(4,534 Views)

sounds like homework...

 

Right-click the button and create a property node and select "Visable" to control hide/show. There is also an enable option.

 

Sub-VI set for "Show FP when called" and Close if orignally closed" will do the rest.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 13
(4,533 Views)

eaxctly these are some coursworks for students.

they start from Q1 .The correct answer can enable the Next button then when they click on next the vi for Q1 will be closed and new vi for Q2 will open.the same for Q3 and ....

 

and many thanks for your help

 

 

0 Kudos
Message 5 of 13
(4,525 Views)

thanks it works perfect now

just a quick question.I would like to have LabVIEW open and run the VI when I open the other qustions so I set the appropriate Execution options in File»VI Properties to make a VI run when opened but it works only for the first vi and when I open a vi from another vi the second vi will open but not run.Would u plz let me know how can I make sub VIs  to run when open

0 Kudos
Message 6 of 13
(4,510 Views)
Solution
Accepted by topic author ethen99

I think that the attached will help you a lot further.  I've documented where needed.  If you have any more questions, don't hesitate to ask.

 

Open Main.vi and run it 😉

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 7 of 13
(4,488 Views)

Many thanks Bjorn

it works very good just sometimes I get this error when I want to open vi number 2 from number 1 for the second time.It works when I click on continue but do u know how can I get rid of this error

 

0 Kudos
Message 8 of 13
(4,477 Views)

Your second VI is probably already running, thus you get an error when you try to run it again.

0 Kudos
Message 9 of 13
(4,464 Views)

Hi en99,

 

As Raven already stated, your second VI is probably still running.  Make sure that when you close that VI down, that it stops running.

 

If that 's not the case, can you post your code in here so we can  have a look at it?

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 10 of 13
(4,457 Views)