why do i see "Error while generating code for chart Test Sequence" error when running my test harness?

3 次查看(过去 30 天)
Im working on Simulink Test harness an i get this error while running the simulation

回答(1 个)

Atharva
Atharva 2023-4-26
Hey Scarletth,
The error message you are seeing in Simulink suggests that the variable Steerable_Axle_Left_Calibration_Value is being read before it has been assigned a value. This can happen when there is a mismatch between the order in which signals are updated in your model and the order in which they are being used.
To resolve this error, you can try the following steps:
  1. Check the data flow in your model and ensure that signals are being updated in the correct order.
  2. Verify that the variable Steerable_Axle_Left_Calibration_Value has been initialized before it is used. You can do this by adding an initial value to the variable or by initializing it in a block that runs before it is read.
  3. Ensure that the signal is not being read in a loop that runs before it is written.
  4. Check for any blocks in your model that may be causing the issue. Specifically, look for blocks that use the Steerable_Axle_Left_Calibration_Value signal and make sure they are not executing before it is written.
  5. If none of the above steps resolve the issue, try simplifying your model by removing unnecessary blocks or simplifying the data flow.
Once you have made the necessary changes, re-run the simulation and verify that the error no longer occurs.

类别

Help CenterFile Exchange 中查找有关 Inputs 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by