Jump to content
The simFlight Network Forums

Offset 298 AUTOPILOT SPEED SLOT INDEX not working for WRITING on A32NX?


Sergiohst
 Share

Recommended Posts

Hi !!

I can read Speed slot "Managed" / "Selected"  ( Values 2 and 1 ) Ok, but writing the values does nothing (from c#, .net client, .SetValue(1) or .SetValue(2))

Also tried to change the value with  H:A320_Neo_CDU_MODE_SELECTED_SPEED , H:A320_Neo_CDU_MODE_MANAGED_SPEED but A32NX is not responding to these Hvars ...

 

Anyone has these working??  Thanks!

Link to comment
Share on other sites

Hi!! I've found a solution this way:  when physical button pressed to toggle managed/selected, I check the actual status with offset 298, that is working for reading, and then change status with:

FSUIPCConnection.SendControlToFS(68066, 1); //SPEED_SLOT_INDEX_SET   ->> sets to selected

OR

FSUIPCConnection.SendControlToFS(68066, 2); -> sets to managed

there is a caveat and is that when set to "selected" this way, actual PFD speed is Ok, maintains the same speed as when managed, an AP stays in that speed, but the AP PANEL Speed showed is always 100.   When you start to adjust speed it starts in that 100 stated.

 

 

 

 

Link to comment
Share on other sites

2 hours ago, Sergiohst said:

Hi!! I've found a solution this way:  when physical button pressed to toggle managed/selected, I check the actual status with offset 298, that is working for reading, and then change status with:

FSUIPCConnection.SendControlToFS(68066, 1); //SPEED_SLOT_INDEX_SET   ->> sets to selected

OR

FSUIPCConnection.SendControlToFS(68066, 2); -> sets to managed

This is very strange, as 68066 is the Speed Slot Index Set control, and is the same control sent when writing to offset 0x0298. You could try activating logging for Events, to check what is actually being sent when you write to that offset.

2 hours ago, Sergiohst said:

actual PFD speed is Ok, maintains the same speed as when managed, an AP stays in that speed, but the AP PANEL Speed showed is always 100.   When you start to adjust speed it starts in that 100 stated.

Which offsets (or lvars) are you using for this? Maybe try the following offsets to see what they contain:
    0x2F48 - Autopilot Cruise Speed Hold
    0x3458 - Autopilot Airspeed Hold Var
    0x3BD7 - Partial Panel Airspeed
    0x07DC - Autopilot Airspeed Hold
    0x07E2 - Autopilot Airspeed Hold Var
Otherwise, it may be worth asking about this on the FBW support/discord channel.


    
 

Link to comment
Share on other sites

Hi!

new Offset<int>(0x0298).SetValue(1);

or

new Offset<int>(0x0298).SetValue(2);

Does nothing and not event is shown in Fsuipc console log.

 

FSUIPCConnection.SendControlToFS(68066, 2) generates this log entry:

2266563 *** EVENT: Cntrl= 68066 (0x000109e2), Param= 2 (0x00000002) SPEED_SLOT_INDEX_SET

and it works fine.

About the speed change to 100 in AP PANEL when changing SPEED_SLOT_INDEX_SET from 2 to 1,  it's automatic , maybe a bug in FBW system ...

will try to set the real speed with offsets / lvars you suggested to correct the situation. 

 

Thanks John!

Link to comment
Share on other sites

4 hours ago, Sergiohst said:

new Offset<int>(0x0298).SetValue(1);

or

new Offset<int>(0x0298).SetValue(2);

Does nothing and not event is shown in Fsuipc console log.

You need to check your code and/or ask on Paul Henty's .net client sub-forum.
I have checked the offset by assigning a couple of buttons to write either 1 or 2 to offset 0x0298, and this is recognised, the SPEED_SLOT_INDEX_SET control/event is sent and the offset value updated, as can be seen from this log extract:

Quote

   941516 126588 Button changed: bRef=0, Joy=101, Btn=9, Pressed
   941516 126588 [Buttons] 31=P101,9,Cx03000298,x00000002
   941516 126588 IPC Offsets Control: Ctrl=x0300, Length=4, Offset=0298, Param=x2
   941532 126588 Monitor IPC:0298 (U32) = 2
   941547 126588 *** EVENT: Cntrl= 68066 (0x000109e2), Param= 2 (0x00000002) SPEED_SLOT_INDEX_SET
   941672 126588 JoystickValues PCnum=0, dwCount=1, data[2]={00000065 00000000}
   941672 126588 Button changed: bRef=0, Joy=101, Btn=9, Released
   946922 126588 JoystickValues PCnum=0, dwCount=1, data[2]={00000065 00000100}
   946922 126588 Button changed: bRef=0, Joy=101, Btn=8, Pressed
   946938 126588 [Buttons] 30=P101,8,Cx03000298,x00000001
   946938 126588 IPC Offsets Control: Ctrl=x0300, Length=4, Offset=0298, Param=x1
   946938 126588 Monitor IPC:0298 (U32) = 1
   946938 126588 *** EVENT: Cntrl= 68066 (0x000109e2), Param= 1 (0x00000001) SPEED_SLOT_INDEX_SET
   947141 126588 JoystickValues PCnum=0, dwCount=1, data[2]={00000065 00000000}
   947141 126588 Button changed: bRef=0, Joy=101, Btn=8, Released
   ...

I therefore think there must be something wrong in your code (sorry, I don't use C# or the .net client so can't help with this). You can also try updating the offset directly (via an assignment or using lua) to confirm.

John

Link to comment
Share on other sites

Been reading this thread with interest even though I do not own MSFS.
Just wondering, are you actually flying the aircraft when testing?
Many advanced aircraft will act the same way, not broken, if going from managed to selected speed and not moving. Think about it, going to managed speed the autothrottle speed is taken care of... IE the FMC is injecting "a" speed for the autothrottle to follow whereas going to selected speed it does not. The autothrottle has no idea what speed you are flying at. This portion "might" be taken care of with internal logic embedded within the autothrottle button push code in the model ( something you might have to take care of yourself ). The 100 is coming up as a autothrottle lower limit "AND" as a warning to the pilot. It may work correctly if you are flying the plane.?.?.?.

Here is the logic behind it, written in human terms.
On press/pull of the auto throttle speed knob :

If "speed slot" equals "selected" then  // ((A:AUTOPILOT SPEED SLOT INDEX,Number) equals 1)
	Send FS control #68066 with a parameter of 2 // Managed is commanded, this part is done
Else
	Send FS control #68066 with a parameter of 1 // Selected is commanded, more code might be necessary 
	// Do the following code only if flying AND a "100" comes up on the speed window
		If INDICATED AIRSPEED (0x02BC) > 100 kts then
			INDICATED AIRSPEED (0x02BC) send to --> AUTOPILOT AIRSPEED HOLD VAR (0x07E2)
		Else
			a value of 100 send to --> AUTOPILOT AIRSPEED HOLD VAR (0x07E2)
		End
End

Just another set of eyes looking at it, hope it might help.
Roman

 

Link to comment
Share on other sites

The OPs issue must be with the code, as updating the offset does send the correct control (SPEED_SLOT_INDEX_SET), and it does have an effect - when the engines are running, as the related simvar (AUTOPILOT SPEED SLOT INDEX) is updated and the new value received and populated in offset 0x0298. If it was not possible to do this due to the aircraft state,  the control would still be sent but would have no affect, i.e. the AUTOPILOT SPEED SLOT INDEX simvar would not be updated and no change in value would be seen in offset 0x0298.

John

 

Link to comment
Share on other sites

John,

Agree with you 100%
It looks to me, from logs, that the command / param C68066 and the read offset 0x0298 work just fine. 
At one point the thread went on a small tangent (below) and I replied to that plus missed your suggestion in a reply.
Sorry for wasting your time!
Although, for knowledge sake, I wonder if updating the current aircraft speed to the autothrottle speed window cured it. 

Roman

On 8/22/2021 at 4:16 AM, Sergiohst said:

there is a caveat and is that when set to "selected" this way, actual PFD speed is Ok, maintains the same speed as when managed, an AP stays in that speed, but the AP PANEL Speed showed is always 100.   When you start to adjust speed it starts in that 100 stated.

On 8/22/2021 at 6:57 AM, John Dowson said:

Which offsets (or lvars) are you using for this? Maybe try the following offsets to see what they contain:
.... continued - Otherwise, it may be worth asking about this on the FBW support/discord channel.

 

Link to comment
Share on other sites

Hi !! 

Yes, I'm testing while flying, with AP activated, and when change from SLOT 2 to 1  (Managed to Selected), plane continues flying same speed as managed , and FD colored text with selected speed stays correct, it's in the AP panel hold speed (now selected speed) that is 100 shown, and while I don't touch speed knob plane continues flying current speed (250 lets say) , as speed is manually increased 1 point (to 101) , FD speed is updated to 101 and plane starts to slow down ... See the logic in your assumption, that would have made sense, thanks !!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.