Support : Knowledge base

Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Loading…

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-01538// Views: AA-01538// Created: 2018-10-10 22:04:44// Last Updated: 2018-10-10 22:04:54
Problem & Solution
RT-LAB error at code separation during the build process: Error using RaiseNagsError


Problem

When trying to build the model in RT-LAB you get and error "RaiseNagsError"

-------------------- Generating federation_ieee_39no_1_sm_computation C code --------------------
??? Error using opvalidatemodel>RaiseNagsError (line 618)
Invalid RT-LAB block diagram.
Error in opvalidatemodel (line 92)
Error in opVerifySendReceiveRTPriority (line 117)
Error in opMakeRTW (line 139)
??? Error generating C code for federation_ieee_39no_1_sm_computation subsystem.

Solution

There are few possible solutions,

Solution 1:

This error happens when SC_ SM and SS_ are uncapitalized in the subsystem names of the model. To solve the issue, you only need to make sure all subsystem identifier are in capitals.

Solution 2:

This is a generic error, but when you use SimpowerSystems / Simscape blocks this error can happen when you don't put the powergui block on the top level of the model.

To confirm this diagnostic you can enter the command : opInitFunction('separate') and you should have the following message: Error : From Matlab R2009b, the powergui block is no longer automatically added to your model upon simulation. You need to explicitly add it to your model and should be located at the top-level of your diagram for optimal performance. The powergui block should always be in the top level of your model otherwise you will receive this error during the build.

Solution 3:

It might be related to a missing state in the subsystem. It can be solved by adding a delay in the path before the output of the subsystem. In this example, we can observe that the path input to output (shown in read) does not meet a state block before exiting the subsystem.

Now, since we needed a state, we can actually use a delay that is already in the model as shown in the image below.

By moving the delay to the first subsystem, the resulting model should compile without error.