Jump to content
The simFlight Network Forums

airlombadb

Members
  • Posts

    11
  • Joined

  • Last visited

About airlombadb

  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://www.airlomba.net

Profile Information

  • Location
    Viana do Castelo - Portugal
  • Interests
    Flight and Flight Simulation

Recent Profile Visitors

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

airlombadb's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hello Pete and Paul, Thank you very much to both of you for your answers! To Pete: Some time ago, I was suspecting, now I'm sure: I really need to reinforce my glasses. :) Thanks Pete for pointing me the ONE BYTE values mistake. In fact I never noticed that these values were only one byte wide... Since I read your post I corrected the error and verified the remaining variables sizes. Fortunately, there was only one more of this type. I too wondered about how many error of this kind I would find in my code. Hopefully, my codes are rather simple, just to interface some hardware I build to FS. I am an electronics guy who only knows about ASM (for several CPU architectures) and C programming above Linux. In Windows (due to MSFS) I started to use Visual C# Express Edition (free). I have been able to do some stuff, but very painfully. I've never seen such a stupid way of doing things as I do on Windows; I just can't find any suitable programming tutorial or manual for this "programming language"... Anyway, thanks again. About the writing two FF bytes at 0x3210, every ten seconds. My code never writes anything there. I don't know where this comes from. I didn't find any evidence of the origin of these writing, but I will keep looking for. To Paul: Yes! I am still using the C# SDK. Thank you for your answer too. You are also right about writing the wrong size variable. Thanks for your code example, it is almost exactly the same as I have written. About your DLL, once I finish this piece of code (almost there) I will try the DLL (I already downloaded it), and given what you say, I will use it in my future developments. ;) I cannot finsh my post without thanking both of you once more for your precious help. Thank you! 8-) Best regards to all, Emmanuel.
  2. Hi again Pete, I remembered I had exactly the same problem some time ago with a "virtual hardware" I did. So I just used it to make the test you asked earlier in your post. Please find the log below. I lanched FS2004 with default C172SP, sitting on the runway ready to depart (as default by FS). Then I lanched my application, when it connects to FSUIPC, it shuts everything off in the aircraft, in order to put it as "cold and dark cockpit". Then I start the engine start-up sequence: - Master BAT ON - Fuel valve BOTH - Fuel pump ON - Mixture RICH - Start Then, when I "hit" the MASTER ALT button, all electrical stuff goes OFF (Master BAT, master avionics and even the fuel pump). HOWEVER, if I do this but instead of using my software to "hit" the master ALT, I use the button in Flight Simulator, everything goes fine! Strange huh?! Thank you for your time Pete! Best regards, Emmanuel.
  3. Hello Pete, Thanks for your reply! I am not with my hardware by my side (I'm not at home right now), so I can't make the tests right now, I have to let this for tomorrow. I'll be back with what you asked for. My bad, I apologise, it's not a code, but rather some kind of pseudo-side-note-code. I'm sorry for getting you confused and spend your precious time over this. "keyswitch" is a 32 bit variable (Int32) containing the logic state of the switch: 0 or 1. So here goes an excert of the actual code: Int32 keyswitch; //Variable declaration if (RXstring.Substring(50, 1) == "0") //I090 - MASTER BAT switch OFF <-- RXstring is received via serial port { keyswitch = 0; result = fsuipc.FSUIPC_Write(0x281C, keyswitch, ref token, ref dwResult); } else //I091 - MASTER BAT switch ON { keyswitch = 1; result = fsuipc.FSUIPC_Write(0x281C, keyswitch, ref token, ref dwResult); } result = fsuipc.FSUIPC_Process(ref dwResult); Not a problem at all! I just hope that you'll get some quality time in the meanwhile. ;) I'll be here waiting. 8-) Best regards, Emmanuel.
  4. Hello all, I have been searching the net, and particularly this forum for an answer or some direction to follow but I didn't find any, so here goes my problem. I have a small inputs card with some switches... And I developed a small software application in Visual C# to interface this inputs card to FS2004 via FSUIPC (registered version). Here goes a step by step of what I do and what happens: 1) Launch FS2004 with default C172; 2) Launch my application who connects to inputs card and acquire switches states; 3) My application connects to FS2004 via FSUIPC; 4) My application sends switches states to FS2004 via FSUIPC (via suitable Offsets and according values) to initialize the aircraft for a cold and dark start... Problem 1: Everything goes OK. All switches in FS2004 replicate the real switches states EXCEPT for MASTER BAT and MASTER AVIONICS who doesn't switch OFF (as requested by my application). Problem 2: During startup of the engine (after ignoring problem 1 and forcing manually all switches OFF), everything works OK but when I switch ON the MASTER ALT, electricity goes off! I mean, MASTER ALT goes ON then OFF, MASTER BAT goes OFF and MASTER AVIONICS goes OFF. Can anyone help me or explain me why this could be happening? FYI: The code I to control these switches: MASTER ALT: keyswitch = 0; //OFF keyswitch = 1; //ON result = fsuipc.FSUIPC_Write(0x3101, keyswitch, ref token, ref dwResult); MASTER BAT: keyswitch = 0; //OFF keyswitch = 1; //ON result = fsuipc.FSUIPC_Write(0x281C, keyswitch, ref token, ref dwResult); MASTER AVIONICS: keyswitch = 0; //OFF keyswitch = 1; //ON result = fsuipc.FSUIPC_Write(0x2E80, keyswitch, ref token, ref dwResult); Many thanks and best regards to all, Emmanuel.
  5. I can't thank you enough Paul. You solved my problem and a lot of time with it. And in the mentime I learnt something more about programming in C#. Thank you very much! Best regards, Emmanuel.
  6. Hello Paul, many many thanks for your help. I copied the four methods you provided in your last post, recompiled the code, but unfortunately nothing changed. So far, for testing purposes, I am trying to read the cowl flaps lever position value as follows (please take a look): //Global variables double cowl_flaps = 0.0; (...) //cowl flaps result = fsuipc.FSUIPC_Read(0x37F0, 8, ref token, ref dwResult); result = fsuipc.FSUIPC_Process(ref dwResult); result = fsuipc.FSUIPC_Get(ref token, ref dwResult); cowl_flaps = dwResult; textBox4.Text = cowl_flaps.ToString(); This value should be between 0.0 and 1.0 (fully open and fully closed, respectively). However I always get a signed integer. For example, when in FSInterrogate I get 0,78, in my textbox I get -1889785610. What am I missing or doing wrong? Thank you very much for your help!!! Best regards, LOMBA, Emmanuel.
  7. Wooooooow!!!! Man I am disapointed!!! :( I have been working on a piece of software for some time. A lot has been developed and let to the end the reading of float64 values. Now that I am working on solving this last milestone, I find this topic, I find that I can't handle these values. Man, you can't imagine the words that came out of my mouth. Pfffffff... What can I do now? Start all over again and use phenty's DLL. That's an idea but I am really not into that, unless as a last resource. Phenty, can you help me? Privode some code or pseudo-code so I can resume my work? Thank you anyway. Best regards to all, LOMBA, Emmanuel.
  8. Hola Clemente! :) How did you manage to find FSUIPC and miss the SDK? :D Here goes: http://www.schiratti.com/dowson.html Scroll down and stop at "FSUIPC SDK 29th Release" :wink: Don't forget to read the PDF files inside... Have a nice development! By the way, the offset for the landing gear is 0x0BE8 :wink: Cheers, Emmanuel.
  9. Hi, you can read offset 0x0609 (engine type), in FSUIPC 3.93 (the one I use) 0 = piston 1 = Jet 2 = sailplane 3 = helicopter 4 = rocket 5 = turboprop. I hope is what you need. Best regards, Emmanuel.
  10. Hi Pete, thank you very much for your answer! Very instructive. I just solved my issue and now I can control all the gps Garmin 500 buttons, from my hardware. In fact and as you said, it's a matter of sending the desired control number to the offset 0x3110. Thank you very much for your help and work. Best regards, Emmanuel.
  11. Hello all, I am developing some hardware to build a home cockpit of a simple C172. So far, everything done is working fine through FSUIPC and my drivers. However I have now reached a big wall to jump over (if possible). In fact, I am using the Garmin 500 gps (from fs2004) in a separate window (via undock) and want to control it via some buttons and encoders that I mounted in my panel. The hardware is functionning well and communications between my hardware and my software are good. The problem is between my software and FSUIPC... I can't find any offset to control the gps buttons. Am i missing something? Because I see that it is possible to control the gps via the computer keyboard keys defined directly inside FSUIPC. What I want is to control the gps just like I control the lights; via an offset in FSUIPC. Can anyone help me? Thank you very much. Best regards to all, Emmanuel.
×
×
  • Create New...

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.