ErnieAlston Posted November 24, 2009 Report Posted November 24, 2009 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.
Pete Dowson Posted November 25, 2009 Report Posted November 25, 2009 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
Pete Dowson Posted November 25, 2009 Report Posted November 25, 2009 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
ErnieAlston Posted November 25, 2009 Author Report Posted November 25, 2009 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.
Pete Dowson Posted November 25, 2009 Report Posted November 25, 2009 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
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