Why am I unable to access the values of the outport in my model under SystemTest 2.2 (R2008a)?

1 次查看(过去 30 天)
I am using SystemTest on a simple Simulink model. When I try to reference the outport signal with variable name ST_OUTPORT(say) within the MATLAB element, I receive the following error:
'Attempt to reference field of non-structure array'.

采纳的回答

MathWorks Support Team
The above error happens when, under the 'Main Test' element of SystemTest, the MATLAB element is defined before Simulink element.
This error occurs because when the Main Test element is run by SystemTest, it runs the MATLAB element before the Simulink element. When the MATLAB element is run ahead of the Simulink element, the referenced signal (ST_OUTPORT) is a double Test Variable which has not yet been assigned to the Simulink outport.
If the Simulink element is moved above the MATLAB element under the Main Test section of the Test Browser interface, this error disappears.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Test Model Components 的更多信息

产品


版本

R2008a

Community Treasure Hunt

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

Start Hunting!

Translated by