Signal Data Logging with SLRT and referenced Models

1 view (last 30 days)
I'm having problems logging signals when running a model on SLRT and the model contains referenced Models and referenced Models in triggered Subsystems.
I have a model with 4 displays, each display just shows a number being incremented:
  • 1. Display: blocks on top layer
  • 2. Display: blocks in referenced subsystem (which is on top layer)
  • 3. Display: blocks in a triggered subsystem (increases every 10th step)
  • 4. Display: blocks in a referenced subsystem in a triggered subsystem (increases every 10th step)
If I run the model just like that, everything works fine (the model runs on Speedgoat Performance Machines).
The result of the simulation is shown in the following picture.
Problem 1
The simulation runs with 500 Hz for 5 seconds, so the displays should show the value of 2502 at the end of a run (251 for the displays connected to the triggered subsystems). But when running on SLRT, it shows a lower value at the end of the run. It looks like it does not update with the end value. See the following picture.
Model: see Scenario 1 in attachment.
Problem 2
If I activate the logging of a signal in the referenced system (2nd display), all of a sudden, that system runs 100 times slower, the display shows a value that increases every 100th time. See the following picture.
Model: see Scenario 2 in attachment.
Problem 3
If I activate the logging of a signal in the referenced system in the triggered subsystem, the compiler shows an error:
The Model block 'testmainmodel/Triggered Subsystem/Model' referencing model 'testrefmodel' has been improperly placed in the triggered subsystem 'testmainmodel/Triggered Subsystem'. The model being referenced must inherit a sample time. Set the 'Periodic sample time constraint' parameter to 'Ensure sample time independent' on the Solver page of the Configuration Parameters for the model 'testrefmodel' and update the diagram to see why it does not inherit a sample time.
So it asks me to change the setting "Periodic sample time constraint", but that setting is disabled because the system target file is "slrealtime.tlc".
Model: see Scenario 3 in attachment.
Can someone help me with those issues? Problem 1 is not that bad, cause our system normally runs indefinitely. But problem 2 is concerning, and problem 3 is a really big issue for us.

Answers (0)

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!