Start a new topic
Answered

Graphical Simulation Plotter during Simulation in Vortex Player.

Good Day!


I would like to know if it is possible to access Graphical Simulation Plotter during Simulation in Vortex Player.

My objective is during simulation, I can plot the path curve of the container during the operation and convert it to CSV File.


It is easy on Vortex Editor but I can`t do it on Player.

Is it possible?



I am looking forward to hearing from you.


Regards,

Mark


image.png

8960:39957

Best Answer

Hi Mark,


I don't know of a way to show the plotter in the Player. Maybe another of my colleagues can reply if they know a way.


But if you want to log some values in a .csv file, you can write a Python script to do that. Python has some fairly easy methods to read and write text or .csv files, so you could write a script that has some input fields, then writes the values from those fields to a .csv file. 


I've attached an example of this that's somewhat more sophisticated, which let's you specify a VHL interface, and every step it will read all the values from the interface and log them to a file. 


To use it, add a script to your mechanism or scene, select this file as the Script File. Step the simulation once, which will trigger the script to create its fields. Refresh the properties by clicking on another object in the Explorer, then select the script again, which should now have some fields. 


Choose a file name for the Output File parameter. Select a VHL interface with the values you want to log (if you don't already, you'll have to create a VHL interface and add the values to it). Then when you have Logging Active and Save Output selected, the values from the interface will be written to a file.


Martin

py

Answer

Hi Mark,


I don't know of a way to show the plotter in the Player. Maybe another of my colleagues can reply if they know a way.


But if you want to log some values in a .csv file, you can write a Python script to do that. Python has some fairly easy methods to read and write text or .csv files, so you could write a script that has some input fields, then writes the values from those fields to a .csv file. 


I've attached an example of this that's somewhat more sophisticated, which let's you specify a VHL interface, and every step it will read all the values from the interface and log them to a file. 


To use it, add a script to your mechanism or scene, select this file as the Script File. Step the simulation once, which will trigger the script to create its fields. Refresh the properties by clicking on another object in the Explorer, then select the script again, which should now have some fields. 


Choose a file name for the Output File parameter. Select a VHL interface with the values you want to log (if you don't already, you'll have to create a VHL interface and add the values to it). Then when you have Logging Active and Save Output selected, the values from the interface will be written to a file.


Martin

py

1 person likes this

Hi Martin,


Apologizing for the late response.


It helps me a lot! I highly commended it. 


Other Information:

Initially, when run my simulation with Vortex Studio Player 

(My set up is 1 Master&1Console(PC1), 3 Slaves (PC2~4) ), 


The CSV File only writes simulation time.


But when I add CSV Writer on the .vxconfiguration I used (on all slaves),

It writes now my desired data.



Thank you very much for your guidance.

It is highly appreciated.


Cheers,

Mark

Hi Mark,


Glad to hear that you got it to work!


To be honest, I'm not sure why you would have to add anything to the .vxconfiguration, since I thought the script would only use standard Python functionality to write to a file. But if it works, that's what's most important.


Cheers,

Martin

Login to post a comment