Is there a way of getting the "LoggingName" and "Source Port" of all the Logging Selected Signals directly in Matlab?
7 views (last 30 days)
Show older comments
Hello all,
I have a Simulink model in which there are some Logging Selected Signals. I can manually check the "LoggingName" of all the Logging Selected Signals by opening the Simulink model and then going under Configuration Parameters > Data Import/Export > Signal logging > Configure Signals to Log... (see the image below).
Is there a way of getting the "LoggingName" and "Source Port" of all the Logging Selected Signals directly in Matlab without opening the Simulink Signal Logging Selector?
If I open the Simulink model and manually Log Selected Signal, the name of the signal is stored under "Source Port" but not under "LoggingName". Is there a way of storing the signal name under "LoggingName"?
It would be a great help to me if someone could give me a solution.
Thank you in advance.
0 Comments
Answers (1)
Fangjun Jiang
on 28 Apr 2021
After a simulation, your signal logging data is saved as, e.g. logsout
Run logsout.getElementNames and other API to get the info you need
You need to right click the signal line, select properties, and provide a signal name
2 Comments
Fangjun Jiang
on 29 Apr 2021
Then do something like this. Use set() to change name in a for-loop after checking names
hLine=find_system('YourModel','FindAll','On','type','line');
index=cell2mat(get(hLine,'DataLogging'))
get(hLine(index),'name')
See Also
Categories
Find more on Prepare Model Inputs and Outputs in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!