Jump to content
The simFlight Network Forums

Custom Programing Help Requested for Switches


Travis1992

Recommended Posts

Hello, I am looking for help to get custom switches working on my Bravo Throttles. Does anyone know if there is a way to "record" pressing switches in the cockpit and getting the Offset and Parameter values for each position? Essentially what is sent to the sim. I have looked through documentation before asking here, and can not find anything(not saying it doesn't exist).

My best example right now is the Parking Brake.
I want to get the true values of "Parking Brake On/Set" and "Parking Brake Off/Released" So I can have it repeating when pressed. That way when my sim is turned on, the parking brake is always in the correct position my switch on my quadrant is indicating.

I also want to do this with other switches and such, so it would be nice if the recording function was possible. I have seen such a function in older versions of FSUIPC, however it does not seem to be here yet. Maybe I have to wait for this feature.

If there is a better way to do this, please let me know. I have been looking, and I am sure someone is going to point me somewhere more than likely, thank you in advanced and sorry for the troubles.

Link to comment
Share on other sites

7 hours ago, Travis1992 said:

Does anyone know if there is a way to "record" pressing switches in the cockpit and getting the Offset and Parameter values for each position? Essentially what is sent to the sim. I have looked through documentation before asking here, and can not find anything(not saying it doesn't exist).

I think you are referring to the Mouse Macro facility,  which was available in previous versions of FSUIPC. This is currently not supported in FSUIPC7 as the MSFS SDK does not yet provide facilities for this.

7 hours ago, Travis1992 said:

My best example right now is the Parking Brake.
I want to get the true values of "Parking Brake On/Set" and "Parking Brake Off/Released" So I can have it repeating when pressed. That way when my sim is turned on, the parking brake is always in the correct position my switch on my quadrant is indicating.

I also want to do this with other switches and such, so it would be nice if the recording function was possible. I have seen such a function in older versions of FSUIPC, however it does not seem to be here yet. Maybe I have to wait for this feature.

If there is a better way to do this, please let me know. I have been looking, and I am sure someone is going to point me somewhere more than likely, thank you in advanced and sorry for the troubles.

It is generally always better to use controls/events where possible, as such assignments apply to many aircraft. Mouse macros are always aircraft specific.
For the Parking Brakes, there is the Parking Brakes control, which acts as a toggle. You can just assign that to a button. If its a sticky button or switch (with different positions indicating on and off), then you can also add an offset condition (on 0x0BC8) to only send the control when required.
Generally, you will find that there can be toggle controls (for on/off) or set controls (where you send a parameter to indicate the state to set). Both can be used with offset conditions (if there is an appropriate offset!) to only send the control required to maintain the state of the button with the sim. Please see the Advanced User Guide on offset conditions (P22).

John 

 

Link to comment
Share on other sites

On 12/23/2020 at 7:51 PM, John Dowson said:

I think you are referring to the Mouse Macro facility,  which was available in previous versions of FSUIPC. This is currently not supported in FSUIPC7 as the MSFS SDK does not yet provide facilities for this.

It is generally always better to use controls/events where possible, as such assignments apply to many aircraft. Mouse macros are always aircraft specific.
For the Parking Brakes, there is the Parking Brakes control, which acts as a toggle. You can just assign that to a button. If its a sticky button or switch (with different positions indicating on and off), then you can also add an offset condition (on 0x0BC8) to only send the control when required.
Generally, you will find that there can be toggle controls (for on/off) or set controls (where you send a parameter to indicate the state to set). Both can be used with offset conditions (if there is an appropriate offset!) to only send the control required to maintain the state of the button with the sim. Please see the Advanced User Guide on offset conditions (P22).

John 

 

hi John,

How to set the "offset" command? because I am not familiar with the script, could you please provide more guideline about the Parking brake offest on Bravo toggle switch?

Thank you very much.

Brgds

Kelvin

Link to comment
Share on other sites

I'm new here because I can't find (after reading and trying for hours) a solution for my problem.
I want to configure the TBM930 with my Thrustmaster HOTA-Throttle. So far I managed to configure the axis, some switches and this works pretty fine. What's  "killing" me is the starter switch in the TBM930 overhead panel. I can't find the correct control to move this button. After trying different controls without any success I wantet to make a mousee macro, only to find out, that this is not implementet by MSFS and does not work 🤪

Is there any chance I can bring this overhead panel switch to life with my throttle switches?

Steve  

Btw: I have the newest Version of FSUIPC7 and it's registered

Edited by CHpilot
Link to comment
Share on other sites

On 12/27/2020 at 4:42 AM, kelvinlmc said:

could you please provide more guideline about the Parking brake offest on Bravo toggle switch?

Toggle your switch and assign the PARKING BRAKES control to both your button press ad release. Then located those assignment lines in your FSUIPC7.ini. I have just assigned to a spare switch, and these are my lines (where '109' is my device id, and button id is 15):

Quote

52=P109,15,C65752,0     -{PARKING_BRAKES}-
...
59=U109,15,C65752,0     -{PARKING_BRAKES}-
 

To add an offset condition on 0x0BC8 (BRAKE PARKING POSITION), I would change those entries to

Quote

52=W0BC8=0 P109,15,C65752,0     -{PARKING_BRAKES}-
...
59=W0BC8 U109,15,C65752,0     -{PARKING_BRAKES}-
 

Then the control would only be sent on the switch on position if the parking brakes were off (0x0BC8 contains 0), and sent the toggle control on release only if the parking brakes are on (W0BC8 is equivalent to W0BC8!0).

John

Link to comment
Share on other sites

23 hours ago, CHpilot said:

What's  "killing" me is the starter switch in the TBM930 overhead panel. I can't find the correct control to move this button.

There doesn't seem to be any control, either internal or external, to control this at the moment. You may want to raise a new feature request with Asobo for this.

John

Link to comment
Share on other sites

23 hours ago, John Dowson said:

Toggle your switch and assign the PARKING BRAKES control to both your button press ad release. Then located those assignment lines in your FSUIPC7.ini. I have just assigned to a spare switch, and these are my lines (where '109' is my device id, and button id is 15):

To add an offset condition on 0x0BC8 (BRAKE PARKING POSITION), I would change those entries to

Then the control would only be sent on the switch on position if the parking brakes were off (0x0BC8 contains 0), and sent the toggle control on release only if the parking brakes are on (W0BC8 is equivalent to W0BC8!0).

John

THANK YOU John, the parking brake offset is working,  I also tried the battery ON/OFF and its working fine too.

5=W281C=1 PB,15,C66241,0     -{TOGGLE_MASTER_BATTERY}-
6=W281C=0 PB,14,C66241,0     -{TOGGLE_MASTER_BATTERY}-

but could I ask more about the lights offset?

I found the light offset code is 0D0C, but this code is for all lights( beacon, nav ,taxi etc..), How could I modify in the fsuipc.ini file?

14=PB,20,C66239,0     -{TOGGLE_BEACON_LIGHTS}-
15=PB,21,C66239,0     -{TOGGLE_BEACON_LIGHTS}-
16=PB,22,C66059,0     -{LANDING_LIGHTS_ON}-
17=PB,23,C66060,0     -{LANDING_LIGHTS_OFF}-
18=PB,24,C66240,0     -{TOGGLE_TAXI_LIGHTS}-
19=PB,25,C66240,0     -{TOGGLE_TAXI_LIGHTS}-
20=PB,26,C66379,0     -{TOGGLE_NAV_LIGHTS}-
21=PB,27,C66379,0     -{TOGGLE_NAV_LIGHTS}-

Brgds

KELVIN

Link to comment
Share on other sites

1 hour ago, kelvinlmc said:

I found the light offset code is 0D0C, but this code is for all lights( beacon, nav ,taxi etc..), How could I modify in the fsuipc.ini file?

Please see the Advanced User Guide as this is explained there at the bottom of page 22:

Quote

The optional mask facility is useful for testing specific bits, as in the case of the light switches in offset 0D0C or the
radio reception details in offset 3300. For example, the offset condition:
W3300&0040!0
is TRUE when the currently tuned NAV1 is for an ILS.

Please try for yourself, and if you then have any problems, post again with what you have tried.

John

Link to comment
Share on other sites

12 hours ago, John Dowson said:

Please see the Advanced User Guide as this is explained there at the bottom of page 22:

Please try for yourself, and if you then have any problems, post again with what you have tried.

John

 I read the User guide and search the post, finally the code is work on  the beacon & nav light,

but the taxi light is not working, it there something wrong with my taxi light code?

 

14=W0D0C&2=x0 PB,20,C66239,1     -{TOGGLE_BEACON_LIGHTS}-
15=W0D0C&2 UB,20,C66239,1     -{TOGGLE_BEACON_LIGHTS}-
16=PB,22,C66059,0     -{LANDING_LIGHTS_ON}-
17=PB,23,C66060,0     -{LANDING_LIGHTS_OFF}-
18=W0D0C&3=x0 PB,24,C66240,1     -{TOGGLE_TAXI_LIGHTS}-
19=W0D0C&3 UB,24,C66240,1     -{TOGGLE_TAXI_LIGHTS}-

20=W0D0C&1=x0 PB,26,C66379,1     -{TOGGLE_NAV_LIGHTS}-
21=W0D0C&1 UB,26,C66379,1     -{TOGGLE_NAV_LIGHTS}-

(besides, if I toggle the switch faster, it won't catch up the offset code and will have a wrong toggle status, is it normal? I work fine if the toggle once per second.)

Kelvin

 

Edited by kelvinlmc
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.