- Make sure that the S-function has been properly compiled and loaded into MATLAB. You can try recompiling the S-function and rebuilding the code.
- Make sure that the RollRegions variable is being properly referenced in the TLC file. Double-check the syntax of your %roll directive to make sure that you are using the correct variable name and that it is being referenced in the correct scope.
- Try adding a check for the existence of RollRegions in the TLC file before using it. You can use the MATLAB function "isfield" to check if the variable exists in the Block record.
- If none of the above suggestions work, you can try using the "get_param" function to directly retrieve the RollRegions property from the block.
RollRegions not defined for calls to %roll: The roll argument to %roll must be a nonempty vector of numbers or ranges
조회 수: 6 (최근 30일)
이전 댓글 표시
What would cause RollRegions NOT to be defined, so that I can't use it in the TLC file?
I have an S function with a tlc file.
In the past I have successfully used the %roll directive such as:
%roll sigIdx = RollRegions, lcv = RollThreshold, block, "Roller", rollVars
However, with a particular S function I receive the following error when I try to build the code:
The roll argument to %roll must be a nonempty vector of numbers or ranges
It appears that RollRegions just isn't defined, although, according to documentation:
For blocks, the variable RollRegions is automatically computed and placed in the Block record.
I can see, in the .rtw file, that Simulink knows the RollRegions for the relevant port of the relevant block instance, as it appears within the Block {...} constuct for the relevant S function instance, as:
DataInputPort {
...
RollRegions [0, 1, 2:4]
}
which is correct for the relevant input port of the single instance of the S function in my test model.
There are 2 single signals at different memory addresses feeding the input port elements [0] and [1],
and then an array of 3 signals at contiguous memory addresses feeding elements [2:4].
So RollRegions appears to be correctly defined within the Block {} construct, but when I try to use RollRegions in the tlc file, it seems to be undefined???
댓글 수: 0
답변 (2개)
Kartik
2023년 4월 17일
Hi,
It is possible that the RollRegions variable is not being properly propagated to the TLC file. Here are a few things you can try:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Target Language Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!