I created a Simulink Model and I would like to use the Test Manager in Simulink Test to run numerous test cases on a Speedgoat (realtime test). For some test cases I would like to use Scripted Iterations in Test Manager in order to change the speed. The speed is defined in a constant block. The problem: I try to set the contents of that constant block in scripted iterations using setVariable('Name', 'Value', 'Source', 'MainTestModel/SpeedBlock','Value', k) While executing the testcase "Real time normal shift chain" , I get an error : Invalid parameter 'MainTestModel/SpeedBlock/Value'. What am I doing wrong? How can I change the value of the constant block in iterations? Is it also possible to use a struct in the constant block and still update using "setVariable" ?
Prashant Kumar answered .
2025-11-20
The For Iterator block, when placed in a Subsystem block, repeats the execution of a subsystem during the current time step until an iteration variable exceeds the specified iteration limit. You can use this block to implement the block diagram equivalent of a for loop in a programming language.
The output of a For Iterator Subsystem block cannot be a function-call signal. Simulink® displays an error message when the model update