yrodin Posted April 24, 2023 Report Posted April 24, 2023 Hello, I purchased a switch box for the light switches for the FSLabs airbus in P3Dv5. I would like to program the 3 position switches that go from an "OFF" position to a central position to an "ON" position. I've been using the "custom control" feature in FSUIPC with the "Rotor Brake" command to assign the custom control values to move the switches in the sim, but there are only commands to "increase" or "decrease" the switch position. With a 3 position single switch this does not work when moving from an OFF to a central position then to ON and back to the central position then to OFF since the central switch position will have to act as an "increase" and a "decrease" depending on the direction the switch is moved. Is there any way I can fix this with the FSUIPC settings? Thank you.
John Dowson Posted April 25, 2023 Report Posted April 25, 2023 (edited) I am not sure about the FSLabs airbus as I don't have this aircraft, but with the PMDG aircraft you have two ways of using custom controls, one of which is to use the Rotor Brake control with a parameter that includes both the custom control number together with the mouse option needed, and the other way is to use the custom control number itself, and the parameter for this can be a specific position/number, as well as using the mouse operation codes. So first check if this is possible for the FSLabs. Note there are FAQ entries for both of these methods for the PMDG aircraft. If you are stuck with using the Rotor Brake in/dec functions, you will need to find something that holds the current switch position, so you know what needs to be sent to change it to each other position. You can then use conditional assignments to program the switch (i.e. what controls it sends can be dependent on its current position based on an offset or flag value). Assigning for 3-position switches also depends on what buttons the switch reports. If, for example, you only see two buttons for the up and down positions, the central position will be off for the two buttons, as described in this post: John Edited April 25, 2023 by John Dowson Further info added
yrodin Posted April 25, 2023 Author Report Posted April 25, 2023 Thank you for your reply, but I didn't understand much of what you said. The three position physical switch that I have is like 3 keys on a keyboard (3 positions are recognized in FSUIPC assignments) except that it's a switch like in the picture. The FSlabs 3 position lights switch has 3 unique positions that would correspond to the 3 positions on the physical switch. So, I need 3 separate assignments for each switch position, but the rotor_brake control codes only move the switch in one direction or another giving me only 2 positions for the 3 position switch. I looked up mouse macros in the manual and was able to use that, but it's the same as rotor_brake - the "1" and the "3" in the mouse macros just move the switch up or down, but as you know I need that center switch to move in both directions. So basically I need a "center" position assignment as well as "on" and "off". How do I "hold the current switch position" and "use conditional assignments" as you suggested to program the switch? What are offset and flag values? Thanks for your help.
John Dowson Posted April 25, 2023 Report Posted April 25, 2023 2 minutes ago, yrodin said: The three position physical switch that I have is like 3 keys on a keyboard (3 positions are recognized in FSUIPC assignments) except that it's a switch like in the picture. Not sure what you mean...so each position gives a unique button press? How about the button release? How you program a 3-position switch depends on the releases as well as the presses. For example, if there are 3 buttons, 0 ( centre), 1(left/up), 2 (right/down): 1 <--> 0 <-->2 Moving from 0-> triggers button 1, so you would assign the appropriate mouse-click (left mouse) to button 1 press. If moving from 1->0 gives a button 1 release, then you can profram the right-mouse click for the release of button 1. Similarly you can assign to button 2 press/release, but with the mouse-click/codes reversed. If moving from 0->1 gives a button 1 press and release, you cannot do it this way, and the problem you then have is how to assign the centre 0 button/position, as this would need to trigger either a left or right change, depending upon where it came from. To do it this way, toy would need to overload your assignments (i.e. have to assignments for the 0 button), and a conditional test in each to determine which is used. If this is the case, you can initially try adding conditions to the button latch flags for buttons 1 and 2. That may work, but this again depends on how the buttons work. If it doesn't work with latch flags, you need to either find an offset or lvar that holds the button position and use that as an offset condition (you can add the lvar to an offset). Otherwise, and maybe easier, you can use your own offset and overload the assignments to button 1 and 2 to also update/set your own offset, and then you can use this with an offset condition on your overloaded assignments (you will have two, one for each direction) to button 1. 45 minutes ago, yrodin said: How do I "hold the current switch position" and "use conditional assignments" as you suggested to program the switch? What are offset and flag values? Please see the Advanced User manual in using conditional assignments (actually called COMPOUND BUTTON CONDITIONS in the manual), as well as on using button flags and offset conditions. You can use logging for Buttons & Keys to determine when button presses and releases are triggered. Give the documentation a read and give it a try. I recommend you do this with the logging console window open so that you can see the logging in real-time. If you get into difficulties, show me what you have so far (i.e. attach your FSUIPC6.ini file) and also attach a log generated with logging for Buttons & Keys and Events (non-axis controls) activated where you just load the aircraft and then move the switch through its positions: 0 -> 1 -> 0 >- 2 -> 0 John
yrodin Posted April 25, 2023 Author Report Posted April 25, 2023 (edited) In the advanced users manual in the buttons section there is a conditional programming for a switch that may work for me. I have a 3 position Strobe light switch with "ON" "AUTO" and "OFF" positions. The center position is AUTO. As far as I understand I should program the AUTO position like this: Strobe switch moved from OFF to AUTO (code 72472), strobe switch moved from AUTO to ON (code 72472), strobe switch moved from ON to AUTO (code 72471), strobe switch moved from AUTO to OFF (code 72471). As you can see, whether the AUTO switch sends the code 72472 or 72471 is dependent on whether the last switch position was ON or OFF. The center button/switch in my control is the AUTO position and needs to send different commands depending on the previous switch position. How do I program this in the FSUIPC6.ini file? This is what I have so far in that file for my switch box: 24=R2,6,C66587,72471 -{ROTOR_BRAKE}- 25=P2,4,C66587,72472 -{ROTOR_BRAKE}- 27=P2,0,C66587,72477 -{ROTOR_BRAKE}- 28=P2,19,C66587,72476 -{ROTOR_BRAKE}- 29=P2,1,C66587,72482 -{ROTOR_BRAKE}- 30=P2,20,C66587,72481 -{ROTOR_BRAKE}- 31=P2,2,C66587,72492 -{ROTOR_BRAKE}- 32=P2,21,C66587,72491 -{ROTOR_BRAKE}- 34=P2,8,C66587,72487 -{ROTOR_BRAKE}- 35=R2,9,C66587,72486 -{ROTOR_BRAKE}- 36=P2,17,C66587,72512 -{ROTOR_BRAKE}- 37=R2,18,C66587,72511 -{ROTOR_BRAKE}- 38=P2,16,C66587,72512 -{ROTOR_BRAKE}- 39=P2,11,C66587,72497 -{ROTOR_BRAKE}- 40=R2,12,C66587,72496 -{ROTOR_BRAKE}- 41=P2,10,C66587,72497 -{ROTOR_BRAKE}- 42=P2,14,C66587,72507 -{ROTOR_BRAKE}- 43=R2,15,C66587,72506 -{ROTOR_BRAKE}- 44=P2,13,C66587,72507 -{ROTOR_BRAKE}- 45=P2,7,C66587,72487 -{ROTOR_BRAKE}- 47=P2,5,C66587,72472 -{ROTOR_BRAKE}- Edited April 25, 2023 by yrodin
yrodin Posted April 25, 2023 Author Report Posted April 25, 2023 (edited) The lines for the switch are 24, 25 and 47. It's codes 72472 and 72471 Edited April 25, 2023 by yrodin
John Dowson Posted April 25, 2023 Report Posted April 25, 2023 It is easier for me if you attach files (rather than pasting contents), and also provide me with the log file I asked for... Presuming 5 is the Auto button, you need to duplicate and add a condition to entry 47. First try with the button flags, so use: Quote 47=CP(F+2,6)2,5,C66587,72472 -{ROTOR_BRAKE}- 48=CP(F+2,4)2,5,C66587,72471 -{ROTOR_BRAKE}- You may also need to clear the button flags manually when you go back to the Auto position. If you need to do this (try without first), instead use: Quote 47=CP(F+2,6)2,5,C66587,72472 -{ROTOR_BRAKE}- 48=CP(F+2,6)2,5,C1004,518 49=CP(F+2,4)2,5,C66587,72471 -{ROTOR_BRAKE}- 50=CP(F+2,4)2,5,C1004,516 Not sure which way around it should be either - if its the opposite way, switch the 72471 and 72472 parameters around on lines 47.48 (first case) or on lines 47,49 (2nd case). John
yrodin Posted April 25, 2023 Author Report Posted April 25, 2023 Thank you very much for this! I will have to duplicate your codes for the rest of the 3 position switches. Buttons flags must be cleared for proper operation so lines 47 - 50 are the ones that worked. Btw, I couldn't attach the files you asked for since there is a 20kb limit on attachments, sorry. Thanks again!
John Dowson Posted April 25, 2023 Report Posted April 25, 2023 8 minutes ago, yrodin said: Thank you very much for this! I will have to duplicate your codes for the rest of the 3 position switches. Buttons flags must be cleared for proper operation so lines 47 - 50 are the ones that worked. Ok. Make sure that you understand what those lines are doing before you duplicate, as you will need to use the correct flags for each button, and get the parameter for the clear flag control (1004) correct to clear the flag for the button you are testing. John
yrodin Posted April 25, 2023 Author Report Posted April 25, 2023 Just finished setting up all the switches and they all work as they should! Getting the right parameter for the 1004 control was a bit tricky for all the different lights.
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