Pizman Posted May 7, 2017 Report Share Posted May 7, 2017 Dear Community Dear Pete. Hope you can help me with a Problem.... Not shure if there is a Problem in FSUIPC or if i did something Wrong. My Opinion is to Set the COM1 and COM2 Audio Buttons ( For Example in the FSX Cessna) with 2 Push Buttons. OFFSET 3122 By The Way... I Understand that The Other Buttons there ( BOTH,NAV1,NAV2, MKR,DME,ADF) can Stay On or OFF Individual.... COM1 and COM2 only can be active Once at same time ! So Setting the Other Stuff ( Bits 0-5 is no Problem ) I Simply write the specific Bit ! Now i tried to do the same with bit 6 and 7 ... Still thought.... If Function is already active ( Bit is 1-TRUE ) then a additional "1" will do nothing..... If a Function is OFF (Bit is Zero False) then a sending of "1" would internal set it ON and disable the other COM (Set this bit to zere then) Now the Thing i don´t understand..... IF Com2 is active and i send for the COM1 Button Value "1" to Bit 7 everything is fine.... Bit 6 change into Zero 0 and Bit 7 Change into 1 ! If i try it reverse and Push the COM2 Button while COM1 is active and try to send "1" on Bit 6 THEN ..... I See that Bit 6 is shortly jumped ON and OFF Again and Bit 7 is still on 1 all the time.... Not Get into Zero ! Please Note: I Know i can do this alternate -With a EventID ... - With a write in the full Byte .... Dierect like 128 for COM1 ( Overwrite all other bits) or i use a IF Function like IF $>=128,$,$+64) This workes too in my programm code ! - Or i use a Press and Release Command.... PRESS Sets the "other" Bit to "0" Release set the target Bit to "1" BUT My Question is still..... Is This Problem i describe above a Issue or is FSUIPC correct here and should work so. A short reply would be nice... I like to understand how this workes.... And maby whats the correct way to controll this function via a Bit Write ! Thank You.... Regards ! Link to comment Share on other sites More sharing options...
Thomas Richter Posted May 7, 2017 Report Share Posted May 7, 2017 Hi, when you use Com 1/2 Tx Switch (by i.e. key control) and monitor Offset 0x3122, you will find that FSX/P3D always first sets the active bit to 0 (zero) before setting the wanted active Com bit. So when Com1 is active (Bit7) and you toggle to Com2 then FS changes Bit7 to 0 and after that it changes Bit6 to 1. For change from Com2 to Com1 FS does exactly the same with the corresponding bits. It is not a FSUIPC error or miss-function but a FSX/P3D behaviour. So for your program there are two ways to do: 1/ changing the active Bitx first to zero before setting the new Bit 2/ writing the value to Offset 0x3122 instead of dealing with Bits, having the selector panel selection code in one place, radioSelector = 0 if (adf1) radioSelector++ if (dme) radioSelector =+ 2 if (markereSnd) radioSelector =+ 4 if (nav1) radioSelector =+ 8 if (nav2) radioSelector =+ 16 if (comBoth) radioSelector =+ 32 if (com2) radioSelector =+ 64 if (com1) radioSelector =+ 128 //write radioSelector value to Offset 0x3122 Thomas Link to comment Share on other sites More sharing options...
Pete Dowson Posted May 7, 2017 Report Share Posted May 7, 2017 8 hours ago, Pizman said: My Opinion is to Set the COM1 and COM2 Audio Buttons ( For Example in the FSX Cessna) with 2 Push Buttons. OFFSET 3122 By The Way... I Understand that The Other Buttons there ( BOTH,NAV1,NAV2, MKR,DME,ADF) can Stay On or OFF Individual.... COM1 and COM2 only can be active Once at same time ! So Setting the Other Stuff ( Bits 0-5 is no Problem ) I Simply write the specific Bit ! Okay. How are the buttons programmed? To set bits or toggle them? Single bits? 8 hours ago, Pizman said: f Function is already active ( Bit is 1-TRUE ) then a additional "1" will do nothing..... If a Function is OFF (Bit is Zero False) then a sending of "1" would internal set it ON and disable the other COM (Set this bit to zere then) Now the Thing i don´t understand..... IF Com2 is active and i send for the COM1 Button Value "1" to Bit 7 everything is fine.... Bit 6 change into Zero 0 and Bit 7 Change into 1 ! If i try it reverse and Push the COM2 Button while COM1 is active and try to send "1" on Bit 6 THEN ..... I See that Bit 6 is shortly jumped ON and OFF Again and Bit 7 is still on 1 all the time.... Not Get into Zero ! Hmm. Good spot. Yes, actually, there is a little logic problem in FSUIPC, and as Thomas implied, originally caused by the strange way FS has implemented those buttons. If you set bit 6 whilst bit 7 is still set. Bit 7 still takes priority. Looks like this problem has been in FSUIPC forever -- strange, either no one else has found it before, or has done and not reported it! I'll fix in the next update (end of the month, unfortunately*). Meanwhile, either use Thomas's suggestions, or simply try toggling both bits -- i.e if you are programming, do an exclusive or of 3122 with 0xC0, so 80 changes to 40 and 40 to 80. For assignments just assign Offset Byte Togglebits parameter xC0 or 192. Toggling the bits is actually logical -- after all the COM1/COM2 button are toggling. You don't seem to be able to turn transmitting off at all, they are just mutually exclusive with one always on. Pete * Since I've changed the code here for this already, it will be fixed in the next interim update, hopefully today or tomorrow. But that one will NOT be a replacement, but a test release. I've completely re-written the Joystick scanning and axis and button identification system because it was all getting too complicated, so much so even I, the author, couldn't understand it! This was precipitated by X-55 and X-56 oddities, but it's been coming. The point is though, I can't yet trust it as a fully working release. I'll only release it for trials and feedback. Link to comment Share on other sites More sharing options...
Pizman Posted May 7, 2017 Author Report Share Posted May 7, 2017 5 hours ago, Pete Dowson said: Okay. How are the buttons programmed? To set bits or toggle them? Single bits? ..... -- strange, either no one else has found it before, or has done and not reported it! Hi Pete, Hi Thomas ..... First Thanks for Reply. I wondering, too that nobody report this until today.... thats why i´m shure that it´s my fault and not a real existing problem. To youre Question.... Myself i just use EventID for that.... But a friend want to do this via Offset ( I think he use Xplane and XPUIPC... Maby EventID not working there)... So i find out this problem only cause i try for him the BitSet technic. ( Maby 99% of Users never try this so nobody found out until now) Problem is.... I´m not a programmer and i use a simple Tool called Mobiflight This Programm allow to easy set Buttons or Outputs to FSUIPC Offsets.... No need of own selfwritten code.... But there is not much real advanced Input Syntax.... You only can Write a Byte or a Bit .... No Way to write 2 Bits at once at the moment for example. I Know for advanced guys like you it´s strange to use a progrmm like this.... But it workes for me verry good.... Some Problems are hard to solve with this rudimenatry tool.... But until now i always find a way ! ****** So finaly.... If you can solve this internal in FSUIPC this would be verry nice ! Thanks a lot for youre work and youre quick support ! Link to comment Share on other sites More sharing options...
Pete Dowson Posted May 7, 2017 Report Share Posted May 7, 2017 39 minutes ago, Pizman said: So finaly.... If you can solve this internal in FSUIPC this would be verry nice ! Thanks a lot for youre work and youre quick support ! It is fixed in an Interim update 4.966m, which you will find in the Download Links subforum soon. But take care -- do save your current FSUIPC4.DLL and FSUIPC4.INI files first so yuo can go back, as there are a LOT of serious changes in this test version and I need feedback for users. Please read the instructions BEFORE downloading! But no feedback till after 25th May please. I'm away till then! Pete Link to comment Share on other sites More sharing options...
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