Simulink Dataset - Saving and Loading back into Simulink

Hello,
I have a bus in my model that contains many levels of nested buses. I want to log this signal and load this bus's signals in another Simulink model.
I have logged a signal in Simulink by right-clicking it > Signal Properties > Log signal data. This allows me to log the bus signal easily without extracting everything out of it. The ToWorkspace block did not work.
However, now I do not know how to load this new Simulink Dataset variable, named sigsOut by default, in my other Simulink model. It is nowhere near the format needed for the FromWorkspace block. Is there an easy way?
Horace

Respuestas (3)

Kaustubha Govind
Kaustubha Govind el 30 de Abr. de 2013
It seems like you should be able to import that data back into another model using the Root Inport blocks. Also see Import Structures of timeseries Objects for Buses (apparently the Dataset format actually uses MATLAB timeseries objects).
Horace Lai
Horace Lai el 2 de Mayo de 2013
I found an example in Simulink that addresses this
However, in order for this to work, the bus signal that is logged must be non-virtual, which means that I will have to create a bus object with the same structure.
My virtual bus is huge, is there a way to do this easily?

4 comentarios

I think you can use the Bus Creator block (see this blog post) with the "Output as nonvirtual bus" checkbox selected to automatically create a bus object for your virtual bus.
I don't think that creates it automatically. You still have to specify the bus object name and create that bus object before running the simulation.
At least it did not work on my computer :)
Oops, you're right. How about you follow the instructions under 'Making a bus object' on this blog post using Simulink.Bus.createObject? Does that help you generate a bus object?
That worked! Thanks. But now I have another issue. I will put it on another post

Iniciar sesión para comentar.

Horace Lai
Horace Lai el 6 de Mayo de 2013
I have been able to use the method with logging a bus signal and then loading it back in a model referenced model. However, in the model I am working with, the signal I want to log is a virtual bus, and the model that I want to load it back in is not a model referenced model.
So even though I am able to convert the bus into a non-virtual bus and log it, it would be too much work to redo the model that I want to load it so that it expects a non-virtual bus signal.
Does anyone have any ideas on getting around this? From what I understand of Simulink I do not see a way to convert a non-virtual bus into a virtual bus.

1 comentario

Horace: Please post this as a new question. Writing this a new "Answer" to your old question is not the recommended way on this forum. Thanks!

Iniciar sesión para comentar.

Categorías

Más información sobre Prepare Model Inputs and Outputs en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 30 de Abr. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by