12-03-2008 01:37 PM
12-03-2008 02:12 PM
Use a Property Node to read the Default Value, and change the controls/indicators.
12-03-2008 02:25 PM - edited 12-03-2008 02:26 PM
There is a VI method to reinitialize all to defaults. Simply place it inside an event or case, triggered by your control.
12-03-2008 02:35 PM - edited 12-03-2008 02:38 PM
Actually, long ago I even made an example. (Discussed here).
Note that you actually don't need to ame the VI reference. Unwired, it will apply to the current VI)
12-04-2008 06:04 AM
12-04-2008 08:32 AM
If you just need to set some items, but not all, here's an example in LabVIEW 8.5.1:
12-04-2008 08:56 AM - edited 12-04-2008 08:58 AM
Why would you use the property node and a local variable instead of just using the invoke node, which perfoms the same action in one step?
Also, you have a greedy loop. That's a no-no.
12-04-2008 09:01 AM
Using the default value option in LV works great for some cases, but I find myself using configuration .ini files more and more. Using configuration files you can set a default value in development mode and in an exe. With configuration files if you find the need to set the default to a different value after you have built your application into an executeable, all you have to do is open the ini file with a text editor (ie notepad) and change the value. If you do not use ini files then you have to open up the source code and change the default value and rebuild the application.
You can have a look in the examples to find out how to use configuration files.
Just my 2 cents
12-04-2008 09:25 AM
Oh yea? Well... your icons don't line up nicely.
You are absolutely correct. I wasn't going to use a while loop at all, but I should have put a wait in there.
Obviously, there is more than one way to blink a light in LabVIEW!
12-04-2008 11:00 AM - edited 12-04-2008 11:07 AM
cmwolf wrote:
I need to have the default button only effect some of the controllers the VI you have in your example affects all items on my run page even my temperature and pressure measuring items is there a way I can segregate and isolate groups of items even if I have to use multiple right now I would be OK with that(actually almost prefer that).
You can make an array of references, containing references to all controls you want to reset and the simply autoindex over them in a FOR loop whenever needed to reset each to defaults. You could even match it to a boolean array in order to select which ones you want to reset at runtime.
Here's a rough draft (LabVIEW 8.5). Note that you can easily mix references for various controls (boolean, slides, etc). They will be coreced to the common generic class at the "built array" node.
cmwolf wrote:
Also I am very confused on the while loop setup I tried to place one in my setup and could not get anything to correctly work is there a good tutorial or something that can walk me through how to use it better than the books I received with the hardware.
Please tell us in what way "it does not work correctly". Most likely it's some trivial thing.