Guido Posted August 1 Report Posted August 1 As I could not find an event/preset for synching the HSI heading bug to current heading, for use with the GFC 500 AP, I traced the event. It looks like this: 0000174861 Event: 066042 Event Data: 000263 Event Name: HEADING_BUG_SET I wonder if something like this is possible with a FSUIPC Macro: //Read actual heading const HSIDegree = SimVar.GetSimVarValue('HSI BEARING', 'degree'); //Set heading bug to actual heading SimVar.SetSimVarValue('HEADING_BUG_SET', ' HSIDegree ', '0'); Or how this could be implemented for us in FSUIPC. Appreciate advice how to or if the event already exists the link to the event. Rgds, Guido
John Dowson Posted August 1 Report Posted August 1 12 minutes ago, Guido said: I could not find an event/preset for synching the HSI heading bug to current heading, for use with the GFC 500 AP I don't know this AP - which aircraft is it in? How do you do this (synch the HSI heading bug) on the AP (in the VC)? 15 minutes ago, Guido said: t looks like this: 0000174861 Event: 066042 Event Data: 000263 Event Name: HEADING_BUG_SET I wonder if something like this is possible with a FSUIPC Macro: //Read actual heading const HSIDegree = SimVar.GetSimVarValue('HSI BEARING', 'degree'); //Set heading bug to actual heading SimVar.SetSimVarValue('HEADING_BUG_SET', ' HSIDegree ', '0'); Or how this could be implemented for us in FSUIPC. Appreciate advice how to or if the event already exists the link to the event. HEADING_BYG_SET is an event, or FS Control, not a simvar. You can assign to this, but you need to provide the value/parameter. If no control (hvar, lvar, preset, input event) is available and you want to do this, you would need to write a simple lua script to get the bearing and then set it. The script would read the HSI BEARING from offset 0x2FA8 and then send the HEADING_BUG_SET event/control: bearing = ipc.readUW(0x2FA8) ipc.control(66042, bearing); However, offset 0x2FA8 should hold the HSI BEARING simvar, but this is documented as untested with comment 'Doesn’t seem to work. Feedback?'. So, I would first monitor this offset (using FSUIPC's offset monitoring facilities) to verify that it is indeed holding the correct value.
ark1320 Posted August 1 Report Posted August 1 I don't have the GFC500 AP, but the below works with the Flysimware Lear35, and with the C414 which has a Garmin 605 AP. A user defined preset: SYNC_HDG_BUG_TO_CURRENT_HDG#(A:PLANE HEADING DEGREES MAGNETIC, degrees) (>K:HEADING_BUG_SET) or basically the same thing as a one line Lua script called SyncHeadingBug.lua ipc.execCalcCode(" (A:PLANE HEADING DEGREES MAGNETIC, degrees) (>K:HEADING_BUG_SET) ") Al 1
John Dowson Posted August 1 Report Posted August 1 On 8/1/2024 at 5:26 PM, ark1320 said: I don't have the GFC500 AP, but the below works with the Flysimware Lear35, and with the C414 which has a Garmin 605 AP. A user defined preset: SYNC_HDG_BUG_TO_CURRENT_HDG#(A:PLANE HEADING DEGREES MAGNETIC, degrees) (>K:HEADING_BUG_SET) or basically the same thing as a one line Lua script called SyncHeadingBug.lua ipc.execCalcCode(" (A:PLANE HEADING DEGREES MAGNETIC, degrees) (>K:HEADING_BUG_SET) ") Probably a better solution rather than using the HSI BEARING simvar unless this is correct. If so, you could use the following preset: SYNC_HDG_BUG_TO_HSI_HDG#(A:HSI BEARING, degrees) (>K:HEADING_BUG_SET) Suggest @Guido tries both - add them to your myevents.txt file (create this if not present) and try them both. I will take a look later if I have time, but am rather busy and am on holiday from tomorrow until the 5th (inclusive), so it may be next week. John
ark1320 Posted August 1 Report Posted August 1 16 minutes ago, John Dowson said: Probably a better solution rather than using the HSI BEARING simvar ... Yes, you don't want to use the HSI BEARING variable to sync the heading bug. The SDK shows this: 1
John Dowson Posted August 1 Report Posted August 1 Thanks @ark1320 - should have checked the MSFS documentation on this. Hopefully @Guido can try your preset using PLANE HEADING DEGREES MAGNETIC simvar. Any further issues, I will take a look next week (back on support on the 6th). John
Guido Posted August 3 Author Report Posted August 3 Thank you very much for help. I appreciate it very much. AP GFC 500: The AP is part of the MSFS X Cub delivery (VC). About the source I think it is Asobo. Together with the G3x (Working Title Sim) and external GTN 650 (TDS Sim) it is an easy-to-use AP offering amazing system functionality. The APs two rotary knobs push functions synch the heading bug with the current heading and AP alt preset with current alt. Fast and less dialing. I will check the proposed two ways by adding it to myevents.txt by second half of next week (after 7th). Meanwhile I study the proposed implementations.
John Dowson Posted August 6 Report Posted August 6 On 8/3/2024 at 12:10 PM, Guido said: The APs two rotary knobs push functions synch the heading bug with the current heading and AP alt preset with current alt. Fast and less dialing. There is already a preset for the alt sync, XCub Ap Alt Push, whose preset code does some thing similar to that proposed for the heading: (A:INDICATED ALTITUDE, feet) (>K:AP_ALT_VAR_SET_ENGLISH)
Guido Posted August 8 Author Report Posted August 8 Outcome of today’s tests: The following two LUA and Preset implementations work: -- LUA implementation 1 ipc.execCalcCode(" (A:PLANE HEADING DEGREES GYRO, degrees) (>K:HEADING_BUG_SET) ") -- LUA implementation 2 bearing = ipc.readUW(0x2FA8) ipc.control(66042, bearing); And Presets: SYNC_HDG_BUG_TO_HSI_HDG1#(A:PLANE HEADING DEGREES GYRO, degrees) (>K:HEADING_BUG_SET) SYNC_HDG_BUG_TO_HSI_HDG2#(A:PLANE HEADING DEGREES MAGNETIC, degrees) (>K:HEADING_BUG_SET) However, I struggle with the ALT command: SYNC_AP_ALT_TO_ACT_ALT0#(A:PLANE ALTITUDE, feet) (>K:AP_ALT_VAR_SET_ENGLISH) (real alt) As the Preset XCub Ap Alt Push (altimeter alt) Both work as strange as the mouse click implementation: Step down/up by 100ft until reaching the actual Alt by +/- 100ft.
John Dowson Posted August 8 Report Posted August 8 30 minutes ago, Guido said: However, I struggle with the ALT command: SYNC_AP_ALT_TO_ACT_ALT0#(A:PLANE ALTITUDE, feet) (>K:AP_ALT_VAR_SET_ENGLISH) (real alt) As the Preset XCub Ap Alt Push (altimeter alt) Both work as strange as the mouse click implementation: Step down/up by 100ft until reaching the actual Alt by +/- 100ft. Why not use the included preset XCub Ap Alt Push which uses INDICATED ALTITUDE instead of PLANE ALTITUDE?
ark1320 Posted August 8 Report Posted August 8 4 hours ago, Guido said: -- LUA implementation 2 bearing = ipc.readUW(0x2FA8) ipc.control(66042, bearing); Just to be clear, this Lua script will not sync the heading bug to the aircraft current magnetic heading in all cases. For example, if the NAV/HSI is in GPS mode, the value in offset 0x2FA8 seems to be the bearing to the next GPS waypoint in the flight plan, which may not be the current aircraft magnetic heading. Al
John Dowson Posted August 8 Report Posted August 8 42 minutes ago, ark1320 said: Just to be clear, this Lua script will not sync the heading bug to the aircraft current magnetic heading in all cases. For example, if the NAV/HSI is in GPS mode, the value in offset 0x2FA8 seems to be the bearing to the next GPS waypoint in the flight plan, which may not be the current aircraft magnetic heading. This is because you are using offset 0x2FA8, which is HSI BEARING, which, as pointed out earlier, holds: You should try with offset 0x0580 (PLANE HEADING DEGREES TRUE) or 0x2B00 (PLANE HEADING DEGREES GYRO). If you want to use PLANE HEADING DEGREES MAGNETIC, you would need to add this to an offset. Note also that for some offsets, you will need to convert the offset value to degrees before applying (e.g. for 0x0580 you have to *360/(65536*65536) to convert to degrees). Or just use a preset or calc code - easier!
Guido Posted August 8 Author Report Posted August 8 Why not use the included preset XCub Ap Alt Push which uses INDICATED ALTITUDE instead of PLANE ALTITUDE? XCub Ap Alt Push: It has the same issue therefore I tested a different option. (Issue: With each push one 100ft step down/up until reaching the actual Alt by +/- 100ft)
John Dowson Posted August 9 Report Posted August 9 12 hours ago, Guido said: It has the same issue therefore I tested a different option. (Issue: With each push one 100ft step down/up until reaching the actual Alt by +/- 100ft) Isn't this the same behavior you see when you push the button in the VC?
Guido Posted August 11 Author Report Posted August 11 Yes, it is the case. But as this does not reflect the real behavior I opted for an improved method to synch with the current altitude. But failed. GFC 500 Manual: 2) Select Altitude and use the Selection Knob to change the Selected Altitude. Syncing to the current altitude: Press the ALT SEL Knob on the GMC 507
John Dowson Posted August 11 Report Posted August 11 2 hours ago, Guido said: Yes, it is the case. Ok. 2 hours ago, Guido said: GFC 500 Manual: 2) Select Altitude and use the Selection Knob to change the Selected Altitude. Syncing to the current altitude: Press the ALT SEL Knob on the GMC 507 If the implementation of this AP is different from the real thing, I cannot do anything about this. Try asking about this on the support for the aircraft.
Guido Posted August 14 Author Report Posted August 14 OK. The important click is heading and this works. Thanks for support.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now