Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi Pete,

When debugging some code I found that when reading offset 060C with ipc.readUB(0x060C) for an a/c with a retractable landing gear the value returned was 2 instead of 1 as specified in the offset documentation. Is this just a simple documentation typo, or perhaps is there some additional significance (some characteristic of the landing gear) associated with the "2" versus the "1" ?  With a fixed gear a/c the value returned is 0 as expected.

Thanks,

Al

FSX with SP2,  FSUIPCv4.971, Win10

 

 

Posted

I've moved your question from the reference sub-forum where you wrongly posted it, to here, the Support Forum. Please ALWAYS post support questions here, not into the reference subforums where you are lucky I saw it.

6 hours ago, ark1320 said:

I found that when reading offset 060C with ipc.readUB(0x060C) for an a/c with a retractable landing gear the value returned was 2 instead of 1 as specified in the offset documentation. Is this just a simple documentation typo, or perhaps is there some additional significance (some characteristic of the landing gear) associated with the "2" versus the "1" ?  With a fixed gear a/c the value returned is 0 as expected.

The value is the SimConnect variable ""IS GEAR RETRACTABLE", and should be BOOLEAN, which in almost all languages is encoded by 0 for FALSE and not 0 for TRUE. Whilst it is convention to set TRUE as 1, it doesn't need to be.

FSUIPC doesn't touch the value it gets, it simply places it into offset 060C. I don't know where SimConnect gets the detail for this aspect from, but I assume it is defined in the Aircraft.CFG file somehere. do you get 2 for all aircraft? If it is just the one, look at that file. (of course it might well be in the AIR file for all I know, but that is a binary file so not easily checked).

Below, see what the SimConnect reference says about this one. That's the only information supplied about it.

Pete

 

Simulation Variable Description Units Settable Multiplayer
IS GEAR RETRACTABLE True if gear can be retracted Bool N -
Posted

Yes, I get the value 2 for a number of different default and add-on a/c. I guess as you say it is a case of non 0 means true.  I'll be careful to code accordingly in the future.

I don't know how I managed to post in the wrong forum this time -- sorry.

Thanks for the help,

Al

Posted
34 minutes ago, ark1320 said:

Yes, I get the value 2 for a number of different default and add-on a/c

Can you tell me which default ones this occurs with, please?  I can't check with FSX+SP2, but with FSX-SE which should be the same.

Pete

 

Posted
1 hour ago, ark1320 said:

The default a/c I tried were the Baron 58 and the B737.

 Well, I certainly get 1 in 060C for both of those in FSX-SE. So either Dovetail Games fixed some sort of very odd bug in SimConnect (which is very unikely, to be honest), or there's something odd going on in your system.

Can you go to the Logging tab in FSUIPC options, and set 060C as type U8 in the "monitor" section on the right, then check "Normal Log".  Try those aircraft and show me the results in the FSUIPC4.LOG, please.

If they also show 2 then it must be SimConnect, somehow, but if they show 1 then you'd better show me your Lua plug-in so I can take a look.

Pete

 

 

Posted

Hi Pete,

Below is information from the FSUIPC4.LOG files for the Baron 58 and B737.

Al

Baron B58

1141 SimConnect_Open succeeded: waiting to check version okay

     1141 Trying to use SimConnect Acc/SP2 Oct07

     1141 Opened separate AI Traffic client okay

     3563 Running in "Microsoft Flight Simulator X", Version: 10.0.61472.0 (SimConnect: 10.0.61259.0)

     3563 Initialising SimConnect data requests now

     3563 FSUIPC Menu entry added

     3594 C:\Users\Al\Documents\Flight Simulator X Files\Default Safe Flight Baron 58 35L KCOS.FLT

     3594 C:\FSX\SimObjects\Airplanes\Beech_Baron_58\Beech_Baron_58.AIR

     4219 Monitor IPC:060C (U8) = 0

    50313 Aircraft loaded: running normally now ...

    50313 User Aircraft ID 1 supplied, now being used

    50641 System time = 18/10/2017 16:30:02, Simulator time = 11:49:47 (17:49Z)

    50641 Monitor IPC:060C (U8) = 2

    50641 SimRead: 060C="IS GEAR RETRACTABLE"

            INT32: 2 (0x00000002)

    51406 Aircraft="Beech Baron 58 EPAV"

    51641 Starting everything now ...

    51719 ASN active function link set

    51719 Ready for ActiveSky WX radar with additional data

 

 B737

1109 SimConnect_Open succeeded: waiting to check version okay

     1109 Trying to use SimConnect Acc/SP2 Oct07

     1109 Opened separate AI Traffic client okay

     3609 Running in "Microsoft Flight Simulator X", Version: 10.0.61472.0 (SimConnect: 10.0.61259.0)

     3609 Initialising SimConnect data requests now

     3609 FSUIPC Menu entry added

     3625 C:\Users\Al\Documents\Flight Simulator X Files\Default Safe Flight Baron 58 35L KCOS.FLT

     3625 C:\FSX\SimObjects\Airplanes\Beech_Baron_58\Beech_Baron_58.AIR

     4297 Monitor IPC:060C (U8) = 0

    59859 C:\FSX\SimObjects\Airplanes\B737_800_Default_Modified\Boeing737-800.AIR

   139719 User Aircraft ID 1 supplied, now being used

   140015 System time = 18/10/2017 16:40:14, Simulator time = 11:49:47 (17:49Z)

   140015 Monitor IPC:060C (U8) = 2

   140015 SimRead: 060C="IS GEAR RETRACTABLE"

            INT32: 2 (0x00000002)

   140797 Aircraft="Boeing 737-800 EPAV"

   141000 Starting everything now ...

   141094 ASN active function link set

   141094 Ready for ActiveSky WX radar with additional data

   141156 Plug-in thread table check:

Posted
2 minutes ago, ark1320 said:

    50641 Monitor IPC:060C (U8) = 2
    50641 SimRead: 060C="IS GEAR RETRACTABLE"
                      INT32: 2 (0x00000002)

Well, that's sure proof it IS a SimConnect bug. Just not serious. A BOOLEAN should be supplied as 0 for FALSE and 1 for TRUE. It must have been changed at some time after SP2. Maybe Acceleration, of FSX-SE.

Anyway, if you always treat non-zero as "true" you won't go wrong.

Pete

 

Posted
22 minutes ago, Pete Dowson said:

Anyway, if you always treat non-zero as "true" you won't go wrong.

Pete

 

Yes, a good lesson! Thanks very much for the help.

Al

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.