PDA

View Full Version : OpenCockpits ATC XPDR with PMDG 737NGX in FSX



Heron 1B
10-30-2012, 02:12 AM
Hi Guys,

Came across Mattia Lambreschi's fix (on My Cockpits) to make the OpenCockpit ATC XPDR rotary switch functional in FS2004 with PMDG 737NG but it is not compatible in FSX with the PMDG 737NGX.


I have the latest registered version of FSUIPC and the OpenCockpits SIOC and IOCModules. Also created mouse macros within FSUIPC for the keypesses so at the moment I can activate the XPDR switch using shift+X for SW+ and shift+U for SW-. The equiv keypresses in SIOC being \1X\2 for shift+X and \1U\2 for shift+U.


I have a script error when using Mattia's version which is as below here:



// *****************************************************************************
// * Config_SIOC - By Mattia Lambreschi
// *****************************************************************************
// * FileName : sioc.txt
// * Date : 03/02/2011

Var 405, name STATUS
Var 399, name TASTO, Link KEYS
Var 406, name I_R_STB, Link IOCARD_SW, Input 0
{
IF &I_R_STB = 1
{
V420 = 10
}

}
Var 408, name I_R_ALT, Link IOCARD_SW, Input 1
{
IF &I_R_ALT = 1
{
V420 = 20
}
}

Var 410, name I_R_XPN, Link IOCARD_SW, Input 2
{
IF &I_R_XPN = 1
{
V420 = 30
}
}


Var 412, name I_R_TAO, Link IOCARD_SW, Input 3
{
IF &I_R_TAO = 1
{
V420 = 40
}
}
Var 414, name I_R_TAR, Link IOCARD_SW, Input 4
{
IF &I_R_TAR = 1
{
V420 = 50
}
}
Var 0420, Link SUBRUTINE
{
IF V0405 >= V0420
{
&TASTO = 1
&TASTO = 0
V0405 = V0420
}
ELSE
{
&TASTO = 2
&TASTO = 0
V0405 = V0420
}
}


The question is, does anyone have the ATC XPDR switch functional in FSX with the PMDG 737 NGX using the OpenCockpits ATC module. Can you advise details of your FSUIPC keypresses, SIOC PMDG script with the sioc.ini settings Please.

Cheers,
Delf

smleingang
12-05-2012, 05:42 PM
Anxious to get my ATC module up and running in FSX too!!!

Cheers
Steve

nolatron
12-05-2012, 06:05 PM
I have prosim panels and what I did was use SIOC to trigger a virtual joystick button in FSUIPC. I then assigned the NGX XPNDR control code to the two virtual buttons in FSUIPC (xpndr 1 & 2) to make it toggle.

See Method 2 here for the SIOC code:

FlyNuts! - Key generation in SIOC (http://flying.staynuts.com/simulator/systems/interface/sioc-tutorials/51-keys)

I can post some of my script tonight.

smleingang
12-05-2012, 06:17 PM
WOW, Shaun! Awesome looking stuff but way over my head. Wish I knew more about FSUIPC and scripting. Thanks for the info tho!

Steve

nolatron
12-05-2012, 10:11 PM
EDIT: Dur. I'm setting here thinking you're talking about the 1/2 selector and just now realize you're talking about the rotary. One sec....

nolatron
12-05-2012, 10:22 PM
Ok, here we go.

Ok, here's my Rotary SIOC code. I only use three of the selections cause my rotary switch is kinda broken, but I added the rest for ya. Just change the Device and Input numbers to match your hardware:



Var 1 Link IOCARD_SW device 1 Input 55 Type I
{
&FO_JoyStick64 = CHANGEBIT 0 v1 // toggle button 0 of joystick 64 - STBY Mode
}

Var 3 Link IOCARD_SW device 1 Input 56 Type I
{
&FO_JoyStick64 = CHANGEBIT 1 v3 // toggle button 1 of joystick 64 - ALT RPTG Mode
}

Var 4 Link IOCARD_SW device 1 Input 57 Type I
{
&FO_JoyStick64 = CHANGEBIT 2 v4 // toggle button 2 of joystick 64- XPNDR Mode
}

Var 5 Link IOCARD_SW device 1 Input 58 Type I
{
&FO_JoyStick64 = CHANGEBIT 3 v5 // toggle button 3 of joystick 64 - TA Mode
}

Var 6 Link IOCARD_SW device 1 Input 59 Type I
{
&FO_JoyStick64 = CHANGEBIT 4 v6 // toggle button 4 of joystick 64 - TARA Mode


Var 2 name FO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4





If you haven't already, add this to your 737NGX_Options.ini file located at:

Microsoft Flight Simulator X\PMDG\PMDG 737 NGX


[SDK]
EnableDataBroadcast=1

Fire up FSX and SIOC.

In the FSUIPC buttons tabs, rotating the rotary should trigger buttons 1 to 5 on joystick 64 now. Now set the following for each of the buttons in FSUIPC in the "Control sent when button pressed" box.

Button 1 - Custom Control 70432 - Parameter 0
Button 2 - Custom Control 70432 - Parameter 1
Button 3 - Custom Control 70432 - Parameter 2
Button 4 - Custom Control 70432 - Parameter 3
Button 5 - Custom Control 70432 - Parameter 4

If all goes well, rotating your switch should now be rotating the switch in the NGX.

tiburon
04-10-2014, 06:37 AM
Nolatron,

Hi, long time ago but I'm trying to get your script to work (there's a } missing after TARA mode)
I'm trying to use this in a SIOC script for my FMC and MCP for the PMDG NGX.
I looked up the inputs in SIOC monitor, they are 0 /4 (can that be correct?), the devicenr is 11 according to SIOC.ini. The script compiled ok but nothing shows up in FSUIPC.
Not a SIOC expert at all I'm afraid.
Help would be really appreciated.