Hi all,
This is a useful thread, so let me revive it once more.
I also work on real-time simulator based on Simulink 6DoF model and MSFS's visualization. At present, I run both the simulation target and the MSFS on the same machine under Win2k. Since I am using generic real-time target, I am trying to achieve "soft" real time by synchronizing the simulation with the system clock.
Up to now, I used, with relative success, the "Flight Video" feature of MSFS for driving the aircraft position and other data. On my modest machine (PIV 2.4, 512Mb RAM, FX5200) I am able to keep up with real time at integration step of 5ms (or even less) and FS running at 25-40 fps. As you see, simulation step and FS frame updates are NOT synchronized. However, it is essential to send data to FS at as high rate as possible (as I try to increase the step I get the unexpected result of ruining the MSFS performance).
Up to now this was an introduction. It would be interesting to know if anybody has similar experience, but I came to this forum because of FSUIPC. So far, very few people use "Flight Video" that was described in the Netpipes SDK from MS. FSUIPC is far more popular and has some capabilities that "flight video" doesn't - like bilateral communication, more comprehansive set of parameters, and, as I hoped, better performance. The question is, whether it is suitable at all for real-time applications.
As I see in the FSUIPC SDK sources, what is FSUIPC_Process doing is sending message to FSUIPC and waiting 100 ms - and so up to 10 times. So, retrying sending the message introduces huge delays to simulation. It would be good to know several things: how often such retris may happen? How long takes SendMessage itself? What is the actual time that processing write request may take? How is synchronization with FS frame rate done? Finally, is there any sense in sending data to FSUIPC at a rate higher than FS frame rate? Since calls to FSUIPC directly from the simulation block the execution, I see the only solution in writing another module that will be able to receive data from simulation at some fixed rate without blocking the simulation and feeding data to FSUIPC as it is ready to receive it.
I'll appreciate any advice.
Alexei Rosich