{"id":17438,"date":"2025-03-10T14:53:58","date_gmt":"2025-03-10T18:53:58","guid":{"rendered":"https:\/\/blogs.mathworks.com\/simulink\/?p=17438"},"modified":"2025-05-15T18:59:55","modified_gmt":"2025-05-15T22:59:55","slug":"using-test-points-to-log-signals-for-software-in-the-loop-simulation","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2025\/03\/10\/using-test-points-to-log-signals-for-software-in-the-loop-simulation\/","title":{"rendered":"Using Test Points to log Signals for Software-In-The-Loop Simulation"},"content":{"rendered":"<div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = \"https:\/\/matlab.mathworks.com\/open\/github\/v1?repo=simulink\/blog&amp;project=2025_04_03_SIL_TestPoint\/SIL_TestPoints.prj\"><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/SIL_TestPoints.mlx-03-11-25_1.png\" width = \"136\" height = \"21\" alt = \"\" style = \"vertical-align: baseline; width: 136px; height: 21px;\"><\/img><\/a><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>This week's post is a suggestion from <\/span><a href = \"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/2887885\"><span>Raymond Estrada<\/span><\/a><span> from <\/span><a href = \"https:\/\/www.mathworks.com\/services\/consulting.html\"><span>MATLAB and Simulink Consulting Services<\/span><\/a><span>. Raymond reached out recently to share a tip for verifying and validating logged signals in the code generated from Simulink.<\/span><\/div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>The Problem<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>It's a common practice in the verification and validation world to run simulations and look at the value of outputs and (sometimes) intermediate signals, and compare those to expected values.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>When generating code using <\/span><a href = \"https:\/\/www.mathworks.com\/products\/simulink-coder.html\"><span>Simulink Coder<\/span><\/a><span> and <\/span><a href = \"https:\/\/www.mathworks.com\/products\/embedded-coder.html\"><span>Embedded Coder<\/span><\/a><span>, you want to verify that those values are the same (within tolerance) as what you got in simulation. That\u2019s what we call \u201c<\/span><a href = \"https:\/\/www.mathworks.com\/help\/releases\/R2024b\/sltest\/ug\/test-two-simulations-for-equivalence.html\"><span>equivalence testing<\/span><\/a><span>\u201d or \u201c<\/span><a href = \"https:\/\/www.mathworks.com\/help\/sltest\/ug\/create-and-run-a-back-to-back-test.html\"><span>back-to-back testing<\/span><\/a><span>\u201d, where you compare the results from normal mode simulation to results from <\/span><a href = \"https:\/\/www.mathworks.com\/help\/releases\/R2024b\/ecoder\/software-in-the-loop-sil-simulation.html\"><span>Software-in-the-Loop Simulation<\/span><\/a><span> (SIL) and <\/span><a href = \"https:\/\/www.mathworks.com\/help\/ecoder\/processor-in-the-loop.html\"><span>Processor-in-the-Loop Simulation<\/span><\/a><span> (PIL). <\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Now here is where you can run into a problem: Some of those values you need to observe don\u2019t exist in the generated code. Intermediate signals may not be available in generated code due various optimizations like <\/span><a href = \"https:\/\/www.mathworks.com\/help\/rtw\/ref\/signalstoragereuse.html\"><span>Signal storage reuse<\/span><\/a><span> and <\/span><a href = \"https:\/\/www.mathworks.com\/help\/rtw\/ref\/eliminatesuperfluouslocalvariablesexpressionfolding.html\"><span>Eliminate superfluous local variables (Expression folding)<\/span><\/a><span>. Expression folding is an optimization that collapses block computations into single expressions in generated code.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>To illustrate this, let's use a very simple model where I add two signals and multiply the result by 2. I want to verify the results for the logged signal \"x\".<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/SIL_TestPoints.mlx-03-11-25_2.png\" width = \"362\" height = \"200\" alt = \"\" style = \"vertical-align: baseline; width: 362px; height: 200px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Using the <\/span><a href = \"https:\/\/www.mathworks.com\/help\/sltest\/ref\/simulinktestmanager.html\"><span>Simulink Test Manager<\/span><\/a><span> we can create an <\/span><a href = \"https:\/\/www.mathworks.com\/help\/releases\/R2024b\/sltest\/ug\/test-two-simulations-for-equivalence.html\"><span>Equivalence Test<\/span><\/a><span>. This test simulates the model in normal mode and <\/span><a href = \"https:\/\/www.mathworks.com\/help\/ecoder\/software-in-the-loop-sil-simulation.html\"><span>Software-in-the-Loop Simulation<\/span><\/a><span>, and compare the results.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/SIL_TestPoints.mlx-03-11-25_3.png\" width = \"445\" height = \"597\" alt = \"\" style = \"vertical-align: baseline; width: 445px; height: 597px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>We run the test and see that if failed. When expanding the test results, we can see that the logged signal <\/span><span style=' font-family: monospace;'>x<\/span><span> is not present in the SIL results.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/SIL_TestPoints.mlx-03-11-25_4.png\" width = \"829\" height = \"384\" alt = \"\" style = \"vertical-align: baseline; width: 829px; height: 384px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>When hovering over the equivalence criteria result, we see this note:<\/span><\/div><div class = 'preformatted-plain' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 12px; '><span style=\"white-space: pre\"><span >One or more signals did not match within tolerance specified<\/span><\/span><\/div><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Let's see how to debug and fix this.<\/span><\/div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>The Explanation<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In the Test Manager, if you look carefully at the <\/span><span style=' font-weight: bold;'>logs<\/span><span> sections of the test results, you will find more explanations:<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/SIL_TestPoints.mlx-03-11-25_5.png\" width = \"1184\" height = \"643\" alt = \"\" style = \"vertical-align: baseline; width: 1184px; height: 643px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Let's also run the test programmatically to make the log easier to search and copy. For that, I like to use the function <\/span><a href = \"https:\/\/www.mathworks.com\/help\/releases\/R2024b\/matlab\/ref\/matlab.unittest.testsuite.fromproject.html\"><span>matlab.unittest.TestSuite.fromProject<\/span><\/a><span>. This function conveniently finds all the tests in a project and creates a test suite.<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 15px 10px 0; display: inline-block\"><div class=\"inlineWrapper\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >suite = matlab.unittest.TestSuite.fromProject(currentProject);<\/span><\/span><\/div><\/div><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >results = run(suite);<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsTextElement scrollableOutput\" uid=\"EEF39330\" prevent-scroll=\"true\" data-testid=\"output_0\" tabindex=\"-1\" style=\"width: 1146px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"textElement eoOutputContent scrollArea\" tabindex=\"-1\" data-previous-available-width=\"1109\" data-previous-scroll-height=\"637\" data-hashorizontaloverflow=\"true\" role=\"article\" aria-roledescription=\"Use Browse Mode to explore \" aria-description=\"text output \" style=\"max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">Setting up ProjectFixture\r\nDone setting up ProjectFixture: Project 'SIL_TestPoints' is already loaded. Setup is not required.\r\n__________\r\n\r\nRunning SILTest &gt; SIL Equivalence\r\n\r\n================================================================================\r\n<strong style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">Verification failed in SILTest &gt; SIL Equivalence\/Basic SIL Equivalence.<\/strong>\r\n    ---------------------\r\n    Framework Diagnostic:\r\n    ---------------------\r\n    Failed criteria: Equivalence\r\n    --&gt; Logs:\r\n            Simulation 2:\r\n                Model, SumAndGain, simulating in SIL or PIL mode, contains these signals, which are configured for signal logging, but are not supported and are not logged during SIL or PIL simulation:\r\n                \r\n                SumAndGain\/Add, 'Output Port 1': Signal not found in code description, or signal is virtual, inactive, or has a variable size.\r\n                \r\n                For list of signals that are nonvariable size and produce message \"Signal not found in code description, or signal is virtual, inactive, or has a variable size.\", this warning might be avoidable:\r\n                   1. For each signal, select Signal Properties &gt; Test point.\r\n                   2. Clear model configuration parameter 'Ignore test point signals'.\r\n                   3. For virtual subsystem output signals, make subsystem atomic (nonvirtual).  Select subsystem block parameter 'Treat as atomic unit'.\r\n                   4. If generated code is C++ and model configuration parameter 'CodeInterfacePackaging' is set to 'C++ class', to allow access to internal data, set parameter 'InternalMemberVisibility' to 'public' or in Code Mappings editor, in Data Visibility column, for 'Signals, states, and internal data', select 'public'.\r\n                   5. If you are testing an atomic subsystem in a Simulink Test harness, make changes in original model that contains subsystem.\r\n                \r\n                Alternatively, for listed signals, disable signal logging.\r\n                \r\n    --&gt; Simulink Test Manager Results:\r\n            Results: 2025-Mar-02 12:57:59\/SILTest\/SIL Equivalence\/Basic SIL Equivalence\r\n================================================================================\r\n.\r\nDone SILTest &gt; SIL Equivalence\r\n__________\r\n\r\nTearing down ProjectFixture\r\nDone tearing down ProjectFixture: Teardown is not required.\r\n__________\r\n\r\nFailure Summary:\r\n\r\n     Name                                             Failed  Incomplete  Reason(s)\r\n    ==============================================================================================\r\n     SILTest &gt; SIL Equivalence\/Basic SIL Equivalence    X                 Failed by verification.<\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>What this log tells us is that the generated code does not contain a variable corresponding to the logged signal <\/span><span style=' font-family: monospace;'>x<\/span><span>.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>When looking at the generated model step function, we can confirm that expression folding has been applied, combining the Sum and Gain blocks in a single expression:<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/SIL_TestPoints.mlx-03-11-25_6.png\" width = \"302\" height = \"226\" alt = \"\" style = \"vertical-align: baseline; width: 302px; height: 226px;\"><\/img><\/div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>The Solution<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Let's apply the first suggestion in the above log:<\/span><\/div><div class = 'preformatted-plain' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 12px; '><span style=\"white-space: pre\"><span >1. For each signal, select Signal Properties &gt; Test point.<\/span><\/span><\/div><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>If you are not familiar with test points, I recommend this documentation: <\/span><a href = \"https:\/\/www.mathworks.com\/help\/simulink\/ug\/working-with-test-points.html\"><span>Configure Signals as Test Points<\/span><\/a><span>.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In this case, a simple way to add the test point is using the Property Inspector:<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/SIL_TestPoints.mlx-03-11-25_7.png\" width = \"642\" height = \"277\" alt = \"\" style = \"vertical-align: baseline; width: 642px; height: 277px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>With this change, we can run the test suite again to confirm that the test point fixes the issue and enables the test to pass.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/SIL_TestPoints.mlx-03-11-25_8.png\" width = \"589\" height = \"271\" alt = \"\" style = \"vertical-align: baseline; width: 589px; height: 271px;\"><\/img><\/div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Conclusion &amp; Considerations<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Adding a Test Point is one solution that allows for verification of requirements using signals that would otherwise be optimized via expression folding. However, note that the addition of a test point did change the generated code. In this case, the model step function becomes:<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/SIL_TestPoints.mlx-03-11-25_9.png\" width = \"297\" height = \"275\" alt = \"\" style = \"vertical-align: baseline; width: 297px; height: 275px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Since adding test points changes the code and can block optimizations, you only want to use this where it is truly necessary. Also, since they impact the generated code, test points should persist throughout the design and should not be toggled between the different stages of development (development, testing &amp; verification, code generation).<\/span><\/div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Now it's your turn<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Are you verifying and validating signals internal to your algorithms? Let us know in the comments below if you have tips and tricks for that.<\/span><\/div>\r\n<br>\r\n<\/div><script type=\"text\/javascript\">\r\n{ let css = '.eoOutputWrapper { width: calc(90vw - 10px) !important; } \/* Styling that is common to warnings and errors is in diagnosticOutput.css *\/.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsErrorElement .diagnosticMessage-errorType {    overflow: auto;} .embeddedOutputsErrorElement.activeOutput .eoOutputContent {    user-select: text;    -webkit-user-select: text;} .embeddedOutputsErrorElement.activeOutput .eoOutputContent button {    user-select: none;    -webkit-user-select: none;} .embeddedOutputsErrorElement .eoOutputContent ::selection {} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} \/* Styling that is common to warnings and errors is in diagnosticOutput.css *\/.embeddedOutputsWarningElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsWarningElement .diagnosticMessage-warningType {    overflow: auto;} .embeddedOutputsWarningElement.activeOutput .eoOutputContent {    user-select: text;    -webkit-user-select: text;} .embeddedOutputsWarningElement .eoOutputContent ::selection {} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} \/* Copyright 2015-2023 The MathWorks, Inc. *\/\/* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip *\/.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace;    font-size: 12px;} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    \/*This fallback value will be used for appdesigner warnings*\/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    \/*This fallback value will be used for appdesigner warnings*\/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: var(--mw-color-matlabWarning) !important;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    \/*This fallback value will be used in appdesigner error tooltip text*\/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    \/*This fallback value will be used in appdesigner error tooltip text*\/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: var(--mw-color-matlabErrors) !important;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} .embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 550px;} .embeddedOutputsTextElement .textElement,.embeddedOutputsVariableStringElement .textElement {    overflow: auto;} .embeddedOutputsTextElement.activeOutput .eoOutputContent,.embeddedOutputsVariableStringElement.activeOutput .eoOutputContent {    user-select: text;    -webkit-user-select: text;} \/*embeddedOutputsTextElement has a different dom structure than embeddedOutputsVariableStringElement.Unlike variableString, the text output has both TEXT nodes and elements as children. Hence we needa selector for each.*\/.embeddedOutputsTextElement .eoOutputContent::selection,.embeddedOutputsTextElement .eoOutputContent ::selection,.embeddedOutputsVariableStringElement .eoOutputContent ::selection {} .textElement,.rtcDataTipElement .textElement {    padding-top: 2px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;}';\r\nlet head = document.head || document.getElementsByTagName('head')[0];\r\nlet style = document.createElement('style');\r\nhead.appendChild(style);\r\nstyle.type = 'text\/css';\r\nif (style.styleSheet) {\r\n    style.styleSheet.cssText = css;\r\n} else {\r\n    style.appendChild(document.createTextNode(css));\r\n}\r\n\r\n\r\n}<\/script>","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/SIL_TestPoints.mlx-03-11-25_7.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><p>This week's post is a suggestion from Raymond Estrada from MATLAB and Simulink Consulting Services. Raymond reached out recently to share a tip for verifying and validating logged signals in the code... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2025\/03\/10\/using-test-points-to-log-signals-for-software-in-the-loop-simulation\/\">read more >><\/a><\/p>","protected":false},"author":41,"featured_media":17522,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[21,63],"tags":[425,692],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/17438"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/comments?post=17438"}],"version-history":[{"count":6,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/17438\/revisions"}],"predecessor-version":[{"id":17648,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/17438\/revisions\/17648"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media\/17522"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=17438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=17438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=17438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}