Hello Aqeel,
1MHz (or 1e-6 second of sample time) is pretty fast for the F28069. The fact that you are observing 2 seconds in standalone mode to run 1 second of realtime means that your standalone code is overunning. Our overrunning strategy skips the next hit of the scheduler so in this case you always see sample times being multiplied by integers.
For PIL, you have Simulink and Windows in the loop of every step of calculation. Increasing the baudrate will definitely help but won't be a magic solution as for every step of of the scheduler (1µs) Simulink issues a serial send to the Windows COM port, waits for one step to be processed on the F28069 and waits to receive a message back from the F28069 on the COM port.
Here is how to increase the baudrate:
Go to the Configuration Parameters of the model, under Hardware Implementation > Hardware board settings > Target Hardware Resources > SCI_A > Desried baudrate in bits/sec
You can use the max achievable baudrate which is 5.625e6, this will speed up PIL.
Now if your goal is to observe results while the code is running in realtime on the target, PIL may not be the best option.
In this example:
We are using a 2-model approach where the target model runs fast on the embedded processor and keeps sending data to the host. There is a companion model running on the host that streams the data so you can visual it in realtime
The example shows a DC/DC buck converter running at 200kHz, the host model can visualize every point at that rate using this 2-model approach.
I would also suggest to upgrade your board to F28379D which runs at 200MHz, this would help running your control loop at 1MHz.
This example also shows how ot offload the main processor to run code on the CLA, something that you can also do on the F28069.
I hope this helps, let us know othewrise.
Thanks,
Antonin.