Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

C/O Button or IAS Mach Button not Working

Featured Replies

Hello everyone,

I'm using FSX SP2, also using standard aircraft not PMDG. C/O button is not changing air speed display value into decimal point when i assign AP_MACH_HOLD to a joystick's button. i don't know why?, otherwise it's working without joystick when I armed A/T First then enable Speed Hold and finally press C/O button. 

Please help me how do i resolve the problem? 

As asked over at the FSUIPC forum -
What stock aircraft are you actually referring to?
The 737, 747 & A321 all have different code for the C/O buttons.. It is not a built in command with FSX.
Examples -

B737-8

<Script>
  (M:Event) 'LeftSingle' scmp 0 == if{ 1 (&gt;L:IAS Mach Pressed,bool) 
  (G:Var6) 1 + 2 % (&gt;G:Var6,number) } 
  (G:Var6,number) 0 == (A:autopilot mach hold, bool) 1 == and
  if{ (&gt;K:AP_PANEL_SPEED_HOLD) }
  els{ (G:Var6,number) 1 == (A:autopilot airspeed hold, bool) 1 == and if{ (&gt;K:AP_MACH_HOLD) } } 
  (M:Event) 'LeftRelease' scmp 0 == if{ 0 (&gt;L:IAS Mach Pressed,bool) }
</Script>

A321

<Script>
  (M:Event) 'LeftSingle' scmp 0 == if{ 1 (&gt;L:IAS Mach Pressed,bool) 
  (G:Var6) 1 + 2 % (&gt;G:Var6,number) } 
  (M:Event) 'LeftRelease' scmp 0 == if{ 0 (&gt;L:IAS Mach Pressed,bool) }
</Script>

747-4

<!-- The 747 Doesn't have a C/O switch, it is automatically done when the individual speed hold type is engaged -->
<!-- SPEED HOLD -->
<Click>0 (>L:Mach-IAS select, bool) 0 (>K:AP_PANEL_SPEED_HOLD)</Click>
<!-- MACH HOLD -->
<Click>1 (>L:Mach-IAS select, bool) 0 (>K:AP_PANEL_MACH_HOLD)</Click>

Irregardless of which aircraft you use, a lua file along with FSUIPC will have to be used for joystick integration.
Not only that but the people over at MS used G:Vars for implementation in some aircraft for the autopilot -- BAD!, BAD!, MS!!
So... The autopilot will have to be modified to change G:Vars over to L:Vars so lua can be used.

Not a daunting task, just has to be done properly.

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

  • Author

Thanks spokes2112 for your response.

1 hour ago, spokes2112 said:

What stock aircraft are you actually referring to?

I'm using 737-800.

where I have to use above scripts?
please guide me.

Multiple items need to be done.. The above scripts are just examples showing the custom code used by Microsoft for the AP buttons. None of them can be used for what needs to be done.

This is what needs to be done..
1) The autopilot.xml located in FSX\SimObjects\Airplanes\B737_800\panel\B737_800.cab will have to be modified to reassign some G:Vars to L:Vars.
2) A .lua file will have to be made to incorporate buttons to FSUIPC
3) The joystick buttons needed assigned to the lua within FSUIPC

If wanted I can do the work for you, it may take a day or 2.. please advise. 

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

  • Author

Thank you very much spokes2112 for response.

1 hour ago, spokes2112 said:

I can do the work for you, it may take a day or 2

I'll be glad if you do the work for me. thanks again.

The code is done and fully tested..
Made 3 completely different versions, each one had their own little quirks, the last one fixing it all.
The hard part - writing the install instructions :laugh:
Should be done by the end of the day or earlier  ( US ), on it now with the morning coffee.

Stay tuned.

 

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

  • Author

Thank you spokes2112

12 minutes ago, spokes2112 said:

The code is done and fully tested..
Made 3 different versions, each one had their own little quirks, the last one fixing it all.

Wow! gud :)

15 minutes ago, spokes2112 said:

The hard part - writing the install instructions

May God make it easy for you. I'm waiting...May God bless you. Thanks again.

 

  • Author

Wow! it's working man :).

Under of Thanks spokes2112 for uploading and I appreciate your work.

all buttons and knobs are working great. again thanks alot.

  • 4 weeks later...
  • Author

Hello spokes2112,

the interface is crashing fsx when i fly other air craft except 737...when unload 737SpdControl.lua then fsx does not crach.
also help me how do i on/off C/O button using C# without touching fsuipc?

Ahh.. Possibly a small bug in the check routine. Just turn the routine off and it should work for you. 
Around line 7 change local a = 1 to local a = 0 
There will be no more confirmation of operation display after this, just check operation by toggling the C/O button or other lua command.

If that doesn't work just set it up as an [Auto.<profile name>] to start only with the stock 737.

Sorry, cant help with the C# portion - out of my league. Just FYI, all C/O buttons are custom for different aircraft.
There is no built in command for the operation.

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

  • Author

Thank you very much spokes2112...now it's working fine. not crashing...I converted your coButton lua code into C#...it's working also. :) 
 

private void coButton() {
     if (FSUIPCConnection.ReadLVar("CO_state") == 0)
        FSUIPCConnection.WriteLVar("CO_state", 1);
     else
        FSUIPCConnection.WriteLVar("CO_state", 0);

}

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.