Effacer les filtres
Effacer les filtres

Save simulation data in TargetLink Main Dialog with use of API commands

12 vues (au cours des 30 derniers jours)
Patrik
Patrik le 29 Juin 2011
I´m trying to save my simulations data in TargetLink using API commands. In the GUI, data can be saved by entering the block TargetLink Main Dialog/Simulation.
I know that the data from a simulation should be stored in the TLDS memory, and I need to extract the simulation data. Do anyone know how to save the data by using API commands?
Kindly suggest me some solution for my problem.
Thanks
Patrik
  1 commentaire
Kaustubha Govind
Kaustubha Govind le 29 Juin 2011
Patrik: You may have better luck on dSPACE forums with this question.

Connectez-vous pour commenter.

Réponse acceptée

Patrik
Patrik le 1 Juil 2011
I got this answear from dSpace:
In general there is no official API avaliable to store TargetLink simulation data. Nevertheless I can provide some simple commands to store data (similar to pressing the Load and Save buttons in the TargetLink Main Dialog).
Save a simulation
>> tlds('simulation no.2', 'save', 'bla')
Saves simulation "simulation no.2" in file "bla.mat". The simulation name is the same as shown in TargetLink Main Dialog on Simulation tab.
Load a simulation
>> tlds(0, 'load', 'bla.mat').
The simulation name is stored in the MAT file. If the same simulation name exists in the simulation list (TargetLink Main Dialog), a new one is generated by default.
Get simulation names
1) Assign simulation to a variable >> MyVar = tlds(0,'get','simulations') 2) Get the name of first simulation >> MyVar{1}.label
The MAT file can be loaded into the MATLAB workspace and consists of a single stucture. The component names are meaningful, therefore I guess that a user will find the relevant information very quick in this structure, e.g. logging data.
Please have in mind that the API is undocumented and may change over time without any notification. Use it at your own risk.

Plus de réponses (1)

Fangjun Jiang
Fangjun Jiang le 29 Juin 2011
TargetLink uses .mat format to save the data. But it does put all the data in a structure and add some annotations. So you can't use MATLAB save() function to save the data. From its documentation, all the API functions are listed but none seems to be able to do this. So I think there is no API available for end user for the TargetLink Main Dialog block. But do check with dSAPCE tech support to be sure.

Catégories

En savoir plus sur Prepare Model Inputs and Outputs dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by