LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

popup window

Hello,
 
is here somebody, who can help me solving this problem. I have a subvi, which is called up as a popup window in a main menu. The SubVi consists of an input and a output, where i can entered two numbers and get a calculated value. If i close the popup window and call it up again the entered numbers as well as the calculated values go back the startvalue null. How can i prevent it? I want that the subvi Keep the old values until I change the values in the SubVi again? May be it is not difficult, but I'm still a beginner.
 
Thanksyou all!!
 
Gnurt

Message Edited by Gnurt on 09-04-2005 09:45 AM

Download All
0 Kudos
Message 1 of 10
(5,706 Views)
there are many ways to acomplish that. Here are two:

-Use a while loop that puts the control values into an uninitialized shift register. If you don't know what that is, just ask again or look into documentation.
-put the controls in a case or event that is only executed when the values are ready to be inserted. The event case could be triggered by an ok button or the enter key. Next time you call the vi, it should not reinitialize the controls. Watch out, I think this may be considered poor programming practice.

Aart-Jan
0 Kudos
Message 2 of 10
(5,695 Views)
can you realise your idea in a Vi because i use the germanversion of Labview 6.1 therefore some terms i don't understand!
0 Kudos
Message 3 of 10
(5,692 Views)
well, in its simplest form, the attached picture shows two controls that will retain their values when called. The other state has a 100 ms wait in it.
Hope it is what you are looking for.  When es noch Sprachprobleme gibt, koennen wir es nochmal auf Deutsch versuchen.
Viel Erfolg!
0 Kudos
Message 4 of 10
(5,686 Views)
And here it is..
0 Kudos
Message 5 of 10
(5,684 Views)

thanks for you very fast answer but it doesnt work like i imagine.

 Maybe you can have a look to my Vis.

The popup.Vi is the main menu, the "reihe-parallel.vi" is a subVi. In the popup.Vi i run the program and can press to "plot" which call up the subVi "reihe-parallel" and a popup-window of the SubVi is opened. In this window I can entered numbered which are calculated.

 If I want to leave the Popupwindow I have to press"return" and come back to the main menu. If I press to "plot" again the popup-window opens but the values I entered before don't exist anymore instead of that they accept the startvalues "null". My intention is that everytime I press "plot" in the main menu the old Values I entered before are kept!

thanks!

0 Kudos
Message 6 of 10
(5,672 Views)

The values are reset because you set the controls in the connector pane. It seems that if you have an unwired control in the connector pane it defaults to its default value every time the VI is called.

Interesting, I wasn't aware of that.

To detect if you have a number wired into the VI input, you can make the default value NaN and check to see when the VI starts. If it is NaN, you can use an uninitialized shift register to get the value from the last time the VI ran.

A couple of additional comments - There is no need to place the property node inside the false case. Instead, just place the indicator inside the true case and it will only update when that case runs.
 
Also, what's the point of updating the z1 value in the subVI? Was that just an experiment because it wasn't working properly?
 
And in general, you shouldn't use the Value property. If you must do it like this, use a local variable instead.
 
To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with (although they are not in german). You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).

___________________
Try to take over the world!
0 Kudos
Message 7 of 10
(5,666 Views)

You helped me really a lot, it is crazy that you found my fault. I didn't aware the unconnected connector pane as well!!!

thanks a lot for all your help and the good tips!

I' m seriously intend to learn Labview, but learning by "try and error" is so hard! How did you learn Labview so professional and which way help me to improve knowledge in this programming language? Thanks for the tips with the books, but they don't show me the concept of programming labview but only leanring how to get to know the tools of the programm. I'm would be thankful for your tips!

 

Thanks you really really!! 

0 Kudos
Message 8 of 10
(5,664 Views)
Hi Gnurt
you can gain an insight to Labview programming by reading the discussion forum. See how wireworkers help each other
to solve Labview problems. Every one gains!!!
Another forum to check out is:
http://forums.lavausergroup.org/
Just register.
In fact I think there might also be a link to german labview forum from Lavausergroup (there are german wirewokers who use the site)

Learn what you can , share what you know.

chow
xseadog
0 Kudos
Message 9 of 10
(5,653 Views)

Other than the german user group (which is probably a good idea) there are also german speakers here, so if you are having problems with getting your problem solved in english, you can try posting questions in german.

You should also try looking for some books (try searching german internet book stores for "LabVIEW").

The best option is probably the basic NI courses I mentioned, but they will also cost you some money.

As for the style, if you read the different forums regularly, you can learn quite a lot from the more experienced users. The style guide I mentioned can also be found inside the LV bookshelf in your help menu, where it is part of a document called development guidelines, which also discusses some program designing techniques. You should also try reading the other application notes there, which are more advanced. You should also use the knowledge base in this site, which has many articles and examples on many different topics.

If you want just a few tips which will help you:

  • Remember the data flow! Use wires as much as you can to pass data around, to avoid running into race conditions.
  • Make sure your diagram is clean and easy to read. Add as much documentation as needed to make your program easy to understand when you come back to 6 months after you wrote it. In my opinion, it's better to have a larger VI that's easier to read than a VI with overlapping elements. At most you have to scroll.
  • Make useful subVIs whereever you can and give them good icons (I see you followed these two rules, which is very good).
  • Use the event structure for user interaction (in 6.1 it didn't include programmatic control yet).
  • Try to know what you are writing and why. You should have a reason for writing every piece of code that you write.
  • Have fun! That's the most important one. Go to the BreakPoint. Enjoy yourself.

There are probably quite a few others I forgot, but in general, if you really want to write serious programs, you will probably need some training, and you will definitely need experience.

In any case where you have problems and you see you can't find the solution yourself, post your question here, and we will be happy to help. If you become more experienced yourself, come back and help others.


___________________
Try to take over the world!
Message 10 of 10
(5,643 Views)