From: Benjamin Wang on
hi, guys,

I found that PIL co-simulation runs so slow that it seems impossible to get finish.

I thought it was my model's problem, maybe I did it wrong. Then I went to the training demo video made by Mathworks about PIL co-simulation, it turns out that the execution of PIL is slow too in that video. For like 10 seconds in real world, the model only covers 4e-5 seconds (you can see this from the time axis of the scope).

The link of that demo video:
http://www.mathworks.com/products/demos/simulink/fixedpoint/index3.html?product=EC

My question is, does this PIL always runs so slow? If so, how can it be useful? If not, how to do it?

Thanks.

by Ben Wang
From: Frank W. on
> My question is, does this PIL always runs so slow?
No. The simpler the model and less data to exchange between PC and target the faster PIL runs.
> If so, how can it be useful?
Instead of PIL you might also occupy the only hardware prototype in your company (if there is already one) only to find out that your algorithm does not work. Or even that you'd need a different processor/controller.

When simulating a PIL model at each time step of the simulink solver data needs to be exchanged between the simulink running on the pc and the target. Simulink then receives the data computed by the actual hardware and progresses to compute the next time step. This is slower that having a model that only runs on one machine. And that is only one thing among others.

PIL allows to get bit-accurate results in even early design stages when the latter real hardware is not yet available. It allows software teams to proceed with their work if there is limited access to hardware. Standard evaluation kits allow testing of your algorithms. So it's easy to find potential software design faults or quickly evalute different algorithms...
From: Benjamin Wang on
"Frank W." <yohansan.nospam(a)web.de> wrote in message <i09pnn$77$1(a)fred.mathworks.com>...
> > My question is, does this PIL always runs so slow?
> No. The simpler the model and less data to exchange between PC and target the faster PIL runs.
> > If so, how can it be useful?
> Instead of PIL you might also occupy the only hardware prototype in your company (if there is already one) only to find out that your algorithm does not work. Or even that you'd need a different processor/controller.
>
> When simulating a PIL model at each time step of the simulink solver data needs to be exchanged between the simulink running on the pc and the target. Simulink then receives the data computed by the actual hardware and progresses to compute the next time step. This is slower that having a model that only runs on one machine. And that is only one thing among others.
>
> PIL allows to get bit-accurate results in even early design stages when the latter real hardware is not yet available. It allows software teams to proceed with their work if there is limited access to hardware. Standard evaluation kits allow testing of your algorithms. So it's easy to find potential software design faults or quickly evalute different algorithms...

Maybe I should reduce the total number of steps of my model.

Thank you for your response.