Why do I receive "PIL error: 3216915834" when using a PIL block in Embedded IDE Link VS 2.0 (R2008a)?

1 次查看(过去 30 天)
I get the following error when running the attached model in pil_error.zip:
Error evaluating registered method 'Outputs' of M-S-Function 'sfun_pil_Subsystem' in 'model1/Subsystem1'. Error using ==> ProductInfo.ProductInfo>ProductInfo.error at 17
PIL error: 3216915834 occurred. The following is the MATLAB call stack (file names and line numbers) that produced this error:
['C:\shure\framework\connector\s-builder\sfun_pil_Subsystem.m'] [154].

采纳的回答

MathWorks Support Team
The reason for this error when co-simulating this model is that there is an ambiguity in the hardware implementation of the "double" data type between the host ("double" is 64 bit) and the target (by default "double" is 32 bit on a SHARC). Ordinarily, in case of such a mismatch you would receive a clear error message indicating the data type mismatch.
In this case, however, there is a mistake in the Link for VisualDSP++ code which tells our PIL infrastructure that size of double on a SHARC is 64 bit, even though in reality it is 32 bit. So, instead of a clear meaningful error message you get a rather cryptic one.
To work around the issue, use any of the following:
1. The recommended option is to not use "doubles" when working with SHARC - change all "doubles" to "singles". Singles are 32 bit long on both the host and the target, so there is no confusion about their size across the PIL boundary. More importantly, processing "doubles" on 32-bit architecture of a SHARC incurs a speed overhead of 4x - meaning a computation involving "doubles" is usually 4 times slower than the same computation involving "singles". In the majority of cases "singles" provide sufficient precision/dynamic range.
2. If you need to use 64-bit long "doubles" on a SHARC, you can overwrite the 32-bit default by passing a compiler flag to VisualDSP++ which ensures that the project is compiled and linked with 64-bit long "doubles". To do that, follow these steps:
a. In the model window, select Simulation->Configuration Parameters
b. Under Real-Time Workshop, select Embedded IDE Link VS
c. In the Project Options section of the right pane append -double-size-64 to the Compiler Options String d. Press OK to close the Configuration Parameters window
e. Save the model
f. Rebuild PIL block
As examples, attached is one ZIP file with two models: model_single.mdl demonstrates the 1st approach, while model_double.mdl demonstrates the 2nd approach.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Instrument Control Toolbox Supported Hardware 的更多信息

标签

尚未输入任何标签。

产品


版本

R2008a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by