필터 지우기
필터 지우기

Adding baseline criteria to a test case. Signal did not align.

조회 수: 41 (최근 30일)
Christian Hurtig
Christian Hurtig 2018년 8월 3일
편집: Christian Hurtig 2018년 8월 10일
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.

채택된 답변

Rong Mi
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
Christian Hurtig
Christian Hurtig 2018년 8월 9일
편집: Christian Hurtig 2018년 8월 9일
I'm using 2018a.
There is no additional information in the error message. If the output signals are not logged by default then maybe that is the problem. I've tried following the instructions found in the Programmatic Interface section here but I get an error saying "Cannot set parameter 'DataLogging' for the specified port. The specified port must be an output port", which is strange because I find the ports using find_system with the block type 'Outport'

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Rong Mi
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.

카테고리

Help CenterFile Exchange에서 Outputs에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by