Adding baseline criteria to a test case. Signal did not align.
30 次查看(过去 30 天)
显示 更早的评论
I'm trying to add a baseline criteria from a mat file to a test case to compare the results of the test to the expected results. The tests fail with the status "Signal did not align. Comparison cannot be plotted". The file consists of a single Simulink.SimulationData.Dataset with several timeseries elements with the same name as the outports, which seems to work for the input values. I've tried adding the port number to the names i.e "Output:4" but that doesn't seem to make a difference.
Edit: To fix this I changed the model graphically by right clicking on the lines preceding the outports and selecting "Log selected signals" and then naming the signals. Removing the port number and logging the signals allowed mapping of the signals by name to the Simulink.SimulationData.Dataset object. I feed the dataset to testcases, and those test cases to the test manager and the tests are executed as expected.
0 个评论
采纳的回答
Rong Mi
2018-8-8
Could you please tell me which release of MATLAB are you using?
Usually when the signal names are different, we will get the message “Signal did not align. Comparison cannot be plotted”. ":4" can also make the signal misalignment. You can try to capture the signal using Capture baseline in Test Manager from your design model to see whether you need the ":4" or not or other numbers.
One more possible reason is that if the logged signal is un-logged in the design model, we will get this message.
更多回答(1 个)
Rong Mi
2018-8-9
Hi, The blocks that you use find_system with the block type 'Outport' to obtained are blocks, not ports.
"Outport(1)" in the following code is a "Port":
ph = get_param('vdp/Mu','PortHandles');
set_param(ph.Outport(1),'DataLogging','on');
They are referring different things.
So when you log signals, the signal associated with the Outport(a port) can be logged using set_param command. For example, the port (Outport) is associated with a block ('vdp/Mu' in the vdp model) sending out signal.
The block "Outport" is a block not a port, and it is the reason you see the error message.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Inputs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!