MATLAB Answers

Processor-in-the-loop Arduino simulation with double data type

14 views (last 30 days)
Kaloyan Yordanov
Kaloyan Yordanov on 22 Jun 2018
Commented: Jose GL on 30 Mar 2019
I want to perform processor in the loop simulations of a subsystem (controller) in my model on an Arduino Uno board. I successfully generate a PIL block, however I run into the following error message when I start the simulation:
Data type "double" is not supported for SIL or PIL execution with the current target configuration. This is because the host size (8 bytes) and target size (4 bytes) do not match. To avoid this error, do not use this data type at the component interface.
I've tried using the single precision conversion tool with no effect and also tried surrounding the subsystem with the respective conversion blocks.

  0 Comments

Sign in to comment.

Answers (2)

Gayatri Menon
Gayatri Menon on 26 Jun 2018
Hi,
Could you try adding data conversion block inside the subsystem and delete the folders that contain the generated code before trying again.
Thanks
Gayatri

  3 Comments

Yuan Qi
Yuan Qi on 26 Jun 2018
Hello Gayatri,
I have the same issue with TI C2000 system. I've tried the your method, but it still doesn't work. I've checked my PIL subsystem, there is no double type data and all input and output signals are single and int32. The default data type is also single. Could you please give me some advice regarding that?
Thanks in advance
Yuan
Gayatri Menon
Gayatri Menon on 27 Jun 2018
What about Arduino? Are you still facing the same issue? If so, could you please share the model
Yuan Qi
Yuan Qi on 27 Jun 2018
I solved it by changing the default parameter behavior to Inlined and the parameter structure to NonHierarchical.

Sign in to comment.


Piyush Kadkol
Piyush Kadkol on 13 Oct 2018
Hi Yuan, I tried changing the Default Parameter Behaviour to Inlined and Parameter Structure to NonHierarchical, but am still getting the error. Could you suggest anymore changes that are needed to be done to overcome this problem? Thanks!

  1 Comment

Jose GL
Jose GL on 30 Mar 2019
Hi!
I've the same problem with TI MCU.
The block that you will converter in PIL block has double data type, you need to changue all data type from double to single.
Regards

Sign in to comment.

Sign in to answer this question.