Jump to content
The simFlight Network Forums

Offset 310A


Recommended Posts

Hello,

I'm trying to write a Thrust hold function, and am trying to prevent joystick throttle inputs while this mode is active.

#define JOYSTICK_AXIS   0x310A
BYTE FsuipcMem[1024]; 
BOOL FsuipcOK = FALSE;
static	 DWORD dwResult;
...
...
 BYTE fcon=0;

  FsuipcOK=FSUIPC_Open2(SIM_ANY, &dwResult, FsuipcMem, sizeof(FsuipcMem));
  if(FsuipcOK)
  {
   fcon |= 1 << 3;
   FSUIPC_Write(JOYSTICK_AXIS, 1, &fcon, &dwResult);
   FSUIPC_Process(&dwResult);
   FSUIPC_Close();
  }

This is write is made once every few seconds.

The above code segment does indeed inhibit the Joystick throttle inputs.

But it also inhibits the elevator inputs as well. When I clear the bit they both come back.

I'd like only the throttle inputs inhibited.

Any idea what I'm doing wrong here ?

Thanks.

Regards.

Ernie.

Link to comment
Share on other sites

But it also inhibits the elevator inputs as well. When I clear the bit they both come back.

Could you possibly tell me a bit more, like the version of FS and the version of FSUIPC? I can't really do much without such information.

Additionally, please enable FSUIPC's IPC write logging, for the duration of your test, and let me see that part of the log. Actually, also monitor 310A in the monitoring section, right-hand side of the Logging tab, and check the "normal log" option.

Oh, I could also do with knowing how the controls (throttles, elevator) are assigned and calibrated -- assigned in FS or FSUIPC? Assigned direct to FSUIPC calibration, or via FS controls? Calibrated in FSUIPC?

Regards

Pete

Link to comment
Share on other sites

Whilst awaiting your reply, I've just tried using this little Lua plug-in:

while true do
   ipc.writeUB(ox310a,8)
   ipc.sleep(5000)
end

with the very latest incremental releases of FSUIPC as found in the Updates announcement here.

I've found a problem in FSX, but not yours in either FSX or FS9:

Assigning in FS: the inhibits work as specified in FS9, but not at all in FSX (i.e. they fail to inhibit! Ouch!

Assigning to FS controls in FSUIPC: the inhibits work as specified in FS9, but not at all in FSX (i.e. they fail to inhibit! Ouch!

Assigning in FSUIPC direct to FSUIPC calibration: the inhibits work as specified in both FS9 and FSX.

So, I've some some investigation to do, but I cannot reproduce your case. I'm guessing that what you have shown me, your code, is an extract and the value of "fcon" is not 8 as you expected, but 9. The use of this: fcon |= 1 << 3; to set a value of 8 suggests as much -- why "OR" the bit in if you expect it to stay zero?

Regards

Pete

Link to comment
Share on other sites

Hi Pete,

thanks very much for the reply.

I tried it again today, and the elevators are working fine. I can't explain why they weren't yersterday with the same code, unless I did something silly like have the autopilot on.

If the issue arises again, I'll provide further details, and the log.

Thanks for the help.

Regards.

Ernie.

Link to comment
Share on other sites

I tried it again today, and the elevators are working fine. I can't explain why they weren't yersterday with the same code, unless I did something silly like have the autopilot on.

Okay.

I also found that my "problem" in FSX wasn't a real one. I'd forgotten I had some other controls configured with "direct" assignment -- when direct assignment is being used in FSUIPC4, it doesn't intercept the normal FS controls (because they should be unused), and so therefore cannot disable them! In fact it used to intercept them, but this gave real problems for fly-by-wire addons.

If the issue arises again, I'll provide further details, and the log.

Okay.

Best Regards

Pete

Link to comment
Share on other sites

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.