spen25 Posted April 10, 2012 Report Posted April 10, 2012 Pete, trying to change(toggle) an offset value on a pushbutton. From what I gathered looking at the manual this should work? 104=P170,14,Cx3009400,x0001 105=B66C0=0 P170,14,Cx3009400,x0000026C 106=B66C0=1 P170,14,Cx3009400,x0000026B
Pete Dowson Posted April 10, 2012 Report Posted April 10, 2012 Pete, trying to change(toggle) an offset value on a pushbutton. From what I gathered looking at the manual this should work? 104=P170,14,Cx3009400,x0001 105=B66C0=0 P170,14,Cx3009400,x0000026C 106=B66C0=1 P170,14,Cx3009400,x0000026B Well, line 104 sets the DWORD at 9400 to 1 but that is then immediately overwritten by one of 0x26C or 0x26B depending on the value of the byte in 66C0. So you might as well delete line 104. What's changing offset 66C0? I'm not sure you understand what "toggle" means -- it means changing one or more bits from 0 to 1 or 1 to 0. It isn't usually applied to values, only bits, like switches. If you want just to toggle something when a button is pushed, why not use the facilities to assign buttons in FSUIPC's button assignments tab? Why are you messing with the INI lines? Toggling is done with commands like Offset byte togglebits and so on. Regards Pete
spen25 Posted April 10, 2012 Author Report Posted April 10, 2012 Pete will remove the line 104 and test. I basically have a pushbutton that would need to cycle thru the two offsets. Don't see a button facililities in FSUIPC to cycle thru two offsets, Push it once 26C push it again 26B, but now that I think about it I'm going to need a little more code as what I'm doing is taking Goflights MCP Pro DH dial to swith between Radio and Baro, but now I realize going to also need to change the dec/inc for each using the same dial.
Pete Dowson Posted April 10, 2012 Report Posted April 10, 2012 Pete will remove the line 104 and test. I basically have a pushbutton that would need to cycle thru the two offsets. Don't see a button facililities in FSUIPC to cycle thru two offsets You are only changing one offset in any case, 9400. You are testing another offset, 66C0, but not changing it. I'll assume you really mean you want the value in the offset to swap between 026C and 026B. Do you know that offset 9400 contains one of those to start with? If so you can just toggle the changed bits -- bits 0,1 and 2 (hex C = 1 1 0 0 and B= 1 0 1 1), so an offset byte togglebits for offset 9400 with a parameter of 7 would do it (7 = 1 1 1) If you don't know the current value then you need to use a button flag, toggling the flag each time you press the button and testing that as the condition. e.g. using the flag for joystick 15 button 0 (which i assume is not a real button on your system): 104=P170,14,C1005,J15B0 ;Toggles flag J15,0105=CP(+F15,0)170,14,Cx3009400,x0000026C106=CP(-F15,0)170,14,Cx3009400,x0000026B[/CODE]RegardsPete
spen25 Posted April 10, 2012 Author Report Posted April 10, 2012 Wow, going to take me a minute to digest this, but will make it work..Thanks for the guidance!
Pete Dowson Posted April 10, 2012 Report Posted April 10, 2012 Wow, going to take me a minute to digest this, but will make it work..Thanks for the guidance! Okay. I noticed several typos in my hastily written reply. i've corrected these now, so please review it in case something came over incorrectly. Pete
spen25 Posted April 10, 2012 Author Report Posted April 10, 2012 Pete, tried as above with no joy. Can't get the button to cycle. Tried the ini entry, now Im playing with the GUI offset byte togglebit fields. Nothing seems to toggle.
Pete Dowson Posted April 11, 2012 Report Posted April 11, 2012 Pete, tried as above with no joy. Can't get the button to cycle. Tried the ini entry, now Im playing with the GUI offset byte togglebit fields. Nothing seems to toggle. Enable button logging in the Logging tab, and also add 9400 to the monitor list on the right, selecting type U32 and checking 2normal log" below. Then operate the button and show me the log. Also try 3840 in the first of the 3 lines in place of J15B0. Maybe that option isn't correct in your FSUIPC version. I'd need to cross-check. Regards Pete
spen25 Posted April 11, 2012 Author Report Posted April 11, 2012 Will Do Pete, also do changes to the .ini take effect immediately or do you have to restart FSX.
spen25 Posted April 11, 2012 Author Report Posted April 11, 2012 ********* FSUIPC4, Version 4.811 by Pete Dowson ********* FSUIPC4 Key is provided WideFS7 Key is provided Running inside FSX on Windows 7 Module base=61000000 125 System time = 11/04/2012 06:15:20 156 FLT UNC path = "\\SPENCER-FSX\spencer\Documents\Flight Simulator X Files\" 187 Trying to connect to SimConnect Acc/SP2 Oct07 ... 187 FS UNC path = "\\SPENCER-FSX\fsx\" 577 LogOptions=40000000 00000001 577 Wind smoothing fix is fully installed 577 G3D.DLL fix attempt installed ok 577 SimConnect_Open succeeded: waiting to check version okay 577 Trying to use SimConnect Acc/SP2 Oct07 2481 Running in "Microsoft Flight Simulator X", Version: 10.0.61637.0 (SimConnect: 10.0.61259.0) 2481 Initialising SimConnect data requests now 2481 FSUIPC Menu entry added 2496 \\SPENCER-FSX\fsx\FLIGHTS\OTHER\FLTSIM.FLT 2496 \\SPENCER-FSX\fsx\SimObjects\Airplanes\Aircreation_582SL\Aircreation_582SL.AIR 3526 Monitor IPC:9400 (U32) = 0 159636 \\SPENCER-FSX\fsx\SimObjects\Airplanes\iFly 737-800\iFly737_800_24k.AIR 208043 Monitor IPC:9400 (U32) = 65535 208901 Aircraft="SouthWest" 208901 System time = 11/04/2012 06:18:48, Simulator time = 09:15:23 (13:15Z) 208995 Starting everything now ... 209010 Using "C:\fsx\Modules\GFDEV.DLL", version 2.0.0.1 209010 GoFlight GFP8 detected: 2 devices 209010 GoFlight GFT8 detected: 2 devices 209010 GoFlight GFLGT detected: 1 device 209010 GoFlight GF166 detected: 2 devices 209010 GoFlight GFRP48 detected: 4 devices 209010 GoFlight GF46 detected: 1 device 209010 GoFlight GFMCPPRO detected: 1 device 209010 GoFlight GFEFIS detected: 1 device 209010 GoFlight GFWP6 detected: 1 device 209026 AES Link established 210492 Monitor IPC:9400 (U32) = 1638399 210836 Button changed: bRef=0, Joy=176, Btn=0, Pressed 210836 [buttons] 1=P176,0,CL1:R,0 210836 JoystickValues PCnum=0, dwCount=1, data[2]={000000b0 00000001} 210836 LUA: beginning "C:\fsx\Modules\gfwp6.lua" 210976 Button changed: bRef=0, Joy=176, Btn=0, Released 210976 JoystickValues PCnum=0, dwCount=1, data[2]={000000b0 00000000} 212552 Advanced Weather Interface Enabled 217871 Button changed: bRef=0, Joy=170, Btn=14, Pressed 217871 [buttons] 106=P170,14,C1005,3840 217871 FSUIPC Control Action: Ctrl=1005, Param=3840 217871 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 00244200} 218012 Button changed: bRef=0, Joy=170, Btn=14, Released 218012 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 00240200} 220632 Button changed: bRef=0, Joy=170, Btn=14, Pressed 220632 [buttons] 106=P170,14,C1005,3840 220632 FSUIPC Control Action: Ctrl=1005, Param=3840 220632 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 00244200} 220773 Button changed: bRef=0, Joy=170, Btn=14, Released 220773 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 00240200} 221553 Button changed: bRef=0, Joy=170, Btn=14, Pressed 221553 [buttons] 106=P170,14,C1005,3840 221553 FSUIPC Control Action: Ctrl=1005, Param=3840 221568 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 00244200} 221693 Button changed: bRef=0, Joy=170, Btn=14, Released 221693 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 00240200} 223565 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 40240200} 223628 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 00240200} 223659 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 40240200} 223737 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 00240200} 223830 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 40240200} 224252 Button changed: bRef=0, Joy=170, Btn=14, Pressed 224252 [buttons] 106=P170,14,C1005,3840 224252 FSUIPC Control Action: Ctrl=1005, Param=3840 224252 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 40244200} 224423 Button changed: bRef=0, Joy=170, Btn=14, Released 224423 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 40240200} 224798 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa c0240200} 224907 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 40240200} 224938 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa c0240200} 225078 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 40240200} 225110 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa c0240200} 225188 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa 40240200} 225328 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa c0240200} 225624 Button changed: bRef=0, Joy=170, Btn=14, Pressed 225624 [buttons] 106=P170,14,C1005,3840 225624 FSUIPC Control Action: Ctrl=1005, Param=3840 225624 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa c0244200} 225843 Button changed: bRef=0, Joy=170, Btn=14, Released 225843 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa c0240200} 226560 Button changed: bRef=0, Joy=170, Btn=14, Pressed 226560 [buttons] 106=P170,14,C1005,3840 226560 FSUIPC Control Action: Ctrl=1005, Param=3840 226560 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa c0244200} 226701 Button changed: bRef=0, Joy=170, Btn=14, Released 226701 JoystickValues PCnum=0, dwCount=1, data[2]={000000aa c0240200} //From the .ini// 103=P170,28,Cx03009400,x00000274 104=P174,21,Cx03009400,x0000026C 105=P174,21,Cx03009400,x0000026C 106=P170,14,C1005,3840 ;Toggles flag J15,0 107=CP(+F15,0)170,14,Cx3009400,x0000026C 108=CP(-F15,0)170,14,Cx3009400,x0000026B
Pete Dowson Posted April 11, 2012 Report Posted April 11, 2012 107=CP(+F15,0)170,14,Cx3009400,x0000026C 108=CP(-F15,0)170,14,Cx3009400,x0000026B Sorry, my fault. Typo in those two lines. The F should come before the signs, i.e. 107=CP(F+15,0)170,14,Cx3009400,x0000026C 108=CP(F-15,0)170,14,Cx3009400,x0000026B That'll teach me. Normally I refer folks to the documentation where there are correct examples of the use of these flags. I should have done that this time too instead of trying to do it for you. I'm juggling so many differnt things in the air at any one time that i make silly typing errors when trying to answer quickly. Regards Pete
spen25 Posted April 11, 2012 Author Report Posted April 11, 2012 Pete, Thank you soo much, it works!! I also found the example in the manual so now it makes a lil more sense. Your help, typos and all are most appreciated. You should do some FSUIPC youtube tutorials! I'd join your channel.
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