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

1 view (last 30 days)
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].

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
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.

More Answers (0)

Categories

Find more on Instrument Control Toolbox Supported Hardware in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2008a

Community Treasure Hunt

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

Start Hunting!