Why do I get an "Incorrect data type" error or "Parameter precision loss" warning when I try to tune a parameter with SLRT & Speedgoat?
I am trying to change a Gain parameter during my Simulink Real-Time (SLRT) simulation, but I get the following error when I use "setparam":
>> tg = slrealtime;
>> tg.setparam('MyModel/Gain','Gain',-2)
Error using slrealtime.Target/throwErrorWithCause
Unable to set 'Gain' parameter value on target computer 'TargetPC1': Incorrect data type.
Error in slrealtime.Target/setparam (line 99)
this.throwErrorWithCause('slrealtime:target:setparamError', ...
Caused by:
Error using slrealtime.internal.ParameterTuning/setParamWork
Incorrect data type.
When I try changing the parameter in the block mask while using the external mode ("Run on Target"), I see warnings such as the following in the MATLAB prompt:
Warning: Parameter precision loss occurred for 'Gain' of 'MyModel/Gain'. The
original value of the parameter, 1, cannot be represented exactly using the run-time data type
sfix32_En31. The value is quantized to 0.9999999995343387. Quantization error occurred with an absolute
difference of 4.656612873077393e-10 and a relative difference of 4.65661287307739e-08%.
Suggested Actions:
• To disable this warning or error for all parameters in the model, set the 'Detect precision loss'
option to 'none'. - Apply
• Inspect details in the Parameter Quantization Advisor. - Open
• - Suppress
> In slrealtime/Instrument/dataAvailableFromObserverViaTarget (line 1413)
In slrealtime.Target/dataAvailableFromObserver (line 66)
In slrealtime.Instrument>@(varargin)tg.dataAvailableFromObserver(varargin{:}) (line 1332)
In slrealtime.internal.instrument.StreamingCallBack.NewData (line 25)
采纳的回答
0 个评论
更多回答(0 个)
另请参阅
类别
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!