Jump to content
The simFlight Network Forums

AirPanther

Members
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

0 Neutral

About AirPanther

  • Rank
    Member
  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://www.777Simulator.com

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. AirPanther

    Event Handler Issue

    Thank you for your response Paul! It was running Process() in a separate timer at 15ms intervals, but I also added it as the very next line after writing the transponder code and it does the same thing. FsTransponderCode txHelper = new FsTransponderCode((int)value); FSUIPC_TransponderCode.Value = txHelper.ToBCD(); Process(); I am indeed referring to the local variable FSUIPC_TransponderCode.Value, and I've called Process() Robert
  2. AirPanther

    Event Handler Issue

    Good day, I'm experiencing an issue when writing to an offset from an event delegate. In this case 0x0354 (Transponder). The code below, from the SDK, works PERFECTLY when I call the function from a button, timer tick, etc. However, once I call the same SetTransponder() from an event delegate, the value in FSX only updates refreshes about 20% of the time. The other 80% of the time it doesn't update. What's even stranger is if I immediately read back the offset from FSUIPC, I always get the correct value, even though the value in FSX hasn't changed. I added a counter to the function to make sure the function was firing, and it accurately increments every time the function is called. private Offset<ushort> FSUIPC_TransponderCode = new Offset<ushort>(0x0354); int counter; UDPConnection.UDPDataReceived += new EventHandler(SetTransponder); // Start UDP listener SetTransponder () { FsTransponderCode txHelper = new FsTransponderCode((int)value); FSUIPC_TransponderCode.Value = txHelper.ToBCD(); counter++; } Output If I fire this function 15 times from the event handler, and send the results to the Output window I get: Output Window (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); But in FSX, I will see Transponder Frequency (0001, 0004, 0005, 0010, 0013) However, If I fire this function from a timer or button I get: Output Window (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); Transponder Frequency (0001,0002,0003,0004,0005,0006,0007,0008,0009........0015) The function is definitely firing, as I'm getting the correct counter output on each function call AND I'm getting the correct value back if I immediately query FSUIPC. So, any idea why FSX doesn't update consistently when the function is fired by an event? Thanks much, Robert
  3. This is very helpful. Thanks very much! So the big difference from what I was doing is I still need to use do all the FSUIPC_Read(s) during every loop iteration, but I only need to call FSUIPC_Process, once. I can see where keeping track of the tokens can get messy quickly. I thought about doing a token array, then tracking the elements, but I may look into switching to Paul's .net code, which seems a lot cleaner. Thanks! Robert
  4. Good day, I am successfully able to read as many offsets as I want, but I realize I'm not doing so correctly. If I need data from 30 offsets, I run the following code 30 times, which means I'm also doing 30 reads and 30 process calls on EVERY loop iteration. This is really slowing things down once I try to read 10 or more offsets. private void getData(int FSUIPC_Offset, int Offset_Length) { result = fsuipc.FSUIPC_Read(FSUIPC_Offset, Offset_Length, ref token, ref dwResult); result = fsuipc.FSUIPC_Process(ref dwResult); result = fsuipc.FSUIPC_Get(ref token, ref dwResult); } What's the best way to efficiently read a bunch of offsets at the same time? Are there any sample code snippets that show reading, then outputting multiple (maybe 5 or more) offsets? I realize Paul's .net example accesses many values at the same time, but what about from C, C# or others? If, for instance, I'm reading 30 offsets using a loop, do I have to have to do all the FSUIPC_Read on every loop iteration, or do I just do all the FSUIPC_Read one time, then run FSUIPC_Process once on every loop iteration? Thanks, Robert
  5. Pete, As usual, I sincerely appreciate you taking the time to help me think through this. I will definitely give some thought to interpolation. Will also look at some of the altitude equations to see if I can calculate static pressure from altitude and temp. Thanks again Pete/John for all your years of support! Robert
  6. John, Thank you very much for your response! What you are experiencing aligns with what I'm experiencing, and it makes sense that this wouldn't be a limitation caused by FSUIPC. So question is, is there another way (or offset) I should be reading to get the static pressure in real time? Robert
  7. Awesome! I tried your suggestion for total air pressure and it appears that was the answer I needed, thank you very much! I didn't think about Bernoulli's Equation. This solves my issue for Ram / Total Air Pressure! Still trying to figure out the Static Pressure issue. I would expect it to change proportional to the altitude like in the real aircraft. It seems to be doing that, just with really low resolution. Unlike the dynamic pressure, which is updating in near real-time (low-mid millisecond rate), the static pressure still seems to be updating about every second or so. Robert
  8. Good day, I am able to successfully read most FSX offsets at low-mid millisecond rates (pitch, bank, altitude, heading, etc.). I'm using this data to feed real aircraft parts and the data has been working great. However, my altimeter and airspeed indicators use static pressure and ram air pressure not altitude and airspeed. Here are my issues: Static Port Pressure Issue I wasn't sure exactly which offset to use, so I'm using 0x28C8 (Ambient air pressure). This appears to produce the right value, but at a rate too slow to use. Even in FSInterrogate, when I poll this value, it only changes about every second or so, unlike altitude and other values, which are super smooth. I get the same behavior when I use offsets 0x0020 or 0x0B4C to read altitude instead of 0x0570. Ram Air Pressure Question Again, I wasn't entirely sure which offset to use, so I'm using 0x30D8 (Dynamic Pressure). The value seems to correlate with the airspeed, but I'm not sure if this is what I should be reading for ram air pressure. Thoughts are appreciated. Thanks very much for any guidance, Robert P.S. - Pete thanks for the great product and for ALL your years supporting it.
  9. Makes perfect since! Thanks a bunch for your fast response! Robert
  10. Hey Pete, I'm having trouble getting the Master Battery switch and the Fuel Boost Pump switch working properly. With the Landing Gear, landing lights, etc. I noticed there is a setting such as "Landing Gear Up" "Landing Gear Down", but for boost pumps it says, "Toggle Boost Pumps" and similar for the master battery alternator toggle. In the button pressed parameter I put 1, and in the button released parameter I put a 0. I also tried them the other way around, but for some reason, the switch reacts backwards depending on where the switch was positioned on sim startup. What is the correct way for me to setup the switch, so like the landing gear, pressed is always on and released is always off for the fuel pumps and master battery alternator. Thanks much! Robert Prather
×

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.