View Full Version : Gear lever for pmdg737ngx Sioc..?
AndyCYXU
02-08-2013, 03:52 PM
Can I get some help with this gear lever script
when i use default script it works fine for the lights but not the lever
this is info from offsets file for pmdg, default sioc script uses default offsets and they worked fine strangely enough for LIGHT INDICATORS
offset size datatype name notes
6570 3 BYTE MAIN_annunGEAR_transit[3] Boolean
6573 3 BYTE MAIN_annunGEAR_locked[3] Boolean
6576 1 BYTE MAIN_GearLever 0: UP 1: OFF 2: DOWN
I also tried this to assign as button and change parameters
i just used 69632+455=70087.. then CUSTOM control in fsuipc and assign parameters like 0, 1 and 2
similar method worked fine for all my switches like for example MAIN PANEL DU's SELECTOR etc.. but in case of the landing gear it does nothing :(
// Gear panel
#define EVT_GEAR_LEVER (THIRD_PARTY_EVENT_ID_MIN + 455)
#define EVT_GEAR_LEVER_OFF (THIRD_PARTY_EVENT_ID_MIN + 4551)
#define EVT_GEAR_LEVER_UNLOCK (THIRD_PARTY_EVENT_ID_MIN + 4552)
I will also try to use the key assignment using the pmdg's FMC.. worked very well for the dual encoders i used for NI-SET and SPD-REF, but for landing gear there is only "G" for both up and down.. not like there is shifg+g for up and "G" for down.. so i was hoping to do it with switches/sioc/fsuipc but not key press... idk.. i am lost here i thought that one would be easy...:o
or maybe can someone point me to where written script is for landing gear for pmdg737ngx
Thanks
Andy
Sammy-E
02-18-2013, 06:23 PM
Hi Andy,
As no one has replied, and I have no knowledge of SIOC maybe my answer is totally wrong, but I was browsing on the internet and found something relating to your question. Maybe it helps.
Source: some small sdk puzzle left - PMDG 737NGX - The AVSIM Community (http://forum.avsim.net/topic/365274-some-small-sdk-puzzle-left/)
..Also nr. 2 is now solved. Got a response via a pmdg ticket within 24 hours in the weekend (thanks again guys!). Don't send 1,2 or 3 as suggested by the MAIN_GearLever variable to EVT_GEAR_LEVER, but the mouse events MOUSE_FLAG_LEFTSINGLE resp. MOUSE_FLAG_RIGHTSINGLE to EVT_GEAR_LEVER and MOUSE_FLAG_LEFTSINGLE to EVT_GEAR_LEVER_OFF for gear down, up and off.HTHJohan Knol
AndyCYXU
02-18-2013, 07:33 PM
Thanks Sammy I will give it a try.
for now i got a work around using key press with G i post it here just for kicks what i did, but these MouseEvents should work much better cuz if one was to use what i did it must be done in sequence or gets messed up but i still post it just in case someone cares:
must start on ground,
so in FSUIPC when your lower micros-witch is pressed (lever down) send G do not repeat and NOTHING when relesed
when you upper micro-switch is pressed send command G do not repeat and send command shift+G when released shift+g is programed to GEAR OFF then when you lower lever (Down) G is pressed GEAR go down and so on in the circle
but yeah whatever my way is limited so thanks i will try the mouse events.
Andy
nolatron
02-19-2013, 06:19 PM
Are your gear lever switches connected to an opencockpits card or a joystick card, like a bodnar card?
AndyCYXU
02-19-2013, 06:39 PM
yes i hoked them up to oc mastercard
nolatron
02-19-2013, 07:52 PM
yes i hoked them up to oc mastercard
Oh, and how many? Two?
nolatron
02-19-2013, 08:34 PM
It looks like there's something up with the Gear level control codes. However, you can set keystrokes to the gear lever in the FMC.
PMDG SETUP > OPTIONS > Key Commands > Center FWD Panel
Set a keystroke for each Gear position.
I'd first convert the two O/C inputs to virtual joysticks and use FSUIPC to trigger the inputs.
(CHANGE DEVICE, INPUT AND OUTPUT NUMBERS ACCORDINGLY)
Var 1 Link IOCARD_SW device 1 Input 55 Type I
{
&FO_JoyStick64 = CHANGEBIT 0 v1 // toggle button 0 of joystick 64 - GEAR UP
}
Var 3 Link IOCARD_SW device 1 Input 56 Type I
{
&FO_JoyStick64 = CHANGEBIT 1 v3 // toggle button 1 of joystick 64 - GEAR DOWN
}
Var 2 name FO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4
Next I'd setup the buttons in FSUIPC.
Throw the gear level into the up position, check the 'Select for keypress" button and set these options:
- Press the key to be sent when you press this button: (use keystroke for gear up)
- Press the key to be sent when you release this button: (use the keystroke for gear off)
Throw the gear level into the down position, check the 'Select for keypress" button and set this option:
- Press the key to be sent when you press this button: (use keystroke for gear down)
And then for controlling the gear lights, we'll let the NGX to do the logic and just output the state in SIOC.
Var 0032, name gearlock_led1, Link IOCARD_OUT, Device 1, Output 15 // LED
Var 0033, name gearlock_led2, Link IOCARD_OUT, Device 1, Output 12 // LED
Var 0034, name gearlock_led3, Link IOCARD_OUT, Device 1, Output 16 // LED
Var 0035, name gearlock_1, Link FSUIPC_IN, Offset $6573, Length 1 // state
{
IF &gearlock_1 = 0
{
&gearlock_led1 = 0
}
ELSE
{
&gearlock_led1 = 1
}
}
Var 0036, name gearlock_2, Link FSUIPC_IN, Offset $6574, Length 1 // state
{
IF &gearlock_2 = 0
{
&gearlock_led2 = 0
}
ELSE
{
&gearlock_led2 = 1
}
}
Var 0037, name gearlock_3, Link FSUIPC_IN, Offset $6575, Length 1 // state
{
IF &gearlock_3 = 0
{
&gearlock_led3 = 0
}
ELSE
{
&gearlock_led3 = 1
}
}
Var 0038, name geartran_led1, Link IOCARD_OUT, Device 1, Output 13 // LED
Var 0039, name geartran_led2, Link IOCARD_OUT, Device 1, Output 11 // LED
Var 0040, name geartran_led3, Link IOCARD_OUT, Device 1, Output 14 // LED
Var 0041, name geartran_1, Link FSUIPC_IN, Offset $6570, Length 1 // state
{
IF &geartran_1 = 0
{
&geartran_led1 = 0
}
ELSE
{
&geartran_led1 = 1
}
}
Var 0042, name geartran_2, Link FSUIPC_IN, Offset $6571, Length 1 // state
{
IF &geartran_2 = 0
{
&geartran_led2 = 0
}
ELSE
{
&geartran_led2 = 1
}
}
Var 0043, name geartran_3, Link FSUIPC_IN, Offset $6572, Length 1 // state
{
IF &geartran_3 = 0
{
&geartran_led3 = 0
}
ELSE
{
&geartran_led3 = 1
}
}
Hope that helps.
AndyCYXU
02-20-2013, 09:55 PM
Next I'd setup the buttons in FSUIPC.
Throw the gear level into the up position, check the 'Select for keypress" button and set these options:
- Press the key to be sent when you press this button: (use keystroke for gear up)
- Press the key to be sent when you release this button: (use the keystroke for gear off)
Throw the gear level into the down position, check the 'Select for keypress" button and set this option:
- Press the key to be sent when you press this button: (use keystroke for gear down)
yup this is exactly what i did I just didn't explain it well :)
there is a keystoke to setup as GEAR-OFF do note however, that there is no separate keystroke for GEAR DOWN or GEAR UP (unless I am blind) but there is only one default=G so one has to be careful if you move from GEAR OFF to GEAR UP while your gear is actually UP it will just GO DOWN :roll: not good, but then i suppose once gear is in OFF position the next sequence should be GEAR DOWN so it actually works good
Andy
nolatron
02-20-2013, 11:40 PM
I thought i saw you can set three custom keystrokes in the NGX fmc options for each gear lever position (up, off, down).
AndyCYXU
02-23-2013, 06:56 PM
well i just double checked and nope, only:
<GEAR LEVER UP/DOWN <--- set to G for BOTH
<GEAR LEVER OFF <--- set to SHIFT+G
<GEAR LEVER UNLOCK <--- I don't use this for nothing set to CTRL+G just visual really you can see the red tiger move on VC :) nothing else (i suppose you can assign it to command to be sent when DOWN micro switch is released.. you see it move :) but since i don't see my VC nah... just leave it..
but anyways when set up like you explained works great just have to remember to follow the sequence and never move from OFF to UP but i suppose in real aircraft that be similar they go from TAKEOFF>>>DOWN to UP to OFF then DOWN>>>LAND ...just my uneducated guess :)
say you need to GO AROUND you have to go again from gear being DOWN>to>UP>to>OFF>to>DOWN and so on... it is actually OK to skip the OFF part as you move from UP directly to DOWN command OFF will be sent but as soon as you put it in DOWN command G will be send...
Andy
nolatron
02-23-2013, 08:50 PM
Well, that's a bummer. Too bad FSUIPC won't let you combine FS actions and keystrokes on the same button. I'll have to play around with that gear off control code too. If that would work that would fix it right up.
luisclement
09-01-2013, 05:07 PM
I had same problem and solved like this,a macro for FSUIPC, and then in the simulator select them as needed.
Here is the macro that has to be saved with name you decide and called in the ini.
[macros] 1=NGX_GEAR_up 1.1=C70087, -2147483648 2=NGX_GEAR_off 2.1=C74184, 536870912 2.2=C74184, 131072 3=NGX_GEAR_down 3.1=C70087, 536870912
In the simulator click your hardware up and select under Button and Switches:
Control when sent: NGX_GEAR_up
parameter 1
Control sent when button released: ngx_gear_down
Parameter 1
Should work, Luis