LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

make current values default

Hi,


I have a vi and I want to make current values default programmatically in run time. I have read a previous post here and I heard that I can do the following:

Open a vi reference to the desired Vi and use an invoke node with method "Make current values default" but....
the problem is the vi cannot be running it says, so I must to set it from a different VI (it cannot set itself).

The problem is that I want to "Make current value default" of all controls when I push a button (button 'Desar') in  my vi. See the vi I attach. And I want, that when I run it again the vi keeps the values I modify and It doesn't work.

How can I do it?

I receive the following error when I push the button 'Desar':

Error 1073 occurred at Invoke Node in DS_Client_Configuracio_GPSX.vi

Possible reason(s):

LabVIEW:  This property is writable or this method is available only when the VI is in edit mode.

Another question.....

I have heard that I could always create my own "default" values by creating an .ini file. Then I can then save the values to the .ini file to change the default for the next run of the machine. The values are read in the initialization of my program and the values are written to the controls/indicators but.... what is the structure of this .ini file?  I don't know how I have to create it (its structure) and how I tell it the values are read in the initialization of my program?

Thanks,

ToNi.
0 Kudos
Message 1 of 7
(3,162 Views)
As you have read in the other threads. IT CANNOT BE DONE!

And once you built an executable from your app it can't even be done by invoking this method from another running VI. Because this method is not available in the runtime environment as well as the save method and also because no modern OS will allow to modify the executable image file while an app is open.

What you really want is what has been told umptien times in the other threads already. Use INI files to save those settings to and load them on start of your app. You can of course insist on banging your head against a wall and we can't stop you but it is a painful experience  and it would be easier for you to accept the facts and just do as has been told to others before you. Look at the functions in File I/O->Configuration File VIs. You don't have to do anything with the file, these VIs will do all for you. Search for "Configuration File" in the Help>Examples Finder

Rolf Kalbermatter

Message Edited by rolfk on 07-06-2005 02:54 PM

Rolf Kalbermatter
My Blog
Message 2 of 7
(3,144 Views)
Hi, I'm a new poster here.  I'm also working with an implementation of 'Make Current Values Default' and I've got to say, it works for me.

My work involves saving data files in the research laboratory where I work.  I'm developing an overarching system that will allow for a fail-proof data storage system.

Basically, I have a bunch of 'template' VIs corresponding to the particular data needs of a user.  It consists of an an input and output terminal in the form of a cluster that contains the data.  There's also a case structure with a blank constant to pass to the output terminal while saving to keep file sizes down.  This template is used in a 'write data' VI.

In this higher level 'Write' VI, the data is passed into the template VI, which executes itself.  LabVIEW is nice to me, and keeps this VI in memory even after execution, which allows me to open a reference to it, set its current contents (i.e., the data) as default, and then save a copy as my 'Data VI'.  I call the system DataVIew, because (corny slogan warning) "The Data IS the VI".

It works like a charm.  With one little problem:  This method doesn't work at all if the 'write' VI is involved in any sort of loop structure.  For some reason, the template VI doesn't revert to edit mode after its copy has been saved, so the second (or further) time it tries to set default values, I get the 'not in edit mode' error.

So basically, my question is: Is there a programmatic way to unload a VI from memory?  I'd like to do this after the copy is saved, so that a fresh 'instance' of the template VI is opened on the next iteration of the loop.  I'm willing to deal with the computational overhead involved.

Edit 1: (sorry for 'hijacking' this thread, but I can't seem to find a 'post new topic' button anywhere)

Edit 2: (Doh.  I found it right after my first edit.  I'm used to it being called 'new topic' instead of 'new message')

Message Edited by Brock Greman on 07-06-2005 03:39 PM

0 Kudos
Message 3 of 7
(3,133 Views)
Thanks very much, 😉
0 Kudos
Message 4 of 7
(3,104 Views)
Try checking out this thread

I think that should have what you're looking for.

Message Edited by Novatron on 07-08-2005 08:40 AM

Message Edited by Novatron on 07-08-2005 08:41 AM

0 Kudos
Message 5 of 7
(3,103 Views)
Unfortunately, that doesn't seem to help me much.  There's no definitive answer to whether a VI can be programmatically unloaded from memory.
0 Kudos
Message 6 of 7
(3,083 Views)

Brock;

Check your other thread. Your problem is fixed and the code is waiting for you...

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 7
(3,073 Views)