[Resuelto] Saving Parameter Value and use them in other VM
Hope you are doing well and won't mind taking one more question from me.
In my project, I need to control a machine based on some parameters set by users and some default parameters.
For that I have planned a User Input VM which asks user to enter parameter values and an Admin VM with password control to set the default parameters.
The machine control VM obtains the parameters from User Input VM and automatically load the last saved default values and controls the machine accordingly.
Now, I want to understand how to store the parameter values and use them in Machine control VM.
I tried to save these parameters in Variables, but these variables are not available in the other VM. Also, I need set the default parameters every time I start the application.
Can you please suggest any work around for this?
You could implement one VM to Save the parameters (With CSV File elements) and Other VM to Load that Parameters...
I have attached an example.
When you run the "Main" VM, It will run the subVM "LoadParameters.vlogic" and this subVM will ask for a TXT Settings File Path.
It is located at "\projectSavingParameters\ParametersFile" > "Parameters.txt"
If you want to run it without the file path dialog you can replace the "File dialog" VM located in "LoadParameters.vlogic" with a Path constant.
To tun this example is neccesary update the "App_Abort_JV" Element with the attached .class file.
I understood the concept and also have implemented the same in my project.
However, one strange thing I have noticed as following (in your example project as well):
I have saved the parameters using ModifyParameter VM in a file.
Now If I am launching the MachineControl VM, it still uses the old parameters.
It does not load the new parameters until I close the Main VM and start again.
Can you please check and provide solution?
Thanks in advance.
If you want not restart the Application to refresh the parameters you can modify the example as the attached example.
Before run the example you must update the parameters.txt file patch in loadParameters subVM.
If you want to create distributions with SubVM you must copy all subVM folders into your distribution folder.