sunmartial

SIOC code for FSUIPC virtual joystick button - SIOC gurus please!

Recommended Posts

Hi Guys

I would like to be able to "activate" by R/T and I/C buttons on the audio control panel of my Opencockpits pedestal, so that I can assign key presses in FSUIPC to activate PTT's in Teamspeak and vPilot.

I am using Open Cockpits modules throughout except for the MCP and EFIS panels, which are from cpFlight. Below is my pedestal SIOC script. I have added a few lines right at the end of the script, under "Trial code for PTT's", which is my attempt at activating the captain's R/T button on the ACP. I have used the code posted by others on various forums as a starting point.

Trouble is, I am not a programmer, and I'm really just working blind with this!

Here's my setup.

Visual-1 PC: is "flying" PC with Prosim server on it. I have also hooked up the pedestal to this PC using SIOC.
Other PC's: 4 in total, all hooked up with FSUIPC / WideFS, and various modules using SIOC.

Ideally, I would like the code to work no matter which PC I connect the pedestal to (using WideFS), but even if I can get it working just when connected to Visual-1 PC, then I'll be very happy indeed!

So, if any SIOC / FSUIPC guru can offer the correct lines of code for me to insert into my script, I would be eternally grateful!

// *****************************************************************************
// * Config_SIOC ver 5.0   -     By Manolo V�lez    -    www.opencockpits.com
// *****************************************************************************
// * FileName : pedestalB737_PM.txt, Ver.1.0
// * PMagenta & FSX Pedestal script
// * Date : 22/06/2014


var 0,value 0
{
  &ent_com1 = 118
  &dec_com1 = 0
  &act_com1 = 118000
  &enc_com1 = 1
  &ent_com2 = 118
  &dec_com2 = 0
  &act_com2 = 118000
  &enc_com2 = 1
  &ent_nav1 = 108
  &dec_nav1 = 0
  &act_nav1 = 10800
  &enc_nav1 = 1
  &ent_nav2 = 108
  &dec_nav2 = 0
  &act_nav2 = 10800
  &enc_nav2 = 1
  &ent_adf1 = 10
  &dec_adf1 = 0
  &act_adf1 = 1000
  &enc_adf1 = 1
  &danta_adf1 = 1
  &dants_adf1 = 1
  &dadfa_adf1 = 0
  &dadfs_adf1 = 0
  &ent_adf2 = 10
  &dec_adf2 = 0
  &act_adf2 = 1000
  &enc_adf2 = 1
  &danta_adf2 = 1
  &dants_adf2 = 1
  &dadfa_adf2 = 0
  &dadfs_adf2 = 0
// ATC
  &timerup = 0
  &D_ACTIVE = 1200
  &lastst = 0
  &DIG_POS_STATUS = 5
  &DIS_ATC = 1
  &DIS_1 = 1
  &DIS_2 = 0
  &timeratc = 0
  &timeratc = TIMER 1,0,35
}


// ************************************************************
// ******************************** COM1 **********************
// ************************************************************


var 2300, name enc_com1_pro, STATIC
{
 IF &enc_com1_pro = -1
 {
  &enc_com1 = 0
 }
 ELSE
 {
  &enc_com1 = 1
 }
}


var 2308, name enc_com2_pro, STATIC
{
 IF &enc_com2_pro = -1
 {
  &enc_com2 = 0
 }
 ELSE
 {
  &enc_com2 = 1
 }
}


var 2316, name enc_nav1_pro, STATIC
{
 IF &enc_nav1_pro = -1
 {
  &enc_nav1 = 0
 }
 ELSE
 {
  &enc_nav1 = 1
 }
}


var 2320, name enc_nav2_PRO, STATIC
{
 IF &enc_nav2_pro = -1
 {
  &enc_nav2 = 0
 }
 ELSE
 {
  &enc_nav2 = 1
 }
}


var 2324, name enc_adf1_PRO, STATIC
{
 IF &enc_adf1_PRO = -1
 {
  &enc_adf1 = 0
 }
 ELSE
 {
  &enc_adf1 = 1
 }
}


var 2336, name enc_adf2_PRO, STATIC
{
 IF &enc_adf2_PRO = -1
 {
  &enc_adf2 = 0
 }
 ELSE
 {
  &enc_adf2 = 1
 }
}



var 2, name enc_com1
{
  if &enc_com1 = 1
  {
   &io_pt_com1 = 1
   &io_pt2_com1 = 1
   call &sub_d_com1
   &id2_com1 = &act_com1
  }
  else
  {
   &io_pt_com1 = 0
   &io_pt2_com1 = 0
   &id_com1 = -999999
   &id2_com1 = -999999
  }
}

var 4, name ent_com1

var 6, name dec_com1

var 8, name ie_dec_com1, link IOCARD_ENCODER, input 0, type 2, aceleration 1, device 20
{
  if &enc_com1 = 1
  {
    l0 = &ie_dec_com1 * 5
    l1 = &dec_com1 + l0
    if l1 < 0
    {
      l1 = 975
    }
    if l1 > 975
    {
      l1 = 0
    }
    &dec_com1 = l1
    call &sub_d_com1
  }
}

var 10, name ie_ent_com1, link IOCARD_ENCODER, input 2, type 2, aceleration 1, device 20
{
  if &enc_com1 = 1
  {
    l0 = &ie_ent_com1 * -1
    &ent_com1 = rotate 118,135,l0
    call &sub_d_com1
  }
}

var 12, name id_com1,link IOCARD_DISPLAY, digit 6, numbers 6, device 20

var 14, name sub_d_com1, link SUBRUTINE
{
  l0 = &ent_com1 * 1000
  &id_com1 = l0 + &dec_com1
}

var 16, name io_pt_com1, link IOCARD_OUT, output 11, device 20

var 18, name ii_sw_com1, link IOCARD_SW, input 5, device 20
{
  if &ii_sw_com1 = 1
  {
    if &enc_com1 = 1
    {
      l0 = &ent_com1 * 1000
      l0 = l0 + &dec_com1
      l1 = div &act_com1 1000
      l2 = mod &act_com1 1000
      &act_com1 = l0
      &ent_com1 = l1
      &dec_com1 = l2
      call &sub_d_com1
      &id2_com1 = &act_com1
    }
  }
}

var 20, name act_com1

var 22, name id2_com1,link IOCARD_DISPLAY, digit 0, numbers 6, device 20
{
  if &id2_com1 > 0
  {
    &xp_com1 = div &id2_com1 10
  }
}

var 24, name io_pt2_com1, link IOCARD_OUT, output 11, device 20

var 26, name xp_com1, value 11800
{
  l0 = &xp_com1 - 10000
  &fcom1 = tobcd l0
}

// ************************************************************
// ******************************** COM2 **********************
// ************************************************************


var 102, name enc_com2
{
  if &enc_com2 = 1
  {
   &io_pt_com2 = 1
   &io_pt2_com2 = 1
   call &sub_d_com2
   &id2_com2 = &act_com2
  }
  else
  {
   &io_pt_com2 = 0
   &io_pt2_com2 = 0
   &id_com2 = -999999
   &id2_com2 = -999999
  }
}

var 104, name ent_com2

var 106, name dec_com2

var 108, name ie_dec_com2, link IOCARD_ENCODER, input 72, type 2, aceleration 1, device 20
{
  if &enc_com2 = 1
  {
    l0 = &ie_dec_com2 * 5
    l1 = &dec_com2 + l0
    if l1 < 0
    {
      l1 = 975
    }
    if l1 > 975
    {
      l1 = 0
    }
    &dec_com2 = l1
    call &sub_d_com2
  }
}

var 110, name ie_ent_com2, link IOCARD_ENCODER, input 74, type 2, aceleration 1, device 20
{
  if &enc_com2 = 1
  {
    l0 = &ie_ent_com2 * -1
    &ent_com2 = rotate 118,135,l0
    call &sub_d_com2
  }
}

var 112, name id_com2,link IOCARD_DISPLAY, digit 70, numbers 6, device 20

var 114, name sub_d_com2, link SUBRUTINE
{
  l0 = &ent_com2 * 1000
  &id_com2 = l0 + &dec_com2
}

var 116, name io_pt_com2, link IOCARD_OUT, output 75, device 20

var 118, name ii_sw_com2, link IOCARD_SW, input 77, device 20
{
  if &ii_sw_com2 = 1
  {
    if &enc_com2 = 1
    {
      l0 = &ent_com2 * 1000
      l0 = l0 + &dec_com2
      l1 = div &act_com2 1000
      l2 = mod &act_com2 1000
      &act_com2 = l0
      &ent_com2 = l1
      &dec_com2 = l2
      call &sub_d_com2
      &id2_com2 = &act_com2
    }
  }
}

var 120, name act_com2

var 122, name id2_com2,link IOCARD_DISPLAY, digit 64, numbers 6, device 20
{
  if &id2_com2 > 0
  {
    &xp_com2 = div &id2_com2 10
  }
}

var 124, name io_pt2_com2, link IOCARD_OUT, output 75, device 20

var 126, name xp_com2, value 11800
{
  l0 = &xp_com2 - 10000
  &fcom2 = tobcd l0
}



// *********************************************
// *******************  NAV1 *******************
// *********************************************


var 54, name enc_nav1
{
  if &enc_nav1 = 1
  {
   &io_pt_nav1 = 1
   &io_pt2_nav1 = 1
   call &sub_d_nav1
   &id2_nav1 = &act_nav1
  }
  else
  {
   &io_pt_nav1 = 0
   &io_pt2_nav1 = 0
   &id_nav1 = -999999
   &id2_nav1 = -999999
  }
}

var 56, name ent_nav1

var 58, name dec_nav1

var 60, name ie_dec_nav1, link IOCARD_ENCODER, input 9, type 2, aceleration 1, device 20
{
  if &enc_nav1 = 1
  {
    l0 = &ie_dec_nav1 * 25
    l1 = &dec_nav1 + l0
    if l1 < 0
    {
      l1 = 975
    }
    if l1 > 975
    {
      l1 = 0
    }
    &dec_nav1 = l1
    call &sub_d_nav1
  }
}

var 62, name ie_ent_nav1, link IOCARD_ENCODER, input 11, type 2, aceleration 1, device 20
{
  if &enc_nav1 = 1
  {
    l0 = &ie_ent_nav1 * -1
    &ent_nav1 = rotate 108,117,l0
    call &sub_d_nav1
  }
}

var 64, name id_nav1,link IOCARD_DISPLAY, digit 21, numbers 5, device 20

var 66, name sub_d_nav1, link SUBRUTINE
{
  l0 = &ent_nav1 * 100
  l1 = div &dec_nav1 10
  &id_nav1 = l0 + l1
}

var 68, name io_pt_nav1, link IOCARD_OUT, output 12, device 20

var 70, name ii_sw_nav1, link IOCARD_SW, input 14, device 20
{
  if &ii_sw_nav1 = 1
  {
    if &enc_nav1 = 1
    {
      l0 = &ent_nav1 * 100
      l1 = div &dec_nav1 10
      l0 = l0 + l1
      l1 = div &act_nav1 100
      l2 = mod &act_nav1 100
      &act_nav1 = l0
      &ent_nav1 = l1
      l0 = mod l2 10
      l2 = l2 * 10
      if l0 > 0
      {
        l2 = l2 + 5
      }
      &dec_nav1 = l2
      call &sub_d_nav1
      &id2_nav1 = &act_nav1
    }
  }
}
var 72, name act_nav1

var 74, name id2_nav1,link IOCARD_DISPLAY, digit 16, numbers 5, device 20
{
  if &id2_nav1 > 0
  {
    &xp_nav1 = &id2_nav1
  }
}

var 76, name io_pt2_nav1, link IOCARD_OUT, output 12, device 20

var 78, name xp_nav1, value 10800
{
  l0 = &xp_nav1 - 10000
  &fnav1 = tobcd l0
}


// *********************************************
// *******************  NAV2 *******************
// *********************************************


var 154, name enc_nav2
{
  if &enc_nav2 = 1
  {
   &io_pt_nav2 = 1
   &io_pt2_nav2 = 1
   call &sub_d_nav2
   &id2_nav2 = &act_nav2
  }
  else
  {
   &io_pt_nav2 = 0
   &io_pt2_nav2 = 0
   &id_nav2 = -999999
   &id2_nav2 = -999999
  }
}

var 156, name ent_nav2

var 158, name dec_nav2

var 160, name ie_dec_nav2, link IOCARD_ENCODER, input 81, type 2, aceleration 1, device 20
{
  if &enc_nav2 = 1
  {
    l0 = &ie_dec_nav2 * 25
    l1 = &dec_nav2 + l0
    if l1 < 0
    {
      l1 = 975
    }
    if l1 > 975
    {
      l1 = 0
    }
    &dec_nav2 = l1
    call &sub_d_nav2
  }
}

var 162, name ie_ent_nav2, link IOCARD_ENCODER, input 83, type 2, aceleration 1, device 20
{
  if &enc_nav2 = 1
  {
    l0 = &ie_ent_nav2 * -1
    &ent_nav2 = rotate 108,117,l0
    call &sub_d_nav2
  }
}

var 164, name id_nav2,link IOCARD_DISPLAY, digit 85, numbers 5, device 20

var 166, name sub_d_nav2, link SUBRUTINE
{
  l0 = &ent_nav2 * 100
  l1 = div &dec_nav2 10
  &id_nav2 = l0 + l1
}

var 168, name io_pt_nav2, link IOCARD_OUT, output 76, device 20

var 170, name ii_sw_nav2, link IOCARD_SW, input 86, device 20
{
  if &ii_sw_nav2 = 1
  {
    if &enc_nav2 = 1
    {
      l0 = &ent_nav2 * 100
      l1 = div &dec_nav2 10
      l0 = l0 + l1
      l1 = div &act_nav2 100
      l2 = mod &act_nav2 100
      &act_nav2 = l0
      &ent_nav2 = l1
      l0 = mod l2 10
      l2 = l2 * 10
      if l0 > 0
      {
        l2 = l2 + 5
      }
      &dec_nav2 = l2
      call &sub_d_nav2
      &id2_nav2 = &act_nav2
    }
  }
}
var 172, name act_nav2

var 174, name id2_nav2,link IOCARD_DISPLAY, digit 80, numbers 5, device 20
{
  if &id2_nav2 > 0
  {
    &xp_nav2 = &id2_nav2
  }
}

var 176, name io_pt2_nav2, link IOCARD_OUT, output 76, device 20

var 178, name xp_nav2, value 10800
{
  l0 = &xp_nav2 - 10000
  &fnav2 = tobcd l0
}



// *********************************************
// *******************  ADF1 *******************
// *********************************************


var 218, name enc_adf1
{
  if &enc_adf1 = 1
  {
   &io_pt_adf1 = 1
   call &sub_d_adf1
   &id2_adf1 = &act_adf1
   &o_adf1 = 1
    if &ant_adf1 = 1
    {
	&danta_adf1 = 0
	&dants_adf1 = 0
	&dadfa_adf1 = 1
	&dadfs_adf1 = 1
    }
    else
    {
	&danta_adf1 = 1
	&dants_adf1 = 1
	&dadfa_adf1 = 0
	&dadfs_adf1 = 0

    }



  }
  else
  {
   &io_pt_adf1 = 0
   &id_adf1 = -999999
   &id2_adf1 = -999999
   &o_adf1 = 0
	&danta_adf1 = 1
	&dants_adf1 = 1
	&dadfa_adf1 = 1
	&dadfs_adf1 = 1
  }
}

var 220, name ent_adf1

var 222, name dec_adf1

var 224, name ie_dec_adf1, link IOCARD_ENCODER, input 18, type 2, aceleration 5, device 20
{
  if &enc_adf1 = 1
  {
    l0 = &ie_dec_adf1 * 1
    l1 = &dec_adf1 + l0
    if l1 < 0
    {
      l1 = 99
    }
    if l1 > 99
    {
      l1 = 0
    }
    &dec_adf1 = l1
    call &sub_d_adf1
  }
}

var 226, name ie_ent_adf1, link IOCARD_ENCODER, input 20, type 2, aceleration 4, device 20
{
  if &enc_adf1 = 1
  {
    l0 = &ie_ent_adf1 * -1
    l1 = &ent_adf1 + l0
    if l1 < 10
    {
      l1 = 179
    }
    if l1 > 179
    {
      l1 = 10
    }
    &ent_adf1 = l1
    call &sub_d_adf1
  }
}

var 228, name id_adf1,link IOCARD_DISPLAY, digit 37, numbers 5, device 20

var 230, name sub_d_adf1, link SUBRUTINE
{
  l0 = &ent_adf1 * 100
  l1 = &dec_adf1
  &id_adf1 = l0 + l1
}


var 234, name ii_sw_adf1, link IOCARD_SW, input 23,device 20
{
  if &ii_sw_adf1 = 1
  {
    if &enc_adf1 = 1
    {
      l0 = &ent_adf1 * 100
      l1 = &dec_adf1
      l0 = l0 + l1
      l1 = div &act_adf1 100
      l2 = mod &act_adf1 100
      &act_adf1 = l0
      &ent_adf1 = l1
      &dec_adf1 = l2
      call &sub_d_adf1
      &id2_adf1 = &act_adf1
    }
  }
}

var 236, name act_adf1

var 238, name id2_adf1,link IOCARD_DISPLAY, digit 32, numbers 5, device 20
{
  if &id2_adf1 > 0
  {

    &xp_adf1 = &id2_adf1
  }
}

var 240, name io_pt_adf1, link IOCARD_OUT, output 13, device 20

Var 242, name o_adf1


var 254, name xp_adf1
{
  l0 = div &xp_adf1 10000
  l1 = l0 * 10000
  l2 = &xp_adf1 - l1
  l2 = div l2 10
  &fadf1A = tobcd l2
  l0 = l0 * 100
  l1 = div &xp_adf1 10
  l1 = l1 * 10
  l2 = &xp_adf1 - l1
  l2 = l2 + l0
  &fadf1B = tobcd l2
}

var 256, name ant_adf1, link IOCARD_SW, input 22, device 20
{
  if &enc_adf1 = 1
  {
    if &ant_adf1 = 1
    {
	&danta_adf1 = 0
	&dants_adf1 = 0
	&dadfa_adf1 = 1
	&dadfs_adf1 = 1
    }
    else
    {
	&danta_adf1 = 1
	&dants_adf1 = 1
	&dadfa_adf1 = 0
	&dadfs_adf1 = 0

    }
  }
}


var 258, name danta_adf1, link IOCARD_DISPLAY, digit 43, numbers 1, device 20

var 260, name dants_adf1, link IOCARD_DISPLAY, digit 44, numbers 1, device 20

var 262, name dadfa_adf1, link IOCARD_DISPLAY, digit 42, numbers 1, device 20

var 264, name dadfs_adf1, link IOCARD_DISPLAY, digit 45, numbers 1, device 20

Var 266, name S_ADF1TONE, Link IOCARD_SW, Input 24, device 20
{
  &toneadf1 = CHANGEBITN 0 &S_ADF1TONE
}


// *********************************************
// *******************  ADF2 *******************
// *********************************************


var 318, name enc_adf2
{
  if &enc_adf2 = 1
  {
   &io_pt_adf2 = 1
   call &sub_d_adf2
   &id2_adf2 = &act_adf2
   &o_adf2 = 1

  if &ant_adf2 = 1
  {
	&danta_adf2 = 0
	&dants_adf2 = 0
	&dadfa_adf2 = 1
	&dadfs_adf2 = 1
  }
  else
  {
	&danta_adf2 = 1
	&dants_adf2 = 1
	&dadfa_adf2 = 0
	&dadfs_adf2 = 0

  }

  }
  else
  {
   &io_pt_adf2 = 0
   &id_adf2 = -999999
   &id2_adf2 = -999999
   &o_adf2 = 0
	&danta_adf2 = 1
	&dants_adf2 = 1
	&dadfa_adf2 = 1
	&dadfs_adf2 = 1
  }
}

var 320, name ent_adf2

var 322, name dec_adf2

var 324, name ie_dec_adf2, link IOCARD_ENCODER, input 90, type 2, aceleration 5, device 20
{
  if &enc_adf2 = 1
  {
    l0 = &ie_dec_adf2 * 1
    l1 = &dec_adf2 + l0
    if l1 < 0
    {
      l1 = 99
    }
    if l1 > 99
    {
      l1 = 0
    }
    &dec_adf2 = l1
    call &sub_d_adf2
  }
}

var 326, name ie_ent_adf2, link IOCARD_ENCODER, input 92, type 2, aceleration 4, device 20
{
  if &enc_adf2 = 1
  {
    l0 = &ie_ent_adf2 * -1
    l1 = &ent_adf2 + l0
    if l1 < 10
    {
      l1 = 179
    }
    if l1 > 179
    {
      l1 = 10
    }
    &ent_adf2 = l1
    call &sub_d_adf2
  }
}

var 328, name id_adf2,link IOCARD_DISPLAY, digit 101, numbers 5, device 20

var 330, name sub_d_adf2, link SUBRUTINE
{
  l0 = &ent_adf2 * 100
  l1 = &dec_adf2
  &id_adf2 = l0 + l1
}


var 334, name ii_sw_adf2, link IOCARD_SW, input 95,device 20
{
  if &ii_sw_adf2 = 1
  {
    if &enc_adf2 = 1
    {
      l0 = &ent_adf2 * 100
      l1 = &dec_adf2
      l0 = l0 + l1
      l1 = div &act_adf2 100
      l2 = mod &act_adf2 100
      &act_adf2 = l0
      &ent_adf2 = l1
      &dec_adf2 = l2
      call &sub_d_adf2
      &id2_adf2 = &act_adf2
    }
  }
}

var 336, name act_adf2

var 338, name id2_adf2,link IOCARD_DISPLAY, digit 96, numbers 5, device 20
{
  if &id2_adf2 > 0
  {

    &xp_adf2 = &id2_adf2
  }
}

var 340, name io_pt_adf2, link IOCARD_OUT, output 77, device 20

Var 342, name o_adf2


var 354, name xp_adf2
{
  l0 = div &xp_adf2 10000
  l1 = l0 * 10000
  l2 = &xp_adf2 - l1
  l2 = div l2 10
  &fadf2A = tobcd l2
  l0 = l0 * 100
  l1 = div &xp_adf2 10
  l1 = l1 * 10
  l2 = &xp_adf2 - l1
  l2 = l2 + l0
  &fadf2B = tobcd l2
}

var 356, name ant_adf2, link IOCARD_SW, input 94, device 20
{
  if &enc_adf2 = 1
  {
  if &ant_adf2 = 1
  {
	&danta_adf2 = 0
	&dants_adf2 = 0
	&dadfa_adf2 = 1
	&dadfs_adf2 = 1
  }
  else
  {
	&danta_adf2 = 1
	&dants_adf2 = 1
	&dadfa_adf2 = 0
	&dadfs_adf2 = 0

  }
  }
}


var 358, name danta_adf2, link IOCARD_DISPLAY, digit 107, numbers 1, device 20

var 360, name dants_adf2, link IOCARD_DISPLAY, digit 108, numbers 1, device 20

var 362, name dadfa_adf2, link IOCARD_DISPLAY, digit 106, numbers 1, device 20

var 364, name dadfs_adf2, link IOCARD_DISPLAY, digit 109, numbers 1, device 20

Var 366, name S_ADF2TONE, Link IOCARD_SW, Input 96, device 20
{
  &toneadf2 = CHANGEBITN 0 &S_ADF2TONE
}

// *********************************************
// *******************  ATC ********************
// *********************************************

Var 400, name DIG_POS_STATUS
{
  &finatc = 0
  IF &DIG_POS_STATUS = 5
  {
    &timerup = 0
    CALL &DIGITS2_SUB
  }
  else
  {
    &timerup = 1
    CALL &DIGITS2_SUB
  }
}

Var 402, name DIG_1_SUB, Value 0
{
  CALL &DIGITS_SUB
}

Var 404, name DIG_2_SUB, Value 0
{
  CALL &DIGITS_SUB
}

Var 406, name DIG_3_SUB, Value 2
{
  CALL &DIGITS_SUB
}

Var 408, name DIG_4_SUB, Value 1
{
  CALL &DIGITS_SUB
}

Var 410, name D_ACTIVE, Link IOCARD_DISPLAY, device 20, Digit 90, Numbers 4

Var 412, name D_FAIL, Link IOCARD_DISPLAY, device 20, Digit 94, Numbers 1

Var 416, name DIS_ATC, Link IOCARD_OUT, device 20, Output 99

Var 418, name DIS_1, Link IOCARD_OUT, device 20, Output 100

Var 420, name DIS_2, Link IOCARD_OUT, device 20, Output 101

Var 422, name LED_FAIL, Link IOCARD_OUT, device 20, Output 98

Var 424, name E_LEFT, Link IOCARD_ENCODER, device 20, Input 113, Aceleration 0, Type 2
{
 IF &enc_atc = 1
 {
  L0 = &E_LEFT * 1
  &DIG_POS_STATUS = ROTATE 1 ,5 ,L0
 }
}

Var 426, name E_RIGHT, Link IOCARD_ENCODER, device 20, Input 115, Aceleration 1, Type 2
{
 IF &enc_atc = 1
 {
  IF &DIG_POS_STATUS = 1
  {
   L0 = &E_RIGHT * -1
   &DIG_1_SUB = ROTATE 0 ,7 ,L0
  }
  IF &DIG_POS_STATUS = 2
  {
   L0 = &E_RIGHT * -1
   &DIG_2_SUB = ROTATE 0 ,7 ,L0
  }
  IF &DIG_POS_STATUS = 3
  {
   L0 = &E_RIGHT * -1
   &DIG_3_SUB = ROTATE 0 ,7 ,L0
  }
  IF &DIG_POS_STATUS = 4
  {
   L0 = &E_RIGHT * -1
   &DIG_4_SUB = ROTATE 0 ,7 ,L0
  }
 }
}

Var 428, name I_IDENT, Link IOCARD_SW, device 20, Input 78
{
 IF &enc_atc = 1
 {
  IF &I_IDENT = 1
  {
   &IVAP_SB_IDENT = 1
  }
 }
}

Var 430, name I_XPNDR, Link IOCARD_SW, device 20, Input 79
{
 IF &enc_atc = 1
 {
  IF &STANDBY = 0
  {
   CALL &check_xp
  }
 }
}

var 431, name check_xp, link subrutine
{
  IF &I_XPNDR = 1
  {
    &DIS_1 = 0
    &DIS_2 = 1
  }
  ELSE
  {
    &DIS_1 = 1
    &DIS_2 = 0
  }
}

Var 432, name STANDBY, Link IOCARD_SW, device 20, Input 139
{
 IF &enc_atc = 1
 {
  IF &STANDBY = 1
  {
   &IVAP_SB_MODE = 1
   &DIS_1 = 0
   &DIS_2 = 0
   &DIS_ATC = 0
  }
  ELSE
  {
   CALL &check_xp
  }
 }
}

Var 434, name I_R_ALT, Link IOCARD_SW, device 20, Input 140

Var 436, name I_R_XPN, Link IOCARD_SW, device 20, Input 141
{
 IF &enc_atc = 1
 {
  IF &I_R_XPN = 1
  {
    &IVAP_SB_MODE = 0
  }
 }
}

Var 438, name I_R_TAO, Link IOCARD_SW, device 20, Input 142
{
 IF &enc_atc = 1
 {
 IF &I_R_TAO = 1
  {
   &TCAS_MAGENTA = 51
  }
 }
}

Var 440, name I_R_TAR, Link IOCARD_SW, device 20, Input 143
{
 IF &enc_atc = 1
 {
  IF &I_R_TAR = 1
  {
   &TCAS_MAGENTA = 51
  }
 }
}
Var 2348, name enc_atc_prosim, static
{
 IF &enc_atc_prosim = -1
 {
  &enc_atc = 0
 }
 ELSE
 {
  &enc_atc = 1
 }
}
Var 2350, name enc_atc
{
 IF &enc_atc = 0
 {
  &d_active = -999999
  &d_fail = -999999
  &DIG_POS_STATUS = 5
  &DIS_1 = 0
  &DIS_2 = 0
  &DIS_ATC = 0
 }
 ELSE
 {
  &DIS_ATC = 1
  call &DIGITS_SUB
  &DIG_POS_STATUS = 5
  IF &STANDBY <> 1
  {
   call &check_xp
  }
  IF &XPDER_FAIL = 1
  {
    &D_FAIL = -999997
    &LED_FAIL = 1
  }
  ELSE
  {
    &D_FAIL = -999999
    &LED_FAIL = 0
  }
 }
}

Var 442, name DIGITS_SUB, Link SUBRUTINE
{
  L0 = &DIG_4_SUB * 1000
  L1 = &DIG_3_SUB * 100
  L0 = L0 + L1
  L1 = &DIG_2_SUB * 10
  L0 = L0 + L1
  L0 = L0 + &DIG_1_SUB
  &D_ACTIVE = L0
  &FS_XPDER_ID = TOBCD &D_ACTIVE
}

// ****************** TIMER ****************
// *****************************************
var 443, name lockcount, value 0
var 444, name timeratc, link subrutine
{
  if &timerup = 0
  {
    &lastst = 0
  }
  else
  {
    IF &DIG_POS_STATUS = 1
    {
      IF &lastst = 0
      {
        &D_ATC1 = -999999
      }
      ELSE
      {
        &D_ATC1 = &DIG_1_SUB
      }

    }
    IF &DIG_POS_STATUS = 2
    {
      IF &lastst = 0
      {
        &D_ATC2 = -999999
      }
      ELSE
      {
        &D_ATC2 = &DIG_2_SUB
      }
    }
    IF &DIG_POS_STATUS = 3
    {
      IF &lastst = 0
      {
        &D_ATC3 = -999999
      }
      ELSE
      {
        &D_ATC3 = &DIG_3_SUB
      }
    }
    IF &DIG_POS_STATUS = 4
    {
      IF &lastst = 0
      {
        &D_ATC4 = -999999
      }
      ELSE
      {
        &D_ATC4 = &DIG_4_SUB
      }
    }
    IF &lastst = 0
    {
      &lastst = 1
    }
    ELSE
    {
      &lastst = 0
    }
    IF &finatc = 50
    {
      &DIG_POS_STATUS = 5
    }
    ELSE
    {
      &finatc = &finatc + 1
    }
  }
// DOOR
  IF &lockcount > 0
  {
    &lockcount = &lockcount - 1
    &STBAUTOL = CHANGEBITN 0 &STBAUTOL
  }
  ELSE
  {
    &STBAUTOL = 0
  }

// AILTRIM

}

var 446, name lastst

var 448, name timerup

Var 450, name D_ATC1, Link IOCARD_DISPLAY, device 20, Digit 90, Numbers 1
Var 452, name D_ATC2, Link IOCARD_DISPLAY, device 20, Digit 91, Numbers 1
Var 454, name D_ATC3, Link IOCARD_DISPLAY, device 20, Digit 92, Numbers 1
Var 456, name D_ATC4, Link IOCARD_DISPLAY, device 20, Digit 93, Numbers 1

var 458, name DIGITS2_SUB, link subrutine
{
  &D_ATC1 = &DIG_1_SUB
  &D_ATC2 = &DIG_2_SUB
  &D_ATC3 = &DIG_3_SUB
  &D_ATC4 = &DIG_4_SUB
}

var 460, name finatc, value 0


// ////////////////////////////////
// STABTRIM IDC
// ////////////////////////////////
// OUTPUTS-LEDS
Var 2456, name STBLCKL, Link IOCARD_OUT, DEVICE 20, Output 96 // STAB TRIM LOCK FAIL INDICATOR
Var 2458, name STBAUTOL, Link IOCARD_OUT, DEVICE 20, Output 97 // STAB TRIM AUTO-UNLOCK INDICATOR
// SWITCHES-INPUTS
Var 2670, name S_STBOVRD, Link IOCARD_SW, DEVICE 20, Input 135 // STAB TRIM OVERRIDE-NORM SWITCH
Var 2672, name R_STBDUNLK, Link IOCARD_SW, DEVICE 20, Input 136 // STAB TRIM DOOR UNLOCK ROTARY SWITCH
Var 2674, name R_STBDAUTO, Link IOCARD_SW, DEVICE 20, Input 137 // STAB TRIM DOOR AUTO ROTARY SWITCH
Var 2676, name R_STBDDENY, Link IOCARD_SW, DEVICE 20, Input 138 // STAB TRIM DOOR DENY ROTARY SWITCH

// ////////////////////////////////
// END STABTRIM IDC
// ////////////////////////////////


// /////////////////////////////////////////////
// END AILERONS TRIM IDC
// /////////////////////////////////////////////


// ******************************************************
// *******************  RUDDER TRIM  ********************
// ******************************************************

Var 964, name S_RDAILUL, Link IOCARD_SW, device 20, Input 63 // RUDDER TRIM AILERON UP LEFT SWITCH
Var 966, name S_RDAILUR, Link IOCARD_SW, device 20, Input 64 // RUDDER TRIM AILERON UP RIGHT SWITCH
Var 968, name S_RDAILDL, Link IOCARD_SW, device 20, Input 65 // RUDDER TRIM AILERON DOWN LEFT SWITCH
Var 970, name S_RDAILDR, Link IOCARD_SW, device 20, Input 66 // RUDDER TRIM AILERON DOWN RIGHT SWITCH
Var 978, name E_RUDDER, Link IOCARD_ENCODER, device 20, Input 67, Aceleration 1, Type 2  // RUDDER TRIM ENCODER
{
   l0 = &E_RUDDER * 500
   &ruddert_o = LIMIT -16000, 16000, l0
}

Var 980, name grudtrim, link USB_SERVOS, device 21, Output 1, PosL 0, PosC 511, PosR 1023  // RUDDER TRIM INDICATOR
Var 982, name leftservo, value 623	// ***** Change de value for your left extreme value for 15 in the indicator ****
var 984, name centerservo, value 510	// ***** change de value for your center value in the indicator ****
Var 986, name rightservo, value 387	// ***** Change de value for your right extreme value for 15 in the indicator ****

var 988, name runindicator, link subrutine
{
  if &ruddert_o = 0
  {
     l0 = &centerservo
  }
  else
  {
    if &ruddert_o < 0 // LEFT
    {
      l0 = &centerservo - &leftservo
    }
    else  // RIGHT
    {
      l0 = &rightservo - &centerservo
    }
    l0 = l0 * &ruddert_o
    l0 = l0 / 16384
    l0 = l0 + &centerservo
  }
  &grudtrim = l0
}
// /////////////////////////////////////////////
// END RUDDER TRIM IDC
// /////////////////////////////////////////////


// /////////////////////////////////////////////
// RADAR PEDESTAL IDC
// /////////////////////////////////////////////
// RADAR
Var 2686, name R_RADTST, STATIC, Link IOCARD_SW, DEVICE 20, Input 69 // RADAR TEST ROTARY SWITCH
{
 IF &R_RADTST = 0
 {
  IF &R_RADWX = 0
  {
   IF &R_RADTURB = 0
    {
     &R_RADMAP = 1
    }
  }
 }
 ELSE
 {
  &R_RADMAP = 0
 }
}
Var 2688, name R_RADWX, STATIC,Link IOCARD_SW, DEVICE 20, Input 70 // RADAR WX ROTARY SWITCH
{
 IF &R_RADWX = 0
 {
  IF &R_RADTST = 0
  {
   IF &R_RADTURB = 0
    {
     &R_RADMAP = 1
    }
  }
 }
 ELSE
 {
  &R_RADMAP = 0
 }
}
Var 2690, name R_RADTURB, STATIC,Link IOCARD_SW, DEVICE 20, Input 71 // RADAR TURB ROTARY SWITCH
{
 IF &R_RADTURB = 0
 {
  IF &R_RADWX = 0
  {
   IF &R_RADTST = 0
    {
     &R_RADMAP = 1
    }
  }
 }
 ELSE
 {
  &R_RADMAP = 0
 }
}
Var 2692, name R_RADMAP, STATIC // RADAR MAP ROTARY SWITCH

// ANALOG

Var 2698, name A_RADGAIN, Link IOCARD_ANALOGIC, DEVICE 20, Input 2, PosL 0, PosC 127, PosR 255  // RADAR GAIN POTENTIOMETER
Var 2700, name A_RADGAINI, STATIC
Var 2701, name A_RADTILT, Link IOCARD_ANALOGIC, DEVICE 20, Input 3, PosL 0, PosC 127, PosR 255  // RADAR TILT POTENTIOMETER
{
 L0 = &A_RADTILT * 2
 L0 = L0 - 255
 &A_RADTILTI = L0
}
Var 2702, name A_RADTILTI, STATIC

// /////////////////////////////////////////////
// END RADAR PEDESTAL IDC
// /////////////////////////////////////////////

// /////////////////////////////////////////////
// FIRE ENGINES IDC
// /////////////////////////////////////////////
// OUTPUTS-LEDS
Var 2410, name ENG1_OVHL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 23 // ENGINE 1 OVERHEAT, declare variable in ProSim Indicators
Var 2412, name APUBOTDISL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 24 // APU BOTTLE DISCHARGE, declare variable in ProSim Indicators
Var 2414, name APUDETINOPL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 25 // APU DET INOPERATIVE, declare variable in ProSim Indicators
Var 2416, name FIREFAULTL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 26 // FIRE ENGINES FAULT, declare variable in ProSim Indicators
Var 2418, name FIREWHELLL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 27 // FIRE WHELL WELL, declare variable in ProSim Indicators
Var 2420, name ENG2_OVHL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 28 // ENGINE 2 OVERHEAT, declare variable in ProSim Indicators
Var 2422, name LBOTDISL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 29 // ENGINE 1 BOTTLE DISCHARGE, declare variable in ProSim Indicators
Var 2424, name RBOTDISL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 30 // ENGINE 2 BOTTLE DISCHARGE, declare variable in ProSim Indicators
Var 2426, name FIRE1L, STATIC, Link IOCARD_OUT, DEVICE 20, Output 31 // ENGINE 1 FIRE HANDLE LIGHT, declare variable in ProSim Indicators
Var 2428, name FIREAL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 32 // APU FIRE HANDLE LIGHT, declare variable in ProSim Indicators
Var 2430, name FIRE2L, STATIC, Link IOCARD_OUT, DEVICE 20, Output 33 // ENGINE 2 FIRE HANDLE LIGHT, declare variable in ProSim Indicators
Var 2432, name FIREG1L, STATIC, Link IOCARD_OUT, DEVICE 20, Output 34 // FIRE ENGINE 1 GREEN LED, declare variable in ProSim Indicators
Var 2434, name FIREGAL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 35 // FIRE APU GREEN LED, declare variable in ProSim Indicators
Var 2436, name FIREG2L, STATIC, Link IOCARD_OUT, DEVICE 20, Output 36 // FIRE ENGINE 2 GREEN LED, declare variable in ProSim Indicators
// SWITCHES-INPUTS
Var 2614, name S_OVHTDET1A, STATIC, Link IOCARD_SW, DEVICE 20, Input 46 // FIRE ENGINE 1 OVERHEAT A DETECTOR SWITCH, declare variable in ProSim Switches
Var 2616, name S_OVHTDET1B, STATIC, Link IOCARD_SW, DEVICE 20, Input 45 // FIRE ENGINE 1 OVERHEAT B DETECTOR SWITCH, declare variable in ProSim Switches
Var 2618, name S_FETSTOVH, STATIC, Link IOCARD_SW, DEVICE 20, Input 47 // FIRE ENGINES TEST OVH-FIRE SWITCH, declare variable in ProSim Switches
Var 2620, name S_FETSTFAULT, STATIC, Link IOCARD_SW, DEVICE 20, Input 48 // FIRE ENGINES TEST FAULT-INOP SWITCH, declare variable in ProSim Switches
Var 2622, name S_BELLCOUT, STATIC, Link IOCARD_SW, DEVICE 20, Input 49 // FIRE ENGINES BELL CUT OUT SWITCH, declare variable in ProSim Switches
Var 2624, name S_OVHTDET2A, STATIC, Link IOCARD_SW, DEVICE 20, Input 51 // FIRE ENGINE 2 OVERHEAT A DETECTOR SWITCH, declare variable in ProSim Switches
Var 2626, name S_OVHTDET2B, STATIC, Link IOCARD_SW, DEVICE 20, Input 50 // FIRE ENGINE 2 OVERHEAT B DETECTOR SWITCH, declare variable in ProSim Switches
Var 2628, name S_EXT1TEST, STATIC, Link IOCARD_SW, DEVICE 20, Input 53 // FIRE ENGINE EXTINGUISHER 1 TEST SWITCH, declare variable in ProSim Switches
Var 2630, name S_EXT2TEST, STATIC, Link IOCARD_SW, DEVICE 20, Input 52 // FIRE ENGINE EXTINGUISHER 2 TEST SWITCH, declare variable in ProSim Switches
Var 2632, name S_HND1DW, STATIC, Link IOCARD_SW, DEVICE 20, Input 55 // FIRE ENGINE HANDLE 1 DW SWITCH, declare variable in ProSim Switches
Var 2634, name S_HND1L, STATIC, Link IOCARD_SW, DEVICE 20, Input 54 // FIRE ENGINE HANDLE 1 LEFT SWITCH, declare variable in ProSim Switches
Var 2636, name S_HND1R, STATIC, Link IOCARD_SW, DEVICE 20, Input 56 // FIRE ENGINE HANDLE 1 RIGHT SWITCH, declare variable in ProSim Switches
Var 2638, name S_HNDADW, STATIC, Link IOCARD_SW, DEVICE 20, Input 58 // FIRE ENGINE HANDLE APU DW SWITCH, declare variable in ProSim Switches
Var 2640, name S_HNDAL, STATIC, Link IOCARD_SW, DEVICE 20, Input 57 // FIRE ENGINE HANDLE APU LEFT SWITCH, declare variable in ProSim Switches
Var 2642, name S_HNDAR, STATIC, Link IOCARD_SW, DEVICE 20, Input 59 // FIRE ENGINE HANDLE APU RIGHT SWITCH, declare variable in ProSim Switches
Var 2644, name S_HND2DW, STATIC, Link IOCARD_SW, DEVICE 20, Input 61 // FIRE ENGINE HANDLE 2 DW SWITCH, declare variable in ProSim Switches
Var 2646, name S_HND2L, STATIC, Link IOCARD_SW, DEVICE 20, Input 60 // FIRE ENGINE HANDLE 2 LEFT SWITCH, declare variable in ProSim Switches
Var 2648, name S_HND2R, STATIC, Link IOCARD_SW, DEVICE 20, Input 62 // FIRE ENGINE HANDLE 2 RIGHT SWITCH, declare variable in ProSim Switches

// /////////////////////////////////////////////
// END FIRE ENGINES IDC
// /////////////////////////////////////////////

// /////////////////////////////////////////////
// FIRE CARGO IDC
// /////////////////////////////////////////////

// OUTPUTS-LEDS
Var 2438, name FCDISCL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 87 // FIRE CARGO KORRY DISCH INDICATOR, declare variable in ProSim Indicators
Var 2440, name FCDISCBARL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 88 // FIRE CARGO KORRY DISCH BAR INDICATOR, declare variable in ProSim Indicators
Var 2442, name FCAFTL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 89 // FIRE CARGO KORRY AFT INDICATOR, declare variable in ProSim Indicators
Var 2444, name FCAFTARML, STATIC, Link IOCARD_OUT, DEVICE 20, Output 90 // FIRE CARGO KORRY AFT ARMED  INDICATOR, declare variable in ProSim Indicators
Var 2446, name FCFWDL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 91 // FIRE CARGO KORRY FWD INDICATOR, declare variable in ProSim Indicators
Var 2448, name FCFWDARML, STATIC, Link IOCARD_OUT, DEVICE 20, Output 92 // FIRE CARGO KORRY FWD ARMED INDICATOR, declare variable in ProSim Indicators
Var 2450, name FCDETFAULT, STATIC, Link IOCARD_OUT, DEVICE 20, Output 93 // FIRE CARGO DETECTOR FAULT INDICATOR, declare variable in ProSim Indicators
Var 2452, name FCEXTFWDL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 94 // FIRE CARGO EXT FWD GREEN INDICATOR, declare variable in ProSim Indicators
Var 2454, name FCEXTAFTL, STATIC, Link IOCARD_OUT, DEVICE 20, Output 95 // FIRE CARGO EXT AFT GREEN INDICATOR, declare variable in ProSim Indicators
// INPUTS-SWITCHES
Var 2650, name R_FDETFA, STATIC, Link IOCARD_SW, DEVICE 20, Input 123 // FIRE CARGO DET SELECT FWD A ROTARY SWITCH, declare variable in ProSim Switches
Var 2652, name R_FDETFNORM, STATIC, Link IOCARD_SW, DEVICE 20, Input 122 // FIRE CARGO DET SELECT FWD NORM ROTARY SWITCH, declare variable in ProSim Switches
Var 2654, name R_FDETFB, STATIC, Link IOCARD_SW, DEVICE 20, Input 121 // FIRE CARGO DET SELECT FWD B ROTARY SWITCH, declare variable in ProSim Switches
Var 2656, name R_FDETAA, STATIC, Link IOCARD_SW, DEVICE 20, Input 120 // FIRE CARGO DET SELECT AFT A ROTARY SWITCH, declare variable in ProSim Switches
Var 2658, name R_FDETANORM, STATIC, Link IOCARD_SW, DEVICE 20, Input 119 // FIRE CARGO DET SELECT AFT NORM ROTARY SWITCH, declare variable in ProSim Switches
Var 2660, name R_FDETAB, STATIC, Link IOCARD_SW, DEVICE 20, Input 118 // FIRE CARGO DET SELECT AFT B ROTARY SWITCH, declare variable in ProSim Switches
Var 2662, name S_FARMF, STATIC, Link IOCARD_SW, DEVICE 20, Input 128 // FIRE CARGO FWD ARMED KORRY SWITCH, declare variable in ProSim Switches
Var 2664, name S_FARMA, STATIC, Link IOCARD_SW, DEVICE 20, Input 127 // FIRE CARGO AFT ARMED KORRY SWITCH, declare variable in ProSim Switches
Var 2666, name S_FTEST, STATIC, Link IOCARD_SW, DEVICE 20, Input 117 // FIRE CARGO TEST SWITCH, declare variable in ProSim Switches
Var 2668, name S_FDISCH, STATIC, Link IOCARD_SW, DEVICE 20, Input 126 // FIRE CARGO DISCHARGE KORRY SWITCH, declare variable in ProSim Switches

// /////////////////////////////////////////////
// END FIRE CARGO IDC
// /////////////////////////////////////////////

// /////////////////////////////////////////////
// AUDIO FO IDC
// /////////////////////////////////////////////
// OUTPUTS-LEDS
Var 2392, name AU2VH1MI, STATIC, Link IOCARD_OUT, DEVICE 20, Output 78  // AUDIO2 VHF1 MIC LED, declare variable in ProSim Indicators
Var 2394, name AU2VH2MI, STATIC, Link IOCARD_OUT, DEVICE 20, Output 79 //  AUDIO2 VHF2 MIC LED, declare variable in ProSim Indicators
Var 2396, name AU2VH1VO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 80 // AUDIO2 VHF1 VOL LED, declare variable in ProSim Indicators
Var 2398, name AU2VH2VO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 81 // AUDIO2 VHF2 VOL LED, declare variable in ProSim Indicators
Var 2400, name AU2NA1VO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 82 // AUDIO2 NAV1 VOL LED, declare variable in ProSim Indicators
Var 2402, name AU2NA2VO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 83 // AUDIO2 NAV2 VOL LED, declare variable in ProSim Indicators
Var 2404, name AU2AD1VO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 84 // AUDIO2 ADF1 VOL LED, declare variable in ProSim Indicators
Var 2406, name AU2AD2VO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 85 // AUDIO2 ADF2 VOL LED, declare variable in ProSim Indicators
Var 2408, name AU2MKRVO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 86 // AUDIO2 MARKER VOL LED, declare variable in ProSim Indicators
// INPUTS-SWITCHES
Var 2584, name S_AU2VH1MI, STATIC, Link IOCARD_SW, DEVICE 20, Input 99 // AUDIO2 VHF1 MIC SWITCH, declare variable in ProSim Switches
Var 2586, name S_AU2VH2MI, STATIC, Link IOCARD_SW, DEVICE 20, Input 100 // AUDIO2 VHF2 MIC SWITCH, declare variable in ProSim Switches
Var 2588, name S_AU2VH1VO, STATIC, Link IOCARD_SW, DEVICE 20, Input 101 // AUDIO2 VHF1 VOL SWITCH, declare variable in ProSim Switches
Var 2590, name S_AU2VH2VO, STATIC, Link IOCARD_SW, DEVICE 20, Input 102 // AUDIO2 VHF2 VOL SWITCH, declare variable in ProSim Switches
Var 2592, name S_AU2NA1VO, STATIC, Link IOCARD_SW, DEVICE 20, Input 103 // AUDIO2 NAV1 VOL SWITCH, declare variable in ProSim Switches
Var 2594, name S_AU2NA2VO, STATIC, Link IOCARD_SW, DEVICE 20, Input 104 // AUDIO2 NAV2 VOL SWITCH, declare variable in ProSim Switches
Var 2596, name S_AU2AD1VO, STATIC, Link IOCARD_SW, DEVICE 20, Input 105 // AUDIO2 ADF1 VOL SWITCH, declare variable in ProSim Switches
Var 2598, name S_AU2AD2VO, STATIC, Link IOCARD_SW, DEVICE 20, Input 106 // AUDIO2 ADF2 VOL SWITCH, declare variable in ProSim Switches
Var 2600, name S_AU2MKRVO, STATIC, Link IOCARD_SW, DEVICE 20, Input 107 // AUDIO2 MARKER VOL SWITCH, declare variable in ProSim Switches
Var 2602, name S_AU2RT, STATIC, Link IOCARD_SW, DEVICE 20, Input 110 // AUDIO2 R-T SWITCH, declare variable in ProSim Switches
Var 2604, name S_AU2IC, STATIC, Link IOCARD_SW, DEVICE 20, Input 111 // AUDIO2 I-C SWITCH, declare variable in ProSim Switches
Var 2606, name R_AU2FILTV, STATIC, Link IOCARD_SW, DEVICE 20, Input 109 // AUDIO2 FILTER V ROTARY SWITCH, declare variable in ProSim Switches
Var 2608, name R_AU2FILTR, STATIC, Link IOCARD_SW, DEVICE 20, Input 108 // AUDIO2 FILTER R ROTARY SWITCH, declare variable in ProSim Switches
Var 2610, name S_AU2NORM, STATIC, Link IOCARD_SW, DEVICE 20, Input 112 // AUDIO2 NORM SWITCH, declare variable in ProSim Switches
{
 IF &S_AU2NORM <> 1
 {
  &S_AU2ALT = 1
 }
 ELSE
 {
  &S_AU2ALT = 0
 }
}
Var 2612, name S_AU2ALT, STATIC // declare variable in ProSim Switches

// /////////////////////////////////////////////
// END AUDIO FO IDC
// /////////////////////////////////////////////

// /////////////////////////////////////////////
// AUDIO CAPTAIN IDC
// /////////////////////////////////////////////
// OUTPUTS-LEDS
Var 2374, name AU1VH1MI, STATIC, Link IOCARD_OUT, DEVICE 20, Output 14 // AUDIO1 VHF1 MIC LED
Var 2376, name AU1VH2MI, STATIC, Link IOCARD_OUT, DEVICE 20, Output 15 // AUDIO1 VHF2 MIC LED
Var 2378, name AU1VH1VO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 16 // AUDIO1 VHF1 VOL LED
Var 2380, name AU1VH2VO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 17 // AUDIO1 VHF2 VOL LED
Var 2382, name AU1NA1VO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 18 // AUDIO1 NAV1 VOL LED
Var 2384, name AU1NA2VO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 19 // AUDIO1 NAV2 VOL LED
Var 2386, name AU1AD1VO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 20 // AUDIO1 ADF1 VOL LED
Var 2388, name AU1AD2VO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 21 // AUDIO1 ADF2 VOL LED
Var 2390, name AU1MKRVO, STATIC, Link IOCARD_OUT, DEVICE 20, Output 22 // AUDIO1 MARKER VOL LED
// INPUTS-SWITCHES
Var 2554, name S_AU1VH1MI, STATIC, Link IOCARD_SW, DEVICE 20, Input 27 // AUDIO1 VHF1 MIC SWITCH
Var 2556, name S_AU1VH2MI, STATIC, Link IOCARD_SW, DEVICE 20, Input 28 // AUDIO1 VHF2 MIC SWITCH
Var 2558, name S_AU1VH1VO, STATIC, Link IOCARD_SW, DEVICE 20, Input 29 // AUDIO1 VHF1 VOL SWITCH
Var 2560, name S_AU1VH2VO, STATIC, Link IOCARD_SW, DEVICE 20, Input 30 // AUDIO1 VHF2 VOL SWITCH
Var 2562, name S_AU1NA1VO, STATIC, Link IOCARD_SW, DEVICE 20, Input 31 // AUDIO1 NAV1 VOL SWITCH
Var 2564, name S_AU1NA2VO, STATIC, Link IOCARD_SW, DEVICE 20, Input 32 // AUDIO1 NAV2 VOL SWITCH
Var 2566, name S_AU1AD1VO, STATIC, Link IOCARD_SW, DEVICE 20, Input 33 // AUDIO1 ADF1 VOL SWITCH
Var 2568, name S_AU1AD2VO, STATIC, Link IOCARD_SW, DEVICE 20, Input 34 // AUDIO1 ADF2 VOL SWITCH
Var 2570, name S_AU1MKRVO, STATIC, Link IOCARD_SW, DEVICE 20, Input 35 // AUDIO1 MARKER VOL SWITCH
//Var 2572, name S_AU1RT, STATIC, Link IOCARD_SW, DEVICE 20, Input 38 // AUDIO1 R-T SWITCH
Var 2574, name S_AU1IC, STATIC, Link IOCARD_SW, DEVICE 20, Input 39 // AUDIO1 I-C SWITCH
Var 2576, name R_AU1FILTV, STATIC, Link IOCARD_SW, DEVICE 20, Input 37 // AUDIO1 FILTER V ROTARY SWITCH
Var 2578, name R_AU1FILTR, STATIC, Link IOCARD_SW, DEVICE 20, Input 36 // AUDIO1 FILTER R ROTARY SWITCH
Var 2580, name S_AU1NORM, STATIC, Link IOCARD_SW, DEVICE 20, Input 40 // AUDIO1 NORM SWITCH
 {
  IF &S_AU1NORM <> 1
  {
   &S_AU1ALT = 1
  }
  ELSE
  {
   &S_AU1ALT = 0
  }
}
Var 2582, name S_AU1ALT, STATIC

// /////////////////////////////////////////////
// END AUDIO CAPTAIN IDC
// /////////////////////////////////////////////

// ********* OFFSETS ****

Var 5250, Link FSUIPC_OUT, name fcom1, Offset $034E, Length 2 // COM1 Active
Var 5252, Link FSUIPC_OUT, name fcom2, Offset $3118, Length 2 // COM2 Active
Var 5254, Link FSUIPC_OUT, name fnav1, Offset $0350, Length 2 // NAV1 Active
Var 5256, Link FSUIPC_OUT, name fnav2, Offset $0352, Length 2 // NAV2 Active
Var 5258, Link FSUIPC_OUT, name fadf1A, Offset $034c, Length 2 // adf1 Active part1
Var 5260, Link FSUIPC_OUT, name fadf1B, Offset $0356, Length 2 // ADF1 Active part2
Var 5262, Link FSUIPC_OUT, name fadf2A, Offset $02D4, Length 2 // ADF2 Active part1
Var 5264, Link FSUIPC_OUT, name fadf2B, Offset $02D6, Length 2 // ADF2 Active part2
Var 5266, Link FSUIPC_OUT, name toneadf1, Offset $3107, Length 2 // ADF1 TONE
Var 5268, Link FSUIPC_OUT, name toneadf2, Offset $02FB, Length 2 // ADF2 TONE
Var 5270, name FS_XPDER_ID, Link FSUIPC_INOUT, Offset $0354, Length 2
Var 5272, name IVAP_SB_MODE, Link FSUIPC_INOUT, Offset $7B91, Length 1
Var 5274, name IVAP_SB_IDENT, Link FSUIPC_INOUT, Offset $7B93, Length 1
Var 5276, name XPDER_FAIL, Link FSUIPC_INOUT, Offset $0B6F, Length 1

{
  IF &XPDER_FAIL = 1
  {
    &D_FAIL = -999997
    &LED_FAIL = 1
  }
  ELSE
  {
    &D_FAIL = -999999
    &LED_FAIL = 0
  }
}
Var 5278, name TCAS_MAGENTA, Link FSUIPC_INOUT, Offset $04F4, Length 2

Var 5288, name ruddert_o, link FSUIPC_INOUT, offset $0c04, length 2, type 1 // Rudder trim
{
  CALL &runindicator
}
Var 5290, name ailt_o, link FSUIPC_INOUT, offset $0c02, length 2, type 1 // Ailerons trim


//Trial code for PTT's

Var 9210, name FO_JoyStick64, Link FSUIPC_INOUT, offset $3340, length 4, type 1

// PTT 
Var 9212, Link IOCARD_SW, Device 20, Input 38, Type I 
{ 
&FO_JoyStick64 = CHANGEBIT 0 v9211 // toggle bit 0 of joystick 64 
}



Thanks a bunch.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

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