Airbus Radio Panel (solved working script attached)

This is the forum to discuss and ask questions related to the new Oi4FS app for MSFS 2020
Post Reply
ZillaUK
Posts: 3
Joined: Mon Aug 31, 2020 6:25 pm

Airbus Radio Panel (solved working script attached)

Post by ZillaUK »

Hi Roar,

Are the Frequency displays for the com and nav radios built into the driver yet?

I've been trying to edit the script to get the Airbus Radio Panel to work with the Com's & Nav's - encoders and buttons are working OK, just can't seem to get any frequencies displayed & no values seem to be received from the sim in the IOCP Console.

So just wondering if this is still a work in progress / SDK shortfall?

Thanks.
Last edited by ZillaUK on Fri Feb 05, 2021 11:29 am, edited 1 time in total.
ZillaUK
Posts: 3
Joined: Mon Aug 31, 2020 6:25 pm

Re: Airbus Radio Panel - Com/Nav frequency display

Post by ZillaUK »

I've made some progress and now have the displays working. :D

The issue was I was using a .lst file to compile multiple scripts to keep my edits separate from your default script (so I could easily update with minimal edits when you update the script in the future).

For some reason, when compiled, this results in all the vars being renumbered (consecutively v1,v2,v3,v4 etc) rather than respecting the var #'s allocated in the scripts - hence breaking the displays.

Don't know the reason for this - but it's working now if I put my edits into the single .txt file directly.

Also discovered the reason I was not getting any values for the frequencies coming through from the sim in ICOPconsole - I didn't realise that every time I reloaded the script in SIOC it was shutting down the OiMS driver and I needed to reload it. Doh! :roll:
ZillaUK
Posts: 3
Joined: Mon Aug 31, 2020 6:25 pm

Re: Airbus Radio Panel - Com/Nav frequency display

Post by ZillaUK »

I've now got the Airbus Radio Panel more or less fully functional with OiMS and MSFS.

If anyone has one of these panels and would like to get it working with OiMS (or Roar, if it's any use to you to build in direct support for the panel in OiMS) then the script is below.

The Panel acts multi-function and controls COM1 (VHF1 button), COM2 (VHF2 button), NAV1 (NAV button), NAV2 (VOR button), XPNDR (ILS button), ADF (ADF button), and the Display Brightness (BFO button).

To use - simply edit out any of the lines from the Oi4FS-MS DEFAULT v1.X.ssi script that refer to the COM1/2, NAV 1/2, ADF, XPNDR, and add the following code at the bottom to replace them.

Not tested extensively yet.

Code: Select all


// CUSTOM EDITS


// *******************************************************************************
// * Airbus Radio Module Panel - Multi-function script
// * Modification of OiMS script
// * Controls COM1 (VHF1 button), COM2 (VHF2 button), XPNDR (ILS button), ADF (ADF button),
// * 		  NAV1 (NAV button), NAV2 (VOR button), Display Brightness (BFO button)
// *******************************************************************************


// ****** OiMS VARIABLES (communicates with OiMS driver) ******

// COM1 (OiMS Vars)
	Var 0100, name D_AC_COM1			// COM1 active
	{
		if &mode_com1 = 1
		{
			&D_AC_6DIG = &D_AC_COM1
		}
	}

	Var 0102, name D_ST_COM1			// COM1 standby
	{
		if &mode_com1 = 1
		{
			&D_ST_6DIG = &D_ST_COM1
		}
	}
	
    Var 2801, name bCOM1_TFR			// Active/Standby swap button
	Var 2803, name ROT_COM1_SW			// inner knob
	Var 2804, name ROT_COM1_SF			// outer knob
	
// 	Var 0101, name O_AC_COM1DP			// Decimal Point OiMS not used
// 	Var 0103, name O_ST_COM1DP			// Decimal Point OiMS not used
//	Var 2802, name bCOM1_TEST			// OiMS not used



// COM2 (OiMS Vars)

	Var 0104, name D_AC_COM2			// COM2 active
	{
		if &mode_com2 = 1
		{
			&D_AC_6DIG = &D_AC_COM2
		}
	}
	
	Var 0106, name D_ST_COM2			// COM2 standby
	{
		if &mode_com2 = 1
		{
			&D_ST_6DIG = &D_ST_COM2
		}
	}
	
	Var 2805, name bCOM2_TFR			// Active/Standby swap button
	Var 2807, name ROT_COM2_SW			// innner knob			
	Var 2808, name ROT_COM2_SF			// outer knob
	
//	Var 0105, name O_AC_COM2DP			// Decimal Point OiMS not used
//	Var 0107, name O_ST_COM2DP			// Decimal Point OiMS not used
//	Var 2806, name bCOM2_TEST			// OiMS not used



// NAV 1 (OiMS Vars)

	Var 0108, name D_AC_NAV1			// NAV1 active
	{	
		if &mode_nav1 = 1
		{
			&D_AC_5DIG = &D_AC_NAV1
		}
	}

	Var 0110, name D_ST_NAV1			// NAV1 standby
	{
		if &mode_nav1 = 1
		{
			&D_ST_5DIG = &D_ST_NAV1
		}
	}
	
	Var 2809, name bNAV1_TFR			// Active/Standby swap button
	Var 2811, name ROT_NAV1_SW			// inner knob
	Var 2812, name ROT_NAV1_SF			// outer knob
	
//	Var 0109, name O_AC_NAV1DP			// Decimal Point OiMS not used
//	Var 0111, name O_ST_NAV1DP			// Decimal Point OiMS not used
//	Var 2810, name bCNAV1_TEST			// OiMS not used



// NAV2 (OiMS Vars)

	Var 0112, name D_AC_NAV2			// NAV2 active
	{	
		if &mode_nav2 = 1
		{
			&D_AC_5DIG = &D_AC_NAV2
		}
	}
	
	Var 0114, name D_ST_NAV2			// NAV2 standby
	{
		if &mode_nav2 = 1
		{
			&D_ST_5DIG = &D_ST_NAV2
		}
	}
	
	Var 2813, name bNAV2_TFR			// Active/Standby swap button
	Var 2815, name ROT_NAV2_SW			// inner knob
	Var 2816, name ROT_NAV2_SF			// outer knob

//	Var 0113, name O_AC_NAV2DP			// Decimal Point OiMS not used
//	Var 0115, name O_ST_NAV2DP			// Decimal Point OiMS not used
//	Var 2814, name bNAV2_TEST			// OiMS not used



// ADF (OiMS Vars)

	Var 0554, name D_A1Act				// ADF active hundreds digits
	{	
		if &mode_adf = 1
		{
			&D_AC_ADF = &D_A1Act
		}
	}
		
	Var 0556, name D_A1Act5				// ADF active thousands digit
	{	
		if &mode_adf = 1
		{
			&D_AC_ADF5 = &D_A1Act5
		}
	}
	
	Var 0551, name D_A1Stb				// ADF standby hundreds digits
	{	
		if &mode_adf = 1
		{
			&D_ST_ADF = &D_A1Stb
		}
	}
	
	Var 0553, name D_A1Stb5				// ADF standby thousands digit
	{	
		if &mode_adf = 1
		{
			&D_ST_ADF5 = &D_A1Stb5
		}
	}

	Var 2822, name bADF_TFR				// Active/Standby swap button
	Var 2826, name ROT_ADF_SW			// inner knob
	Var 2827, name ROT_ADF_SF			// outer knob


// Var 0555, name O_A1ActDp				// Decimal Point OiMS not used
// Var 0552, name O_A1StbDp				// Decimal Point OiMS not used
// Var 2103, name sADF_MODE_SEL			// OiMS not used
// Var 2105, name sADF_TONE				// OiMS not used



// XPNDR (OiMS Vars)

	Var 0560, name XPDRFreq
	Var 0561, name XPDRFreqLow
	Var 0562, name XPDRFreqHigh
	Var 2818, name XPDRtoAPL, static

	Var 0563, name AtcDsp				// Code Display
	{
		&XPDRFreqHigh = DIV &AtcDsp 100	// set starting values when rotating knobs
		&XPDRFreqLow = MOD &AtcDsp 100	// set starting values when rotating knobs
		
		if &mode_xpndr = 1				// update displays when new value set
		{
			&D_AC_XPNDR = &AtcDsp
		}
		
	}	

	Var 0567, name ATC_E_RIGHT			// linked to outer knob
	{
	  L0 = &ATC_E_RIGHT
	  &XPDRFreqLow = ROTATE 0 ,77 ,L0
	  L1 = MOD &XPDRFreqLow ,10
	  IF L1 = 8
	  {
		&XPDRFreqLow = &XPDRFreqLow + 2
	  }
	  IF L1 = 9
	  {
		&XPDRFreqLow = &XPDRFreqLow - 2
	  }
	  CALL &AtcOut
	}

	Var 0568, name ATC_E_LEFT			// linked to inner knob
	{
	  L0 = &ATC_E_LEFT * -1
	  &XPDRFreqHigh = ROTATE 0 ,77 ,L0
	  L1 = MOD &XPDRFreqHigh ,10
	  IF L1 = 8
	  {
		&XPDRFreqHigh = &XPDRFreqHigh + 2
	  }
	  IF L1 = 9
	  {
		&XPDRFreqHigh = &XPDRFreqHigh - 2
	  }
	  CALL &AtcOut
	}

	Var 0569, name AtcOut, Link SUBRUTINE	// merge and calc final code
	{
	  L0 = &XPDRFreqHigh * 100
	  &XPDRFreq = L0 + &XPDRFreqLow
	  &XPDRtoAPL = TOBCD &XPDRFreq
	}

// other functions of XPNDR not yet functional in OiMS




// ****** MULTI-FUNCTION VARIABLES (Set depending on mode set) ******

// displays
	
	Var 8000, name D_AC_6DIG Link IOCARD_DISPLAY, Device 12, Digit 0, Numbers 6		// Active Display 6 digits
	Var 8001, name D_ST_6DIG, Link IOCARD_DISPLAY, Device 12, Digit 6, Numbers 6	// Standby Display 6 digits
	
	Var 8002, name D_AC_5DIG, Link IOCARD_DISPLAY, Device 12, Digit 0, Numbers 5	// Active Display 5 digits	
	Var 8003, name D_ST_5DIG, Link IOCARD_DISPLAY, Device 12, Digit 6, Numbers 5	// Standby Display 5 digits

	Var 8004, name O_AC_DP6DIG, Link IOCARD_OUT, Device 12, Output 21     // Decimal Point Active 6 digits
	Var 8005, name O_ST_DP6DIG, Link IOCARD_OUT, Device 12, Output 23     // Decimal Point Standby 6 digits
	
	Var 8006, name O_AC_DP5DIG, Link IOCARD_OUT, Device 12, Output 20     // Decimal Point Active 5 digits
	Var 8007, name O_ST_DP5DIG, Link IOCARD_OUT, Device 12, Output 22     // Decimal Point Standby 5 digits
	
	Var 8008, name D_AC_ADF, static, Link IOCARD_DISPLAY, Device 12, Digit 1, Numbers 4		// Active ADF Display Hundreds
	Var 8009, name D_AC_ADF5, static, Link IOCARD_DISPLAY, Device 12, Digit 5, Numbers 1	// Active ADF Display Thousands
	
	Var 8010, name D_ST_ADF, static, Link IOCARD_DISPLAY, Device 12, Digit 7, Numbers 4		// Standby ADF Display Hundreds
	Var 8011, name D_ST_ADF5, static, Link IOCARD_DISPLAY, Device 12, Digit 11, Numbers 1	// Standby ADF Display Thousands

	Var 8012, name D_AC_XPNDR, Link IOCARD_DISPLAY, Device 12, Digit 0, Numbers 4		// XPNDR Code Display

	Var 8013, name D_ST_XPNDR1, Link IOCARD_DISPLAY, Device 12, Digit 11, Numbers 1		// XPNDR STBY msg Display
	Var 8014, name D_ST_XPNDR2, Link IOCARD_DISPLAY, Device 12, Digit 10, Numbers 1		// XPNDR STBY msg Display
	Var 8015, name D_ST_XPNDR3, Link IOCARD_DISPLAY, Device 12, Digit 9, Numbers 1		// XPNDR STBY msg Display
	Var 8016, name D_ST_XPNDR4, Link IOCARD_DISPLAY, Device 12, Digit 8, Numbers 1		// XPNDR STBY msg Display
	Var 8017, name D_ST_XPNDR5, Link IOCARD_DISPLAY, Device 12, Digit 7, Numbers 1		// XPNDR STBY msg Display
	Var 8018, name D_ST_XPNDR6, Link IOCARD_DISPLAY, Device 12, Digit 6, Numbers 1		// XPNDR STBY msg Display


// buttons

	Var 8020, name bCOM1_TFR_X, static, Link IOCARD_SW, Device 12, Input 4, Type P		// Trf Button
	{
		if &mode_com1 = 1
		{
			&bCOM1_TFR = CHANGEBITN 0 &bCOM1_TFR
		}
		if &mode_com2 = 1
		{
			&bCOM2_TFR = CHANGEBITN 0 &bCOM2_TFR
		}
		if &mode_nav1 = 1
		{
			&bNAV1_TFR = CHANGEBITN 0 &bNAV1_TFR
		}
		if &mode_nav2 = 1
		{
			&bNAV2_TFR = CHANGEBITN 0 &bNAV2_TFR
		}
		if &mode_adf = 1
		{
			&bADF_TFR = CHANGEBITN 0 &bADF_TFR
		}
	}
	

// encoders
	
	Var 8030, name ROT_SW, static, Link IOCARD_ENCODER, Device 12, Input 2, Aceleration 1, Type 2	// inner knob
	{
		if &mode_com1 = 1
		{
			L0 = &ROT_SW	
			&ROT_COM1_SW = L0
			&ROT_COM1_SW = DELAY 0 1	// reset to zero after 10ms	
			
		}
		if &mode_com2 = 1
		{
			L0 = &ROT_SW	
			&ROT_COM2_SW = L0
			&ROT_COM2_SW = DELAY 0 1	// reset to zero after 10ms	
			
		}
		if &mode_nav1 = 1
		{
			L0 = &ROT_SW	
			&ROT_NAV1_SW = L0
			&ROT_NAV1_SW = DELAY 0 1	// reset to zero after 10ms	
		}
		if &mode_nav2 = 1
		{
			L0 = &ROT_SW	
			&ROT_NAV2_SW = L0
			&ROT_NAV2_SW = DELAY 0 1	// reset to zero after 10ms	
		}
		if &mode_adf = 1
		{
			L0 = &ROT_SW	
			&ROT_ADF_SW = L0
			&ROT_ADF_SW = DELAY 0 1	// reset to zero after 10ms	
		}
		if &mode_xpndr = 1
		{
			L0 = &ROT_SW	
			&ATC_E_LEFT = L0
			&ATC_E_LEFT = DELAY 0 1	// reset to zero after 10ms	
		}			
	}
	

	Var 8031, name ROT_SF, static, Link IOCARD_ENCODER, Device 12, Input 0, Aceleration 1, Type 2	// outer knob
	{
		if &mode_com1 = 1
		{
			L0 = &ROT_SF	
			&ROT_COM1_SF = L0
			&ROT_COM1_SF = DELAY 0 1	// reset to zero after 10ms	
			
		}
		if &mode_com2 = 1
		{
			L0 = &ROT_SF	
			&ROT_COM2_SF = L0
			&ROT_COM2_SF = DELAY 0 1	// reset to zero after 10ms	
			
		}
		if &mode_nav1 = 1
		{
			L0 = &ROT_SF	
			&ROT_NAV1_SF = L0
			&ROT_NAV1_SF = DELAY 0 1	// reset to zero after 10ms	
		}
		if &mode_nav2 = 1
		{
			L0 = &ROT_SF	
			&ROT_NAV2_SF = L0
			&ROT_NAV2_SF = DELAY 0 1	// reset to zero after 10ms	
		}
		if &mode_adf = 1
		{
			L0 = &ROT_SF	
			&ROT_ADF_SF = L0
			&ROT_ADF_SF = DELAY 0 1		// reset to zero after 10ms	
		}	
		if &mode_xpndr = 1
		{
			L0 = &ROT_SF	
			&ATC_E_RIGHT = L0
			&ATC_E_RIGHT = DELAY 0 1		// reset to zero after 10ms	
		}			
	}



// ****** MODE SWITCHES ******

	var 8500, name radio_on, Link IOCARD_SW, Input 13, Device 12 		// radio on/off switch
	{
	  if &radio_on = 1 
	  {
		&mode_com1 = 1		// set com1 as active mode on startup
	  }
	  else
	  {
		&mode_com1 = 0
		&mode_com2 = 0
		&mode_nav1 = 0
		&mode_nav2 = 0
		&mode_adf = 0
		&mode_xpndr = 0
		&mode_bright = 0
	  }    
	}
	
	
	var 8501, name btn_vhf1, Link IOCARD_SW, Input 5, Device 12 		// set radio in COM1 mode
	{
	  if &radio_on = 1
	  {
		if &mode_com1 = 0
		{
		  &mode_com2 = 0
		  &mode_nav1 = 0
		  &mode_nav2 = 0
		  &mode_adf = 0
		  &mode_xpndr = 0
		  &mode_bright = 0		  
		  &mode_com1 = 1	// set active mode last		  
		}
	  }
	}
	
	
	var 8502, name btn_vhf2, Link IOCARD_SW, Input 6, Device 12 		// set radio in COM2 mode
	{
	  if &radio_on = 1
	  {
		if &mode_com2 = 0
		{
		  &mode_com1 = 0
		  &mode_nav1 = 0
		  &mode_nav2 = 0
		  &mode_adf = 0
		  &mode_xpndr = 0
		  &mode_bright = 0		  
		  &mode_com2 = 1	// set active mode last		  
		}
	  }
	}
	

	var 8503, name btn_nav, Link IOCARD_SW, Input 7, Device 12			// set radio in NAV1 mode
	{
	  if &radio_on = 1
	  {
		if &mode_nav1 = 0
		{
		  &mode_com1 = 0
		  &mode_com2 = 0
		  &mode_nav2 = 0
		  &mode_adf = 0
		  &mode_xpndr = 0
		  &mode_bright = 0		  
		  &mode_nav1 = 1	// set active mode last		  
		}
	  }
	}
	
	var 8504, name btn_vor, Link IOCARD_SW, Input 9, Device 12			// set radio in NAV2 mode
	{
	  if &radio_on = 1
	  {
		if &mode_nav2 = 0
		{
		  &mode_com1 = 0
		  &mode_com2 = 0
		  &mode_nav1 = 0
		  &mode_adf = 0
		  &mode_xpndr = 0		  
		  &mode_bright = 0		  
		  &mode_nav2 = 1	// set active mode last		  
		}
	  }
	}
	
	
	var 8505, name btn_adf, Link IOCARD_SW, Input 11, Device 12			// set radio in ADF mode
	{
	  if &radio_on = 1
	  {
		if &mode_adf = 0
		{
		  &mode_com1 = 0
		  &mode_com2 = 0
		  &mode_nav1 = 0  
		  &mode_nav2 = 0
		  &mode_xpndr = 0
		  &mode_bright = 0
		  &mode_adf = 1		// set active mode last		  
		}
	  }
	}
	
	
	var 8506, name btn_ils, Link IOCARD_SW, Input 10, Device 12			// set radio in Transponder mode
	{
	  if &radio_on = 1
	  {
		if &mode_xpndr = 0
		{		  
			&mode_com1 = 0
			&mode_com2 = 0
			&mode_nav1 = 0
			&mode_nav2 = 0
			&mode_adf = 0
			&mode_bright = 0
			&mode_xpndr = 1	// set active mode last
		}
	  }
	}
	
	var 8509, name btn_bfo, Link IOCARD_SW, Input 12, Device 12			// set radio to adjust brightness mode
	{
	  if &radio_on = 1
	  {
		if &mode_bright = 0
		{		  
			&mode_com1 = 0
			&mode_com2 = 0
			&mode_nav1 = 0
			&mode_nav2 = 0
			&mode_adf = 0
			&mode_xpndr = 0
			&mode_bright = 1	// set active mode last
		}
	  }
	}




// ******************************** COM1 MODE **********************

	var 8520, name mode_com1
	{
	  if &mode_com1 = 1
	  {	   
	   &led_vhf1 = 1
	   &O_AC_DP6DIG = 1
	   &O_ST_DP6DIG = 1
	   &D_AC_6DIG = &D_AC_COM1
	   &D_ST_6DIG = &D_ST_COM1	   
	  }
	  else
	  {
	   &led_vhf1 = 0
	   &D_AC_6DIG = -999999		// blank displays
	   &D_ST_6DIG = -999999
	   &O_AC_DP6DIG = 0
	   &O_ST_DP6DIG = 0
	  }
	}
	
	var 8521, name led_vhf1, Link IOCARD_OUT, Output 24, Device 12		// VHF1 button LED	


// ******************************** COM2 MODE **********************

	var 8540, name mode_com2
	{
	  if &mode_com2 = 1
	  {	   
	   &led_vhf2 = 1
	   &O_AC_DP6DIG = 1
	   &O_ST_DP6DIG = 1
	   &D_AC_6DIG = &D_AC_COM2
	   &D_ST_6DIG = &D_ST_COM2	   
	  }
	  else
	  {
	   &led_vhf2 = 0
	   &D_AC_6DIG = -999999		// blank displays
	   &D_ST_6DIG = -999999
	   &O_AC_DP6DIG = 0
	   &O_ST_DP6DIG = 0
	  }
	}
	
	var 8541, name led_vhf2, Link IOCARD_OUT, Output 25, Device 12		// VHF2 button LED	


// *******************  NAV1 MODE *******************

	var 8560, name mode_nav1
	{
	  if &mode_nav1 = 1
	  {
		&led_nav = 1
		&O_AC_DP5DIG = 1
		&O_ST_DP5DIG = 1
		&D_AC_5DIG = &D_AC_NAV1
		&D_ST_5DIG = &D_ST_NAV1
	  }
	  else
	  {
		&led_nav = 0
		&D_AC_5DIG = -999999	// blank displays
		&D_ST_5DIG = -999999
		&O_AC_DP5DIG = 0
		&O_ST_DP5DIG = 0
	  }
	}
	
	
	var 8561, name led_nav, Link IOCARD_OUT, Output 30, Device 12	// NAV button LED


// *******************  NAV2 MODE *******************

	var 8580, name mode_nav2
	{
	  if &mode_nav2 = 1
	  {
		&led_vor = 1
		&O_AC_DP5DIG = 1
		&O_ST_DP5DIG = 1
		&D_AC_5DIG = &D_AC_NAV2
		&D_ST_5DIG = &D_ST_NAV2
	  }
	  else
	  {
		&led_vor = 0
		&D_AC_5DIG = -999999	// blank displays
		&D_ST_5DIG = -999999
		&O_AC_DP5DIG = 0
		&O_ST_DP5DIG = 0
	  }
	}
	
	
	var 8581, name led_vor, Link IOCARD_OUT, Output 31, Device 12	// VOR button LED


// *******************  ADF MODE *******************

	var 8600, name mode_adf
	{
	  if &mode_adf = 1
	  {
		&led_adf = 1
		&O_AC_DP5DIG = 1
		&O_ST_DP5DIG = 1
		&D_AC_ADF = &D_A1Act
		&D_AC_ADF5 = &D_A1Act5
		&D_ST_ADF = &D_A1Stb
		&D_ST_ADF5 = &D_A1Stb5
	  }
	  else
	  {
		&led_adf = 0
		&D_AC_ADF = -999999	// blank displays
		&D_AC_ADF5 = -999999	
		&D_ST_ADF = -999999	
		&D_ST_ADF5 = -999999
		&O_AC_DP5DIG = 0
		&O_ST_DP5DIG = 0
	  }
	}
	
	
	var 8601, name led_adf, Link IOCARD_OUT, Output 28, Device 12	// ADF button LED


// *******************  XPNDR MODE *******************

	var 8640, name mode_xpndr
	{
	  if &mode_xpndr = 1
	  {
		&led_ils = 1
		&D_AC_XPNDR = &AtcDsp		// display XPNDR Code
		
		
		&D_ST_XPNDR1 = -999994		// display "ID" in STBY Display
		&D_ST_XPNDR2 = -999994
		&D_ST_XPNDR3 = 1
		&D_ST_XPNDR4 = -999995
		&D_ST_XPNDR5 = -999994
		&D_ST_XPNDR6 = -999994
	  
		
	  }
	  else
	  {
		&led_ils = 0
		&D_AC_XPNDR = -999999	// blank displays
		&D_ST_XPNDR1 = -999999
		&D_ST_XPNDR2 = -999999
		&D_ST_XPNDR3 = -999999
		&D_ST_XPNDR4 = -999999
		&D_ST_XPNDR5 = -999999
		&D_ST_XPNDR6 = -999999
	  }
	}
	
	
	var 8641, name led_ils, Link IOCARD_OUT, Output 27, Device 12	// ADF button LED



// *******************  BRIGHTNESS CONTROL MODE *******************

	var 8620, name mode_bright
	{
	  if &mode_bright = 1
	  {
	   &led_bfo = 1
	   &d_act_dp_brt = 1
	   &d_act_brt = 888888
	   &d_stby_brt_d = -999995 	// display "d"
	   
	   if &d_bright > 0							// if brightness level already set
	   {
			L0 = &d_bright / 121
			&d_stby_brt = L0 * 100
	   }
	   else										// else set default value 70% brightness on 1st access to mode
	   {
		   &d_bright = 121 * 0.7				
		   L0 = &d_bright / 121
		   &d_stby_brt = L0 * 100
	   }
	  }
	  else
	  {
		&led_bfo = 0
		&d_act_dp_brt = 0
		&d_act_brt = -999999
		&d_stby_brt = -999999
	  }
	}
	
	var 8621, name led_bfo, Link IOCARD_OUT, Output 29, Device 12		// BFO button LED
	
	var 8622, name d_bright, Link IOCARD_DISPLAY, Device 12 Digit 16, Numbers 3	// brightness control var/digit

	var 8623, name d_act_brt, link IOCARD_DISPLAY, digit 0, numbers 6, Device 12	// active display	
	var 8624, name d_stby_brt, link IOCARD_DISPLAY, digit 6, numbers 3, Device 12	// standby display
	
	var 8625, name d_act_dp_brt, link IOCARD_OUT, output 21, Device 12		// active decimal point

	var 8626, name ro_num_brt, link IOCARD_ENCODER, input 2, type 2, aceleration 4, Device 12	// encoder
	{
		IF &mode_bright = 1
		{
			L0 = &ro_num_brt * -1
			&d_bright = rotate 1,121,L0
			call &calc_brt
		}
	}
	
	var 8627, name calc_brt, link SUBRUTINE			// calculate brightness
	{
		L0 = &d_bright / 121
		L1 = L0 * 100
		&d_stby_brt = L1
	
	
	}

	var 8628, name d_stby_brt_d, link IOCARD_DISPLAY, digit 9, numbers 1, Device 12		// display "d" next to brightness value



// ****** END ******

mvr1918
Site Admin
Posts: 1704
Joined: Thu Aug 30, 2012 3:35 pm

Re: Airbus Radio Panel (solved working script attached)

Post by mvr1918 »

Thanks for sharing. I will have a look when time allows it.
oal163
Posts: 15
Joined: Mon Jan 03, 2022 1:35 pm

Re: Airbus Radio Panel (solved working script attached)

Post by oal163 »

Great job
I'm trying to do the same so can you tell me how you edit the script ?
Thanks
Spyros
mvr1918
Site Admin
Posts: 1704
Joined: Thu Aug 30, 2012 3:35 pm

Re: Airbus Radio Panel (solved working script attached)

Post by mvr1918 »

To edit a script(ssi file) to the following:

1. Open the ssi file from SIOC's Edit Script
2. Decompile the script and export it as a TXT file
3. Open the TXT script you just created in NOTEPAD and edit and save
4. Open the TXT file again and compile it from SIOC's Edit Script to a ssi file
oal163
Posts: 15
Joined: Mon Jan 03, 2022 1:35 pm

Re: Airbus Radio Panel (solved working script attached)

Post by oal163 »

Hi,
I managed to do it but it is not working.
Which programs should I run?
I run in the load sequence

a) IOCModules
b) OiMS
C) SIOC with the complied ssi

Thank you
mvr1918
Site Admin
Posts: 1704
Joined: Thu Aug 30, 2012 3:35 pm

Re: Airbus Radio Panel (solved working script attached)

Post by mvr1918 »

To start to use the correct driver and script when flying CJ4 you click the CJ4 airplane image in Oi4FS.
This is all in the documentation.
oal163
Posts: 15
Joined: Mon Jan 03, 2022 1:35 pm

Re: Airbus Radio Panel (solved working script attached)

Post by oal163 »

I was doing so but the panel as alweays dark and the only way to show turn on was to run the IOCModule.
That means that SIOC is not well configured?
S.
mvr1918
Site Admin
Posts: 1704
Joined: Thu Aug 30, 2012 3:35 pm

Re: Airbus Radio Panel (solved working script attached)

Post by mvr1918 »

Sorted out?
Post Reply