Troubleshooting Issues in Models

NI VeriStand 2018 Help

Edition Date: May 2018

Part Number: 372846M-01

»View Product Info
Download Help (Windows Only)

If your model crashes or does not execute as you expect, try to isolate the issue and determine if its source is within the model or due to your system definition.

Isolating the Issue

To identify the source of an issue, replace your model in the system definition with a simple model, and then redeploy the system definition. If the simple model executes as expected, the source of the issue is likely within your model. However, if the simple model also experiences issues, the source of the issue might be due to settings for your system definition.

The following issues can result from settings in your system definition:

  • Model crashes. Details.
  • Model does not run at expected rate. Details.
  • Delayed transfer of data from model to mapped channels. Details.
  • Decreased performance. Details.

Problem: Models are Crashing

Models often crash when an inport receives a value of 0 and the model attempts to divide by the inport value. This issue might occur upon deployment if the initial state of the model is to run and the default value for an inport is 0. Depending on your system, the following solutions might address this issue:

  • Change the default value for the inport on the Model Configuration page in the System Explorer.
  • Rewrite the model to remove the possibility of dividing by 0.
  • Change the initial state of the model to be paused in the System Explorer, and then implement a start-up procedure that ensures that the inport values are acceptable before you start the model.

Related Links

Setting the Initial State of the Model

Adding Procedures

Problem: Model Runs Too Fast or Too Slow

If your model is unstable because it runs too fast or too slow, ensure the actual model rate matches the rate at which the model was compiled to run. If the rates do not match, adjust the settings that determine the actual model rate until the following expressions are correct:



actual model rate = compiled model rate

actual model rate = PCL rate / decimation

In the System Explorer window, configure the following settings where specified:

Related Links

Model Timing

Problem: Data Generated by Model is Delayed

If other parts of your system that are mapped to your model do not receive data when you expect, consider adjusting the following system definition settings:

  • PCL execution mode—If you require that data from models be available for mapping during the same PCL iteration the model generates the data, consider changing the Execution mode to Low Latency on the Controller Configuration page in the System Explorer window. The default mode, Parallel, applies a one-cycle delay between when a model executes and when the data it produces is available for mapping.
  • Execution order—Multiple models in a system execute in parallel unless you define an execution order. If you map an outport from one model to an inport of a second model and you want the second model to wait until the first model finishes executing before it runs, you must define the execution order on the Execution Order Configuration page in the System Explorer window.

Related Links

Understanding PCL Execution and Model Latency

Determining the Execution Order of Models

Problem: Decreased Performance

If you suspect that models are causing your system to run slower than you desire, consider the following solutions that might improve performance:

  • Import only parameters and signals your system requires. Importing many parameters and signals can have a negative impact on the performance of the model even if the model is not running.
  • If you do not need data from models to be available to the rest of the system on the same iteration of the PCL, ensure the PCL execution mode is Parallel instead of Low Latency. Parallel mode causes a one-cycle delay between when a model executes and when the data it produces is available to the system, but increases the execution speed of the entire system.

Understanding PCL Execution and Model Latency

WAS THIS ARTICLE HELPFUL?

Not Helpful