FwFreak Posted April 30, 2019 Report Posted April 30, 2019 (edited) Hi Paul! First thanks for your great FSUIPCClient dll. Yesterday I updated the NuGet package from 3.1.5 to 3.1.11. Since this update setting the Offset 0C1A for changing the Simulation Rate causes P3D to incease the RAM usage up to 100% till the PC runs out of memory. The actual FSUIPC offset table says for Offset 0C1A "[Write] ]Not working, Sim Event seems broken" but with version 3.1.5 I can change the Simulation Rate without trouble (same FSUIPC version 5.15). Have you changed something related between the dll versions or do you have any ideas how I can fix the issues? Best regards Karsten Edited April 30, 2019 by FwFreak
Paul Henty Posted April 30, 2019 Report Posted April 30, 2019 Hi Karsten, The major difference between those two versions is that 'write-only' offsets now write on every process. In 3.1.5 they only wrote when the value changed. This caused a few problems so I had to change the way write-only offsets worked. Do you have 0C1A declared as write-only? If so, you have two options: 1. Put this offset in its own group so you can process() that offset only when you need to change the sim rate. or 2. Change this offset to a normal read/write offset. There's no harm in reading the sim rate back when you're not changing it. Option 2 is the easiest fix. Paul
FwFreak Posted April 30, 2019 Author Report Posted April 30, 2019 Yes, it is a write-only offset and already did it like your option 1. This is my code which works for other offsets except the simrare (local time, pause sim, send text message). Offset<short> simrate = new Offset<short>("simrate", 0x0C1A, true); (...) List<string> types = new List<string>(); (...) public void setSimrate(int val) { form1.write_log("Simulator", "Set -> Simrate: " + val); simrate.Value = (short)(val * 256); types.Add("simrate"); } public bool Send() { if(form1.monitor.status.connected) { foreach(string type in types) { try { form1.write_log("Simulator", "Start Send -> " + type); FSUIPCConnection.Process(0, type); } catch (FSUIPCException ex) { form1.write_log("Simulator", "Senden Fehler: " + ex.ToString()); } } } (The part with the 'List' is not the best way I think but I'm not sure how to write more than one group in one process.)
Paul Henty Posted April 30, 2019 Report Posted April 30, 2019 types.Add("simrate"); Does 'types' ever get cleared, or does 'simrate' ever get taken out of types? Paul
FwFreak Posted April 30, 2019 Author Report Posted April 30, 2019 Yes. For every 'action' my program opens a new instance of the "Simulator" class which contains the code above. private void btn_simrate_2_Click(object sender, EventArgs e) { Simulator sim = new Simulator(); sim.SetSimrate(2); sim.Send(); } My idea was to create the class instance, setup all things to send and then send it to the sim.
Paul Henty Posted April 30, 2019 Report Posted April 30, 2019 It's difficult to see what's happening when I don't have the complete code. At the moment I suspect that the sim rate is being written more often than you want. You can confirm this by using the logging in FSUIPC. If you enable the logging for 'IPC Writes' and send the log to the console you will be able to see when the sim rate is being written. We can find out for sure if the sim rate is being 'spammed' (sent over and over again), or if it just gets written once when your program calls SetSimRate(). Thanks, Paul
FwFreak Posted May 1, 2019 Author Report Posted May 1, 2019 Hi Paul! Sorry for the delay but since yesterday evening I cannot reproduce the error any more. Yesterday in the morning I've updated FSUIPC from 5.15 to 5.151 but I was sure that the error was still alive after the update. FSUIPC log shows the offset is send once only.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now