VeriStand HP Loop Count Increasing when Deployed to Windows Target

Updated May 28, 2021

Issue Details

I am deploying a VeriStand project to a Windows or other non-real time target, and am monitoring the HP Count System Channel, which shows the number of times the PCL reported being late. I noticed that the HP Count for my project is increasing - what can I do to address this?

Solution

In order to address this issue, we need to determine what portion of your system is causing the HP loop to increment, and if this behavior is expected.
  1. Disable any simulation models or hardware I/O in your project and see if the HP count incrementation stops or slows. If the problem does improve, try to isolate the project components which are causing the greatest impact on loop performance and optimize/remove them. Also, consider lowering your PCL rate, as this will give your project's elements more time to successfully execute.
  2. Disable background processes like Windows Update or high-load programs like Google Chrome that aren't necessary for your code's execution to free up system resources.
  3. Check Task Manager during the execution of your VeriStand project to monitor the system CPU and memory usage - if the CPU or memory usage is high, determine the programs which are causing this load and determine if they can be closed or disabled during your code's execution.
  4. Try to simplify the UI for your VeriStand project by reducing controls, indicators, and other elements if you're deploying your project to your local machine. Unlike with RT target VeriStand applications, the UI for your code and the code itself is executing on the same machine, so more complex UIs will slow down your code's execution. Non-real time OSs like Windows tend to prioritize UI elements over background processes in their scheduler, so priority is likely being given to UI elements in VeriStand and the OS when not in the scheduled time for VeriStand.
If the behavior is still appearing after attempting these steps, it is important to note that this behavior is, to a certain extent, expected on non-real time targets. If this behavior is not negatively impacting your project's performance, it is likely just a consequence of not deploying to a real-time target. Monitoring the HP count is still a good idea, but increases shouldn't be a cause for worry unless code execution becomes impacted.

Additional Information

On a non-real time OS, you don't have control over the OS scheduler like you do on a real-time target. The priority that you dictate in your VeriStand project will only affect the system during the allotted scheduler slot for your project's execution. As such, your high-priority loop will only have execution priority during that scheduler slot. Note that this is only true on a non-real time OS like Windows.