[Resuelto] Saving Parameter Value and use them in other VM  

  RSS

hiren.ectech
(@hiren-ectech)
Active Member
Registrado:hace 12 meses 
Respuestas: 14
31/08/2017 10:11 am  

Hi Javier,

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?

Regards,

Hiren 


ResponderCitar
admin
(@admin)
Miembro Admin
Registrado:hace 1 año 
Respuestas: 47
03/09/2017 8:24 pm  

Hi,

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.

 

Best Regards,

Javier Velásquez


ResponderCitar
hiren.ectech
(@hiren-ectech)
Active Member
Registrado:hace 12 meses 
Respuestas: 14
04/09/2017 1:03 am  

Dear Javier,

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.

Regards,

Hiren


ResponderCitar
admin
(@admin)
Miembro Admin
Registrado:hace 1 año 
Respuestas: 47
04/09/2017 10:32 pm  

Hi,

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.

 

Best Regards,

Javier Velásquez


ResponderCitar
Share: