Jump to content
The simFlight Network Forums

How to assign FSUIPC offsets to an encoder if its button is pressed.


Recommended Posts

I have encoders on the instruments in my Sim panel that are used to adjust things like Course, or Heading, or ADF Card.

Sometimes I need to turn one to a new setting very different from its present one.

This is sometimes takes me a while to do when the thing changes by just one degree at a time.

These encoders are equipped with press buttons that are not currently being utilised.

Is there a way to create a conditional setting that will trigger increments (or decrements) of 10 degrees while the button is pressed?

 

Link to comment
Share on other sites

3 hours ago, David Wilkinson said:

Is there a way to create a conditional setting that will trigger increments (or decrements) of 10 degrees while the button is pressed?

Yes. You need to overload the assignments, i.e. have two assignments on the button press, one for the small increment and one for the fast increment. To achieve this, you can comment out the slow (small inc/dec) assignment and then add the fast (large in/dec) assignment via the UI. Then you need to edit your FSUIPC7.ini file to re-instate the first/slow assignment, and add a compound button condition - see the Advanced User guide (P21) on how to do this.

Note, if/when editing the ini file, make sure that FSUIPC7 is either not running, or do this when the button assignment window is open, and after you have saved your changes click to Reload all buttons.

John

Link to comment
Share on other sites

Thank you John.
VERY much appreciated.

I am actually working with FSUIPC6 and P3Dv5 (I couldn't find the FSUIPC6 forum, sorry)
I have been studying the "Compound Button Conditions" section of the manual (and the two sections prior) and have been looking through the FSUIPC6.ini file.

So I have distilled the following from your response and the manual - please direct my understanding in the right direction.

(Note that I am starting with the VOR2_OBI rotary encoder.)

I need to create 2 assignments on button press:-

  1. small inc/dec
  2. large inc/dec

Steps to do this are as follows:

Via FSUIPC User interface - 

  • First; comment out the existing small increment and the small decrement assignments. (I can't see a way to do this in the UI)
  • Then; add the required large increments and decrement assignments (I assume this is done in the usual way - selecting from the offsets offered)

From within the '.ini' file (editing with NotePad++)

  • Reinstate the commented out small increment and the small decrement assignments.
  • Add the compound Conditions

Regarding the last bullet point I am thinking that I would add these manually in the .ini file and then I can select them from the dropdown menu in the UI to assign them to the button press action.

So I would be appending my offering to the bottom of the [buttons] section as 

84=CR(+j6,b18),P6,26,1029    -{vor2 obi inc fast}-
85=CR(-j6,b18),P6,26,65665     -{VOR2_OBI_INC}-

88=CR(+j6,b18),P6,27,1028    -{vor2 obi dec fast}-  (I haven't been able to find this parameter value so 1028 is a guess/place-holder)
89=CR(-j6,b18),P6,27,65664     -{VOR2_OBI_DEC}-

Comments & advice sought

Kind regards

David
 

Link to comment
Share on other sites

12 hours ago, David Wilkinson said:

I am actually working with FSUIPC6 and P3Dv5 (I couldn't find the FSUIPC6 forum, sorry)

Thats the main support forum - there is only a sub-forum for FSUIPC7. I will move your post there.

12 hours ago, David Wilkinson said:

Via FSUIPC User interface - 

  • First; comment out the existing small increment and the small decrement assignments. (I can't see a way to do this in the UI)
  • Then; add the required large increments and decrement assignments (I assume this is done in the usual way - selecting from the offsets offered)

From within the '.ini' file (editing with NotePad++)

  • Reinstate the commented out small increment and the small decrement assignments.
  • Add the compound Conditions

Yes. Don't forget to either comment out the current assignment (using the ';' character, placed AFTER the '=' sign to preserve the index number) with the FSUIPC button assignments tab visible and click to reload your assignments once changed.

12 hours ago, David Wilkinson said:

Regarding the last bullet point I am thinking that I would add these manually in the .ini file and then I can select them from the dropdown menu in the UI to assign them to the button press action.

You add them manually to the ini file, but you do not select them - they are added to the assignment so this is not necessary. In fact, once you have multiple assignments to a button, you can no longer do anything with this assignment in the UI. One assignment will be shown but grayed-out and not you cannot change it via the UI.

12 hours ago, David Wilkinson said:

So I would be appending my offering to the bottom of the [buttons] section as 

84=CR(+j6,b18),P6,26,1029    -{vor2 obi inc fast}-
85=CR(-j6,b18),P6,26,65665     -{VOR2_OBI_INC}-

88=CR(+j6,b18),P6,27,1028    -{vor2 obi dec fast}-  (I haven't been able to find this parameter value so 1028 is a guess/place-holder)
89=CR(-j6,b18),P6,27,65664     -{VOR2_OBI_DEC}-

You don't need that additional 'P' (press), as 'CR'  already indicates a conditional (C) repeat (R). And the control numbers should be preceded by a 'C'. Those controls do not take a parameter, so doesn't matter what you use, but 0 is best. Comments will be added/re-written by FSUIPC. So:

Quote

84=CR(+j6,b18)6,26,C1029 ,0
85=CR(-j6,b18)6,26,C65665,0     -{VOR2_OBI_INC}-

88=CR(+j6,b18)6,27,C1028, 0
89=CR(-j6,b18)6,27,C65664,0     -{VOR2_OBI_DEC}-

John

Link to comment
Share on other sites

Thanks for that link to the lua event method.  It looks intriguing to my old 'vb.net' brain. 

I will follow that line of methodology if I cannot grasp the compound button way of doing things.

Here is the procedure that I followed to set these encoders up.

1.      In the FSUIPC.ini file, in the [buttons] section, comment out the existing small increment and the small decrement assignments by inserting the ';' character, AFTER the          '=' sign to preserve the index number. 

         For example:-

                    64=;   P6,26,C65665,0             -{VOR2_OBI_INC}-

                    65=;   P6,27,C65664,0             -{VOR2_OBI_DEC}-

2.      Start P3D and go to ADDONS/FSUIPC to display the UI.

3.      Go to the "Buttons + Switches" tab.

4.      Add the required large increments and decrement assignments by selecting from the offsets offered in the dropdown list.

          Which should then be shown in the .ini file like this:-

                    88=P6,26,C1029,0                   -{vor2 obi inc fast}-   

                    89= P6,27,C1028,0                 -{vor2 obi dec fast}-

5.      Click “Save” & Exit P3D.

6.      Open the FSUIPC.ini file and scroll down to the [Buttons] section.

          Remove the ‘;’ from lines 64 & 65 to reinstate those commands.

7.      Manually type in the Compound button-condition.

          Which should look like this (indexed as appropriate):-

                    90=CP(+j6,b18)6,26,C1029 ,0     -{vor2 obi inc fast}-           
                    91=CP(-j6,b18)6,26,C65665,0     -{VOR2_OBI_INC}-

                    92=CP(+j6,b18)6,27,C1028, 0     -{vor2 obi dec fast}-
                    93=CP(-j6,b18)6,27,C65664,0     -{VOR2_OBI_DEC}-

8.      Save & close the FSUIPC.ini file. Run P3D.

 

I followed this procedure for both the VOR1 & VOR2 encoders ('.ini' file attached) and tested it to find that all changes are happening fast - that is by increments of 5°.

On page 29 of the Advanced Users Manual I noticed that the Controls I have used for "fast" look like they should be turning the  gauge dial through + or - 10°
               1028 Vor2 Obi Dec Fast (–10)
                1029 Vor2 Obi Inc Fast (+10)  But I notice just 5° rotation.


I have rechecked that the references to the press-buttons are correct. (that is j6,b18)

It's almost like the '-' prefix is being ignored.

Is there something else I have forgotten that would make it respond to the + or - correctly?

For example, I noticed this line in the ini file under [JoyNames]

                                                       J=<< MISSING JOYSTICK >> << MISSING JOYSTICK >>
                                                                                                                    Is this possibly interfering?

Cheers

David

 

FSUIPC6.ini

Link to comment
Share on other sites

13 hours ago, David Wilkinson said:

For example, I noticed this line in the ini file under [JoyNames]

                                                       J=<< MISSING JOYSTICK >> << MISSING JOYSTICK >>
                                                                                                                    Is this possibly interfering?

Yes - you are not using the joyletters facility (you should!), and the j and b letters are just placeholders for the joystick id/letter and button number Change
 

13 hours ago, David Wilkinson said:

                    90=CP(+j6,b18)6,26,C1029 ,0     -{vor2 obi inc fast}-           
                    91=CP(-j6,b18)6,26,C65665,0     -{VOR2_OBI_INC}-

                    92=CP(+j6,b18)6,27,C1028, 0     -{vor2 obi dec fast}-
                    93=CP(-j6,b18)6,27,C65664,0     -{VOR2_OBI_DEC}-

to

13 hours ago, David Wilkinson said:

                    90=CP(+6,18)6,26,C1029 ,0     -{vor2 obi inc fast}-           
                    91=CP(-6,18)6,26,C65665,0     -{VOR2_OBI_INC}-

                    92=CP(+6,18)6,27,C1028, 0     -{vor2 obi dec fast}-
                    93=CP(-6,18)6,27,C65664,0     -{VOR2_OBI_DEC}-

You should also switch to using JoyLetters. Just change to
    AutoAssignLetters=Yes

This will prevent issues if your joystick ids change.

John

Link to comment
Share on other sites

55 minutes ago, John Dowson said:

No, they are needed. You can delete the <<MISSING JOYSTICK>> line though, as this is there as you referenced a 'j' device.

Ooops!
I did delete that section. 
I noticed though, that it was all back there again after I ran P3D - however, this time the <<MISSING JOYSTICK>> line was not there.

I have found out what I was doing wrong!

1. I commented out the original two .ini file entries for the standard encoder inc and dec actions.

2. Then went back to the UI and assigned the VOR obi inc/dec fast actions.  

3. Then I manually added four new lines to the .ini file as discussed previously.

4.  then uncommented the original two entries.

That's all fine, but what I didn't do then was to comment out the two lines added in step 2 above.  Consequently, then, with duplicated entries for rapid movement there were confused results in the sim.

It seems to be all working well now.

Thank you yet again John.

Link to comment
Share on other sites

👍

1 hour ago, David Wilkinson said:

Ooops!
I did delete that section. 
I noticed though, that it was all back there again after I ran P3D - however, this time the <<MISSING JOYSTICK>> line was not there.

Yes - if you remove the numbered entries they will be added back - they are needed to map the joyid numbers to the letters, based upon the GUIFs.

Glad its all now working!

Cheers,

John

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.