LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Make Current Values Default in running subVi

Hi There!
I have a main Vi passing numerous parameters to one subvi. The aim of the main Vi is in fact to test different parameters. When a good combination if found I would like to be able to make the current parameters default values for the SubVi. So that I can use directly its "trained version" in other Vis.
I don't manage to do this with the Vi server; "Make current values default" is only appliable in edit mode and my subVi is in run mode (though he does not allow an abort call...)
mmhhh, any Ideas?
Thanks
0 Kudos
Message 1 of 11
(4,849 Views)
Hi PiF:

You can use INI files.

Your can create an INI file in your Top VI and then call to the SubVI.

The SubVI shoud read the INI file to load its parameters.

When you get correct results, the INI file is done, and you have the right INI file to run any other files.

This is one way, but may be more and better.

Aitortxo
Aitortxo.
0 Kudos
Message 2 of 11
(4,842 Views)
oopps, I was wrong 🙂

Message Edited by GerdW on 11-24-2005 03:57 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 11
(4,831 Views)
Hi Aitortxo
Thanks for your answer
I thought about such a solution.
It certainly will work, but I'm concerned with speed here...
I dont like the idea of having to reenter as input a large number of parameters every time the subVi is called.
Have a nice day
 
 
0 Kudos
Message 4 of 11
(4,805 Views)
Ok, PiF:

You can call your main program as a subVi (just putting it in the block diagram) and add an error output to it.

When good parameters have been detected, when you tried to save as default, just quit de program normally (the current values are the ones you want to save)

Wire the error output to an invoke node that references your SubVI and select "Make current values default".

As the SubVI has been stopped, you should be able to save them.

A bit long, may be.

Aitor.
Aitortxo.
Message 5 of 11
(4,788 Views)

mmmmhhh clever!

I'll try this today

thanks

0 Kudos
Message 6 of 11
(4,770 Views)

Hi, Aitortxo,

Would you please attach one VI example to show how to use INI file to initialize one VI? Sorry that I am new to LabView. I know what you mean, but do not know how to do it.

I want to set the current value in my main VI as the default one at the very beginning when the VI program is running.

This is to ensure that: in case of power shut down or the PC is hang, users can still load the original setting by restarting the VI program.

Thank you very much and best regards.

Xiaogang

 

 

 

0 Kudos
Message 7 of 11
(4,740 Views)
Hi there
Actualy it took me a few days to try...
It does no seem to work!
I still have an error message telling me my subVi should be in edit mode to perform this operation...
and the changes in default values are not effective.
Any Ideas
 
0 Kudos
Message 8 of 11
(4,703 Views)

Thanks a lot, all the answers I was looking for where there!

Have a nice day

 

0 Kudos
Message 10 of 11
(4,675 Views)