Simulink Data Export standardization

Hello everyone,
here's my problem:
I have a couple of similar Simulink slx files for which I would like to standardize the data export. These slx files are engineering simulations (consisting of pipes, heat exchangers, ...) which represent different physical systems (process & instrumentation diagrams), but rely on the same libraries and (largely) the same (hierarchical) bus objects. Each of these systems must be investigated w.r.t. different topics (long-term analysis, controls analysis, ...), so for each slx file I have several completely different requirements w.r.t. data export (sample times, signal selection, data types). Therefore, for each slx file and each investigation task, I have to adapt the data export settings manually (in a rather continous manner), leading to an awful number of variations (3 slx files * 3 tasks = 9 variations).
As we are talking about dozens of signals, a manual adaption each time is really undesirable. Additionally, since these slx files are stored in an SVN repository, I am unwilling to continously change the file just to align my data export settings to the current task (however, I would accept that if necessary).
Here comes the key question:
Is there a way to define standardized "export filters" which are applicable to one purpose but several slx files? This filter should be selected at initialization / compile time. E.g., I would like to define a fixed data set "controls analysis" to be exported, containing signal names, data types, sample time etc. which should be applicable to all slx files.
Steps gone so far:
So far, I have a solution which should work for one file (one filter per investigation task): One way to realize this would be to export the data using a root-level outport assigned to a certain bus object. My definition of the export data set would then be a dedicated bus object containing all the information required.
Help needed / ideas:
In order to make the above solution work for several files, it must necessarily include a mapping of the bus objects of the various slx files to the export data set. The core of the problem is that the hierarchical bus objects are similar in structure, but contain a varying number of top-level objects, e.g. one bus would in one file include the elements [Pipe1, Pipe2, Pipe3], whereas in another it would comprise pipes 1 to 5 (as the pipes 4 and 5 do not exist in the first system).
Ideally, I would now define my bus objects as described above containing pipes 1 to 5 and there would be a function which maps all available pipes (3 in the first case) to the export bus, filling pipes 4 and 5 with NaN or similar. I imagine it could be possible to use a reference model "export_filter" generated at initialization by a special MATLAB function which parses the export bus object and builds the local export_filter to match the bus object. This function could also include additional intelligence and diagnostics, such as warnings if there is a pipe 6 and so on.
Another way which might work would be to build not only purpose-specific bus objects, but also export_filter models which match the definitions. These filters could then all be included e.g. in a variant model block and the use of the filter and the bus objects would be determined at initialization. However, this solution would probably only work with a minimum data set (pipes 1 to 3), as pipes 4 and 5 are not available in all systems so Simulink would throw an error.
Maybe there are other ways I haven't thought of yet.
Has anyone ever had a similar problem and ideally a "best-practice" advice on this? Any help would be greatly appreciated!
Kind regards,
sim_guy

Answers (0)

Categories

Find more on Signal Generation, Manipulation, and Analysis in Help Center and File Exchange

Products

Release

R2017b

Asked:

on 10 Jan 2020

Community Treasure Hunt

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

Start Hunting!