ansett727rma Posted June 19, 2009 Report Posted June 19, 2009 Hi, I am trying to setup my light switches as toggle switches connected to LPT Switch, interfaced in PPJoy and programmed directly in FSUIPC. I have read in other posts on this forum that Offset 0D0C can be used with Setbit and Clrbit to select individual lights, allowing synchronisation with Initial FS startup settings. Programming directly with FSUIPC however appears to use Controls such as 6**** to select an offset. In the lists I cannot see one of these 6**** codes which correspond to Offset 0D0C. Can someone please give an example of how this can be done. Thank You :?: :?: :?: :?: :?: :?: :?:
Pete Dowson Posted June 28, 2009 Report Posted June 28, 2009 Programming directly with FSUIPC however appears to use Controls such as 6**** to select an offset. In the lists I cannot see one of these 6**** codes which correspond to Offset 0D0C. If you are programming directly to the FSUIPC interface, which not simply change the bits in 0D0C directly -- i.e. read 0D0C, change a bit, write it back? If you really need to use a control, then you should refer to the list of added FSUIPC control numbers which is provided in the Advanced User's guide. Only the FS controls are numbers 65536 and above. Regards Pete
ansett727rma Posted July 5, 2009 Author Report Posted July 5, 2009 Can Offset 0D0C be written to directly using FSUIPC.ini ? Can you give an example?
Pete Dowson Posted July 5, 2009 Report Posted July 5, 2009 Can Offset 0D0C be written to directly using FSUIPC.ini ?Can you give an example? Why do you want to edit the INI file when you can use the Options in FS? Go to the Keys or Buttons tab in FSUIPC options, assign whatever it is you want to the FSUIPC control "Offset Word ToggleBits" (for a toggle action -- else use "... SetBits" to switch on and "... ClrBits" to switch off). Enter x0D0C for the Offset, and the value for the bit you want to change as the parameter -- 1 for bit 0, 2 for bit 1etc (2 to the power n for bit n). That's it. Pete 1
ansett727rma Posted September 8, 2009 Author Report Posted September 8, 2009 I Have been using setbit/clrbit to try and get lights working with spdt rocker switches. Below is the code from FSUIPC4.ini that I have been trying with these. The Bcn, Nav, strobe and landing lights work fine until the taxi light switch is switched which causes the others to turn off. I dont understand why? Any help would be appreciated. THANK YOU 15=P1,10,Cx06000D0C,x0002 (Beacon) 16=P1,11,Cx06000D0C,x0001 (Nav) 17=P1,12,C66052,0 (Strobe) 18=P1,13,Cx06000D0C,x0008 (Taxi) 19=P1,14,Cx06000D0C,x0004 (Landing)
Pete Dowson Posted September 8, 2009 Report Posted September 8, 2009 I Have been using setbit/clrbit to try and get lights working with spdt rocker switches. Below is the code from FSUIPC4.ini that I have been trying with these. The Bcn, Nav, strobe and landing lights work fine until the taxi light switch is switched which causes the others to turn off. I dont understand why? Any help would be appreciated. You only show the INI lines for switching on -- show me the whole set please. Which aircraft are you testing it with? Maybe it is a function of the panel you are using? Certainly FSUIPC4 internally interprets each bit separately. Incidentally, why are you using bits in 0D0C for most then an FS control for Strobe? There are FS controls for Landing lights on/off as well, but you've used the 0D0C bit for that. x0010 is the parameter for Strobe. Do you know you can use FSUIPC logging to help find out what is happening? On the logging tab, enable the Event log, which will show any resulting FS controls, and for the lights try using the right-hand side of that tab: Offset 0D0C, type U16, check "Normal log" below. If you run FSX in Windowed mode you can see the logging in real time by checking the Console Log option. Regards Pete
ansett727rma Posted September 8, 2009 Author Report Posted September 8, 2009 HI Pete, sorry i didnt see the swiching off lines further down. I am using the Stock FSX 737-800. Am I using the correct parameters? Could you please list all the parameters for all lights using this offset? THANK YOU 15=P1,10,Cx06000D0C,x0002 (Beacon) 16=P1,11,Cx06000D0C,x0001 (Nav) 17=P1,12,C66052,0 (Strobe) 18=P1,13,Cx06000D0C,x0008 (Taxi) 19=P1,14,Cx06000D0C,x0004 (Landing 34=U1,10,Cx0A000D0C,x0002 35=U1,11,Cx0A000D0C,x0001 36=U1,12,C66053,0 37=U1,13,Cx0A000D0C,x0008 38=U1,14,Cx0A000D0C,x0004
Pete Dowson Posted September 8, 2009 Report Posted September 8, 2009 I am using the Stock FSX 737-800. Am I using the correct parameters? Yes, that's fine -- except for the inconsistency of using FS controls for strobe. I think you must have that Taxi light button assigned elsewhere as well, possibly in FSX itself? Probably to the all-lights toggle control. Assigning button and axes in FSUIPC doesn't stop FS assignments from also operating. I can't stop that. Could you please list all the parameters for all lights using this offset? Are you not referring to the documentation? If not where did you get those you are using? Here's the relevant part of the Offsets table: 0D0C 2 Lights, a switch for each one (bits from lo to hi): 0 Navigation 1 Beacon 2 Landing 3 Taxi 4 Strobes 5 Instruments 6 Recognition 7 Wing 8 Logo 9 Cabin In hexadecimal notation bits are in groups of 4, with single bits shown as 1 2 4 and 8 respectively, from low bit number to high. So, strobe being bit 4 is x0010 (the first bit in the second group of 4). Easier, use decimal when entering the parameter in the FSUIPC Button Assignments dialogue (FSUIPC will convert to hex). For decimal bit equivalents it is simply 2 to the power of the bit number. So: bit 4 = 2 x 2 x 2 x 2 = 16. Regards Pete
ansett727rma Posted September 8, 2009 Author Report Posted September 8, 2009 Hi Pete, thanks for your help. I think Ive got the lights sorted for now.
Pimas Posted April 8, 2017 Report Posted April 8, 2017 Hi everyone. This topic is old, but after an extended search, I can't find a perfect solution to control the light switches individualy. So, after a few code testing, I got it! First you need to get ALL the switches status, split the retrieved data into vars, change whatever you need, and finaly write them back. Example: -- Read Light switch status navi, bcon, land, txii, strb, inst, recg, wing, logo, cabn = ipc.readStruct(0x0D0C, "10UB") -- Change Light switch On/Off navi = 1 logo = 1 -- Write Light switch status ipc.writeStruct(0x0D0C, "10UB", navi, bcon, land, txii, strb, inst, recg, wing, logo, cabn) I hope this can help you.
Pete Dowson Posted April 8, 2017 Report Posted April 8, 2017 4 hours ago, Pimas said: First you need to get ALL the switches status, split the retrieved data into vars, change whatever you need, and finaly write them back. Actually, I'm really not sure how you propose doing this (i.e. from another program, via assignments, or what), but whichever way I think it is a lot easier than you propose. All the switch states are indicated and controlled by the values in offset 0D0C. There are values for the10 different lights. Each has its own controlling "bit", bits 0-9. For assignments to switches you can simply asign to "offset word togglebits", "offset word setbits" or "offset word clrbits" (depending on whether you want to toggle, switch on, or switch off the light) with the offset set to xD0C and the parameter set to 1, 2, 4, 8, 16 ... 512, according to which you want to change. For bit numbers to decimal values, and more about computer numbers, see the FAQ thread about bits and numbers. Similar considerations apply to Lua pluguns, and of course FSUIPC applications. 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