Jump to content
The simFlight Network Forums

Toggles in WideFS


Recommended Posts

I am setting up a fairly complete WideFS buttons screen. My problem is with toggles. I have things like beacon lights, strobes, no smoking, seat belts etc. set up as toggles, and they do interface correctly to FSX through FSUIPC. However, they don't seem to work as I would expect. For example, to toggle beacon lights from ON to OFF I have to press the corresponding button on the button screen two times, not once. Below is a FSUIPC log of changing the beacon lights from OFF to ON to OFF. On the WideFS buttons screen, I have to press the switch 4 times: once t turn on the FSX lights, again with no control sent to FSX but the WideFS button changing from red to green, a third time to turn off the lights and turn the button red, and a fourth time to turn the button green again. WideFS button definitions appear after the FSUIPC log.

********* FSUIPC4, Version 4.703 by Pete Dowson *********

User Name="Nelson Capes"

User Addr="nrcapes@gmail.com"

FSUIPC4 Key is provided

WideFS7 Key is provided

[Continuation log requested by user]

Running inside FSX on Windows 7 (using SimConnect Acc/SP2 Oct07)

Module base=61000000

Wind smoothing fix is fully installed

84803594 System time = 25/08/2011 15:39:42, Simulator time = 15:44:33 (20:44Z)

84803594 LogOptions changed, now 40000000 00000001

84808305 Button changed: bRef=0, Joy=64, Btn=13, Pressed

84808305 [buttons] 113=P64,13,C66239,0

84808305 FS Control Sent: Ctrl=66239, Param=0

84810333 Button changed: bRef=0, Joy=64, Btn=13, Released

84811441 Button changed: bRef=0, Joy=64, Btn=13, Pressed

84811441 [buttons] 113=P64,13,C66239,0

84811441 FS Control Sent: Ctrl=66239, Param=0

84813609 Button changed: bRef=0, Joy=64, Btn=13, Released

84823453 Sim stopped: average frame rate for last 20 secs = 37.6 fps

84829209 LogOptions changed, now 00000000 00000001

[buttonScreen]

Size=13,5

Colour4=221,250,182

Colour5=235,250,160

Colour6=238,183,172

Colour8=180,44,2

Colour7=26,122,144

Colour9=231,155,17

===========PAGE 1 SYSTEMS==========

0=7r"ENGINES"

1=T"Battery\rMaster"

2=T"Alternator\rMaster"

3=T"Avionics\rMaster"

4=T"Pitot\rHeat"

5=T"Fuel\rPump"

6=1Btlb"Engine\rAuto start"

7=1Btrb"Engine\rAuto\rShutdown"

8=T"Parking\rBrake"

9=1B"Magneto\rOFF"

10=1B"Magneto\rLeft"

11=1B"Magneto\rRight"

12=1B"Magneto\rBoth"

13=7r"Lighting"

14=T"Panel\rLights"

15=Tlbt"Beacon\rLights"

16=Tbt"Landing\rLight"

17=Tbt"Nav\rLights"

18=Trbt"Strobe\rLight"

19=T"No\rSmoking"

20=T"Seat\rBelts" "

21=T"Taxi\rLights"

22=T"Wing\rLights"

23=T"Recognition\rLights"

24=T"Logo\rLights"

25=T"Cabin\rLights"

26=7r"Gear\rFlaps\rTrim"

27=1b"Gear \rUp"

28=1b"Gear \rDown"

29=1b"Flaps\rextend"

30=1b"Flaps \rretract"

31=1b"Spoilers \rarm"

32=1b"Spoilers\rOn"

33=1b"Spoilers\rOff""

34=1b"El. Trim\rup"

35=1b"El. Trim\rDown"

36=1b"Rud. Trim\rLeft"

37=1b"Rud. Trim\rRight"

38=T"Yaw\rDamper"

39=7r"AUTOPILOT"

40=Ttbl"Auothrottle\rArm"

41=Ttb"TOGA"

42=Ttb"FD\rToggle"

43=1Btbr"AP\rMaster ON"

44=1b"AP\rHdg Hold\rOn"

45=1b"AP\rHdg Hold\rOff"

46=1b"AP\rSpd Hold\rOn"

47=1b"AP\rSpd Hold\rOff"

48=1b"AP\rAlt Hold\rOn"

49=1B"AP\rAlt Hold\rOff"

50=1B"AP\rLoc Hold"

51=1B"AP\rBC Hold"

52=7r"NAV/COM"

53=1B"Com 1\rInt\r+"

54=1b"Com 1\rDec\r-"

55=1b"Com 2\rInt\r+"

56=1b"Com 2\rDec\r-"

57=1b"Com 1\rSwap"

58=1b"Nav 1\rInt\r+"

59=1b"Nav 1\rDec\r-"

60=1b"Nav 2\rInt\r+"

61=1b"Nav 2\rDec\r-"

62=1B"Nav 1\rSwap"

63=1B"Nav 2\rSwap"

64=N

65=P

66=1B"Autobrake\rIncr"

67=1B"Autobrake\rDecr"

68=T"Antiskid\rBrake"

69=T"Anti-ice"

Link to comment
Share on other sites

you're 'doubling' a Toggle = you're toggling a toggle

beacon is defined 'Toggle Beacon' fsx control

so its a 'button'

= B

you're confusing FSX

oh dear

change T to B

That works, but then the buttons on WideFS are of course ordinary buttons rather than toggles, so they don't turn from green to red so that you know whether it toggled or not without looking at the instrument panel. What I hoped for was a true visible toggle on the buttons screen and only have to click once. Seems that it should be possible.

Thanks for the help!

Link to comment
Share on other sites

That works, but then the buttons on WideFS are of course ordinary buttons rather than toggles, so they don't turn from green to red so that you know whether it toggled or not without looking at the instrument panel. What I hoped for was a true visible toggle on the buttons screen and only have to click once. Seems that it should be possible.

Thanks for the help!

You should be able to use a toggle by directly setting the offsets for the various lights with the toggle. I have used this method in my simpit.

It will need 2 entries, one when the toggle is set to switch the light on and one for when the toggle is released to turn it off. I did it using offset 0D0C (IIRC- I'm not in my simpit at the moment), setting the bits to 1 for on and 0 for off.

This has the advantage that it always performs the correct function in the correct sense when you use it.

Regards

Den

Link to comment
Share on other sites

You should be able to use a toggle by directly setting the offsets for the various lights with the toggle. I have used this method in my simpit.

It will need 2 entries, one when the toggle is set to switch the light on and one for when the toggle is released to turn it off. I did it using offset 0D0C (IIRC- I'm not in my simpit at the moment), setting the bits to 1 for on and 0 for off.

This has the advantage that it always performs the correct function in the correct sense when you use it.

Regards

Den

Good idea, but I use FSUIPC4 with cxxxxxx numbers in the Buttons section of FSUIPC.INI. I don't know what the offsets you use are used with, but I sure am curious!

thanks!

Link to comment
Share on other sites

Just checked in my simpit.

I use Offset byte set bits( for light on) and offset bytes clear bits (for light off) in Offset 0D0C with the parameters 01(Nav light), 02(beacon), and 08(Taxi light).

For the landing light I use FS control "landing light on" when the toggle is set and "landing light off" when it is released. Similarly for the strobes I use "strobes on" and "strobes off" Using these ensures that they actions remain true to the sense meant eg if the flight has loaded with,say, strobes on and I press the button screen toggle to switch them on they just stay on rather than toggle the other way.

If you use the FSX instruction to toggle. All this does is reverse the current setting so you can have the button screen toggle turning things off instead of on!

Hope this helps

Den

Link to comment
Share on other sites

Just checked in my simpit.

I use Offset byte set bits( for light on) and offset bytes clear bits (for light off) in Offset 0D0C with the parameters 01(Nav light), 02(beacon), and 08(Taxi light).

For the landing light I use FS control "landing light on" when the toggle is set and "landing light off" when it is released. Similarly for the strobes I use "strobes on" and "strobes off" Using these ensures that they actions remain true to the sense meant eg if the flight has loaded with,say, strobes on and I press the button screen toggle to switch them on they just stay on rather than toggle the other way.

If you use the FSX instruction to toggle. All this does is reverse the current setting so you can have the button screen toggle turning things off instead of on!

Hope this helps

Den

Thanks! Are those offsets into FSUIPC and how do you know what they are?

Link to comment
Share on other sites

Yes they are FSUIPC offsets, they are listed in the "FSUIPC4 Offsets Status" document which comes as part of the SDK- available from PD's page here: -

http://www.schiratti.com/dowson.html

It lists all the offstes available, I used quite a few when setting up the button screen touchscreen my pit- much better than using a mouse/keyboard. Program them in through the button page in FSUIPC.

Den

Link to comment
Share on other sites

Yes they are FSUIPC offsets, they are listed in the "FSUIPC4 Offsets Status" document which comes as part of the SDK- available from PD's page here: -

http://www.schiratti.com/dowson.html

It lists all the offstes available, I used quite a few when setting up the button screen touchscreen my pit- much better than using a mouse/keyboard. Program them in through the button page in FSUIPC.

Den

Sorry to be so dense. I have the SDK now and the list of offsets in the programmer's guide. Do you mean that there should be 2 entries in the WideFS.cfg file for each light, AND 2 entries in the FSUIPC.INI file for each light, with one FSUIPC.INI having the offset byte setbits with parameters for each light and one having the offset bytes clrbits? So, for example, the FSUIPC.INI entries to turn on and off the beacon light would be:

100=P64,0,Cx050001DC,02

101=P64,1,Cx090001DC,02

and the corresponding WideFS entries would be:

00=B"Beacon lights\rON"

01=B"Beacon lights\rOFF"

Link to comment
Share on other sites

Sorry to be so dense. I have the SDK now and the list of offsets in the programmer's guide. Do you mean that there should be 2 entries in the WideFS.cfg file for each light, AND 2 entries in the FSUIPC.INI file for each light, with one FSUIPC.INI having the offset byte setbits with parameters for each light and one having the offset bytes clrbits? So, for example, the FSUIPC.INI entries to turn on and off the beacon light would be:

100=P64,0,Cx050001DC,02

101=P64,1,Cx090001DC,02

and the corresponding WideFS entries would be:

00=B"Beacon lights\rON"

01=B"Beacon lights\rOFF"

No. Use one button, defined as a Toggle, but program both the "on" (press) and "off" (release) actions.

So, assuming you must have meant offset 0D0C not 01DC (the latter not being anything at all related to lights):

100=P64,0,Cx05000D0C,02

101=U64,1,Cx09000D0C,02

though you really would find it easier to do this in FSUIPC's assignments screen rather than editing the INI file.

The WideClient INI entry would simply be:

00=T"Beacon lights"

Once synchronized (by using it once) it will show RED for on, GREEN for off. It won't necessarily start off showing correctly because it isn't actually reading the status/offset.

Regards

Pete

Link to comment
Share on other sites

No. Use one button, defined as a Toggle, but program both the "on" (press) and "off" (release) actions.

So, assuming you must have meant offset 0D0C not 01DC (the latter not being anything at all related to lights):

100=P64,0,Cx05000D0C,02

101=U64,1,Cx09000D0C,02

though you really would find it easier to do this in FSUIPC's assignments screen rather than editing the INI file.

The WideClient INI entry would simply be:

00=T"Beacon lights"

Once synchronized (by using it once) it will show RED for on, GREEN for off. It won't necessarily start off showing correctly because it isn't actually reading the status/offset.

Regards

Pete

Thanks, Pete! I wasn't aware that one could use FSUIPC's assignments screen for programming logical buttons - I thought you had to physically press a button to assign it to something. Anyway, I already have about 48 logical buttons assigned in FSUIPC.INI that correlate with WideClient.

Link to comment
Share on other sites

No. Use one button, defined as a Toggle, but program both the "on" (press) and "off" (release) actions.

So, assuming you must have meant offset 0D0C not 01DC (the latter not being anything at all related to lights):

100=P64,0,Cx05000D0C,02

101=U64,1,Cx09000D0C,02

though you really would find it easier to do this in FSUIPC's assignments screen rather than editing the INI file.

The WideClient INI entry would simply be:

00=T"Beacon lights"

Once synchronized (by using it once) it will show RED for on, GREEN for off. It won't necessarily start off showing correctly because it isn't actually reading the status/offset.

Regards

Pete

OK, I go into FSUIPC from FSX with WideClient up, select Buttons and Switches, Reload all buttons, press the WideClient toggle button, assign Offset Bytes Setbits to 0D0C with parameter 2. That does set the beacon switch on in FSX. But how to I assign the same Wideclient toggle button to turn the beacon switch off? Pressing the WideClient button again just retains the first assigment. Again, sorry if this is in the manual somewhere.

Link to comment
Share on other sites

Thanks, Pete! I wasn't aware that one could use FSUIPC's assignments screen for programming logical buttons - I thought you had to physically press a button to assign it to something.

No, all the "virtual buttons" are seen in the dialogue too.

OK, I go into FSUIPC from FSX with WideClient up, select Buttons and Switches, Reload all buttons, press the WideClient toggle button, assign Offset Bytes Setbits to 0D0C with parameter 2. That does set the beacon switch on in FSX. But how to I assign the same Wideclient toggle button to turn the beacon switch off? Pressing the WideClient button again just retains the first assigment. Again, sorry if this is in the manual somewhere.

Well, it isn't only in the manual, it is on the screen in front of you too. There are two places to get the assignment dropdown and make your assignments, one for "Press" and the other, just below, for "Release". I did tell you this earlier. "On" for a Toggle is the same as pressing a button, "off" is the same as releasing it. FSUIPC has always offered programming capability for both events. I'm surprised you've never noticed.

Perhaps what is confusing you is that the dialogue only recognises the "on" or "press" event to display the button. That's to avoid a double call and problems with some rotary types. But you can always (always) program both press/on and release/off when the button is shown.

Regards

Pete

Link to comment
Share on other sites

No, all the "virtual buttons" are seen in the dialogue too.

Well, it isn't only in the manual, it is on the screen in front of you too. There are two places to get the assignment dropdown and make your assignments, one for "Press" and the other, just below, for "Release". I did tell you this earlier. "On" for a Toggle is the same as pressing a button, "off" is the same as releasing it. FSUIPC has always offered programming capability for both events. I'm surprised you've never noticed.

Perhaps what is confusing you is that the dialogue only recognises the "on" or "press" event to display the button. That's to avoid a double call and problems with some rotary types. But you can always (always) program both press/on and release/off when the button is shown.

Regards

Pete

I understand now. But why is only a "P" entry needed for each light? How does this work without a "U" entry to release the toggle? Below are the lines from INI. The lights all work. These were put in with the FSUIPC assignments screen. If I had entered them by editing INI, I would have put in a "P" and a "U' entry for each light. So I am still confused.

112=P64,12,Cx05000D0C,x20 ;panel lights

113=P64,13,Cx05000D0C,x02 ;beacon lights

114=P64,14,Cx05000D0C,x04 ;landing light

115=P64,15,Cx05000D0C,x00 ;nav lights

116=P64,16,Cx05000D0C,x10 ;strobe lights

Link to comment
Share on other sites

I understand now. But why is only a "P" entry needed for each light? How does this work without a "U" entry to release the toggle?

If you assign to a Toggle control (toggle bits or one of the built-in FS toggle controls) then each alternate press of a button will toggle the switch, so it will turn the lights on and off on alternate presses. but you didn't want that, you wanted the display to show read when the light was switched on. That's why you changed to using the offsets -- because, generally, the FS controls only give toggling.

So in the original example:

100=P64,0,Cx05000D0C,02

101=U64,1,Cx09000D0C,02

x05000D0C is a SET bits control, and sets bit 1 (worth 2), whilst x09000D0C is a CLEAR bits control, which clears the same but. Thus on/press switches the bit on, off/release switches it off.

Below are the lines from INI. The lights all work. These were put in with the FSUIPC assignments screen. If I had entered them by editing INI, I would have put in a "P" and a "U' entry for each light. So I am still confused.

Well those lines cannot be the whole story, as the x05000D0C can only SET bits, not clear them. So those will all switch lights on, but never turn them off.

Additionally, this one:

115=P64,15,Cx05000D0C,x00 ;nav lights

does nothing at all because there are no bits in "00" to set. You need 01 for the NAV lights.

Pete

Link to comment
Share on other sites

If you assign to a Toggle control (toggle bits or one of the built-in FS toggle controls) then each alternate press of a button will toggle the switch, so it will turn the lights on and off on alternate presses. but you didn't want that, you wanted the display to show read when the light was switched on. That's why you changed to using the offsets -- because, generally, the FS controls only give toggling.

So in the original example:

100=P64,0,Cx05000D0C,02

101=U64,1,Cx09000D0C,02

x05000D0C is a SET bits control, and sets bit 1 (worth 2), whilst x09000D0C is a CLEAR bits control, which clears the same but. Thus on/press switches the bit on, off/release switches it off.

Well those lines cannot be the whole story, as the x05000D0C can only SET bits, not clear them. So those will all switch lights on, but never turn them off.

Additionally, this one:

115=P64,15,Cx05000D0C,x00 ;nav lights

does nothing at all because there are no bits in "00" to set. You need 01 for the NAV lights.

Pete

You are correct (sigh!) The lines for turning off the switches are at the end of the [buttons] section. I expected them to be right next to the lines for turning on the switches. I sure could have saved hours of work if I had used the FSUIPC assignments screen instead of editing INI. Well, live and learn!

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.