• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX XML code works in VC but not in 2D cockpit

Messages
371
Country
france
Hi,

I don't understand why some instructions of my code don't work when I am in 2D cockpit (F10) then they work in virtual cockpit with the 2D panel displayed.

I have a xml gauge, without bitmap, which mnage the aircraft fuel system.

I have created in this gauge a header which set the aircraft in cold & dard situation at start of the fly.

So i have write the code for a real engine startup procedure; all work fine in when I am in virtual cokpit, but when I am in 2D cockpit (F10) some instructions are not executed.

in exemple, When the engine is started, I want to turn on the hydraulic pump and the engine geneartor.

I have wrote thses lines :

20 25 (A:Turb Eng1 N2,percent) rng (A:Hydraulic Switch:1, bool) 1 != and if{ 1 (>K:HYDRAULIC_SWITCH_TOGGLE) }
20 25 (A:Turb Eng2 N2,percent) rng (A:Hydraulic Switch:2, bool) 1 != and if{ 2 (>K:HYDRAULIC_SWITCH_TOGGLE) }
2400 2500 (A:Eng hydraulic pressure:1,psi) rng (A:General Eng1 Generator Switch, bool) 1 != and if{ 1 (>K:TOGGLE_ALTERNATOR1) }
2400 2500 (A:Eng hydraulic pressure:2,psi) rng (A:General Eng2 Generator Switch, bool) 1 != and if{ 1 (>K:TOGGLE_ALTERNATOR2) }

That's work good in VC but when I am in 2D cockpit, the hydraulic pump buttons and the generator switches don't turn on !

What is the possible reason of this bug ?

Thank you for your help.

Note : the aircraft that I modify is the Project Airbus A321
 
Last edited:
Hi,

try to set the flag "Update_When_Hidden" to TRUE in your gauge.
FSX will update your XML code even your panel window is not active.
Just give it a try.

Dietmar
 
Thanks Dietmar,

I will try this instruction tonight and tell you if it 's works.

Excuse me for my bad english.
 
If you are using ACE tool for your coding, I guess you should code :

(>K:HYDRAULIC_SWITCH_TOGGLE) instead of :
(>K:HYDRAULIC_SWITCH_TOGGLE)

For the alternator you did : (>K:TOGGLE_ALTERNATOR1) which is OK.

In case the change above works, don't ask me about the difference between VC and 2D panel in this regard.

Dietmar
 
...
That's work good in VC but when I am in 2D cockpit, the hydraulic pump buttons and the generator switches don't turn on !

What is the possible reason of this bug ?

Thank you for your help.

Note : the aircraft that I modify is the Project Airbus A321

I find here that (A:Hydraulic Switch:n, bool) doesn't exists as a var, it's just (A:Hydraulic Switch, bool).

If you place this code (properly written) on both VC and 2D panel, it's very probable the toggle event from the 2D panel will cancel the toggle event from the VC.
So, any code this kind must be placed only once in a gauge, and this gauge placed in the VC section.

Cannot say more without knowing the code in detail.


Tom
 
Also, this command is a simple on/off "toggle" and does not take a number either. There is only one switch for this event:

2 (>K:HYDRAULIC_SWITCH_TOGGLE)

In fact, what your script is actually doing is turning ON the hydraulic switch, then turning it OFF again in the second line! :eek:
 
I think we have even more issus in that string. The following string should look like this:

20 25 (A:TURB ENG N2:1,percent) rng
and not like this:
20 25 (A:Turb Eng1 N2,percent) rng .

I also did a simple test to see how I can toggle this VAR :

(A:HYDRAULIC SWITCH,bool) with this key:

(>K:HYDRAULIC_SWITCH_TOGGLE)

just to see whether this click turns the VAR from FALSE to TRUE. No way !
Could not find in the SDK any other VAR who may react on this key.
Just to mentioned it, the key HYDRAULIC_SWITCH_TOGGLE is a new FSX
key var. And why this works in a VC, no idea .

Dietmar
 
Hi,

try to set the flag "Update_When_Hidden" to TRUE in your gauge.
FSX will update your XML code even your panel window is not active.
Just give it a try.

Dietmar

doesn't work ....


If you are using ACE tool for your coding, I guess you should code :

(>K:HYDRAULIC_SWITCH_TOGGLE) instead of :
(>K:HYDRAULIC_SWITCH_TOGGLE)

For the alternator you did : (>K:TOGGLE_ALTERNATOR1) which is OK.

In case the change above works, don't ask me about the difference between VC and 2D panel in this regard.

Dietmar

Not change. I use in my code the two case of wrting ; no change between > and >


Also, this command is a simple on/off "toggle" and does not take a number either. There is only one switch for this event:

2 (>K:HYDRAULIC_SWITCH_TOGGLE)

In fact, what your script is actually doing is turning ON the hydraulic switch, then turning it OFF again in the second line! :eek:

1 is for toggle the first engine hydraulic pump
2 is for toggle the second engine hydraulic pump
3 is for toggle the backup electric hydraulic pump

that's work perfectly in the VC. or for the 2 overhead buttons


I think we have even more issus in that string. The following string should look like this:

20 25 (A:TURB ENG N2:1,percent) rng
and not like this:
20 25 (A:Turb Eng1 N2,percent) rng .

Dietmar

no change.


I think that the problem is in the panel.cfg.

If I declare a gauge in a window section, that's work in the 2d cockpit

If i declare the gauge in the VCockpit section, that's work in the VC.

But it is impossible to make working in he 2 mode in the same time (2D et VC.
s
I become crazy !!
 
I've already told you that you can't place this code, as it is written, in both 2D and VC gauges (or the same gauge in both modes), because the HYDRAULIC_SWITCH_TOGGLE event in the 2D panel is going to cancel the same event fired in VC as the AVar won't be actualized until the panel cycle is completed.
You should place it only in VC and it's going to work Ok as VC gauges are always executed no matter the sim starts or is in 2D view mode.

Tom
 
You should place it only in VC and it's going to work Ok as VC gauges are always executed no matter the sim starts or is in 2D view mode.

Oddly enough Tom, such gauges in FSX should go in the "highest" [VCockpitnn] section, unlike FS9 where they should go in the "first" VC section... :cool:
 
1 is for toggle the first engine hydraulic pump
2 is for toggle the second engine hydraulic pump
3 is for toggle the backup electric hydraulic pump

that's work perfectly in the VC. or for the 2 overhead buttons

You may have stumbled into a situation where it "sorta works," but the fact remains that in FS9/FSX there is one -and only one- hydraulic pump. Period.

Check the SDK and note that it is one of the few variables that does not take an index value.

EDIT: Nevermind, Tom pointed out (below) that the FSX SDK is in error, once again...
 
Last edited:
You may have stumbled into a situation where it "sorta works," but the fact remains that in FS9/FSX there is one -and only one- hydraulic pump. Period.

Check the SDK and note that it is one of the few variables that does not take an index value.

Bill, the SDK is wrong, unfortunately (once again...::confused:) Check the A321 cab and see by yourself. Both the AVar readings and KEvent are right; the problem is in the duplicated event as I stated above.

Tom
 
Bill, the SDK is wrong, unfortunately (once again...::confused:)
:( Well I'll be hornswoggled! And to think ACES actually hired a so-called expert to update and edit the FSX SDK for them...

Boy did he ever rip them off! :eek:
 
I've already told you that you can't place this code, as it is written, in both 2D and VC gauges (or the same gauge in both modes), because the HYDRAULIC_SWITCH_TOGGLE event in the 2D panel is going to cancel the same event fired in VC as the AVar won't be actualized until the panel cycle is completed.
You should place it only in VC and it's going to work Ok as VC gauges are always executed no matter the sim starts or is in 2D view mode.

Tom

Hello taguilo

My english is very poor, and I would be sure that I understand that you tell.

To summurise, I have wrote some code to create a real cold & dark situation for my aircraft and a real engine startup procedure.
For that, I have created a gauge, without bitmap.

I have declared my gauge in the panel.cfg file in the [Window00] section, with 0,0,0,0 attribute and also in the [VCockpit01] section, also with the 0,0,0,0 attribute.

Here is my error ?

I must declare only in [VCockpit01] section ? and it will work in 2D cockpit ?

Here is my panel.cfg :

[Window Titles]
Window00=MAIN PANEL
Window01=RADIO STACK
Window02=GPS
Window03=THROTTLE
Window04=OVERHEAD
Window05=GEAR
Window06=CLOCK
Window07=ECAMS 2
Window08=PFD FULL SIZE
Window09=MFD FULL SIZE
Window10=ECAMS FULL SIZE
Window11=ECAMS 2 FULL SIZE
Window12=MINI PANEL


[Window00]
file_1024=airbus_a321_panel_background.bmp
file_1024_night=airbus_a321_panel_background_night.bmp
size_mm=1024
position=7
visible=1
ident=MAIN_PANEL

gauge00=A321_FD!altimeter_backup, 676,505
gauge01=A321_FD!annunciator_panel_1, 24,357
gauge02=A321_FD!attitude_backup, 651,628
gauge03=A321_FD!autopilot, 677,346
gauge04=A321_FD!hsi_backup, 517,609
gauge05=A321_FD!ias_backup, 581,506
gauge06=A321_FD!A_PFD, 23,521,215,214
gauge07=A321_FD!A_MFD, 264,521,215,214
gauge08=A321_FD!A_ECAMS, 788,521,215,214
gauge09=A321_FD!A_PFD_MFD_SEL_PANEL, 470,345
gauge10=SimIcons1024!ECU Icon, 790, 745
gauge11=SimIcons1024!Overhead Icon, 812, 745
gauge12=SimIcons1024!Kneeboard Icon, 834, 745
gauge13=SimIcons1024!ATC Icon, 856, 745
gauge14=SimIcons1024!Map Icon, 878, 745
gauge15=SimIcons1024!GPS Icon, 900, 745
gauge16=SimIcons1024!Radio Icon, 922, 745
gauge17=SimIcons1024!Other Controls Icon, 944, 745
gauge18=SimIcons1024!Engine Instruments Icon, 966, 745
gauge19=SimIcons1024!Clock Icon, 988, 745
gauge20=n_number_plaque!n_number_plaque, 258,429,67,19
gauge21=A321_FD!A_SFCC, 0,0,0,0
gauge22=A321_FD!A_AUTOFLARE, 0,0,0,0
gauge23=CALLOUT_SOUND!dsd_xml_sound3, 0,0,0,0, ./Sound/CALLOUT_1/Sound.ini
gauge24=A321_FD!A_CALLOUT, 0,0,0,0
gauge25=A321_FD!FD_Vnav, 0,0,0,0
gauge26=A321_FD!FD_Fuel_system, 0,0,0,0


[Window01]
size_mm=246,296
position=8
visible=0
BACKGROUND_COLOR=16,16,16
ident=RADIO_STACK_PANEL

gauge00=A321_FD!popup_radio, 0, 0


[Window02]
size_mm=456,378
window_size=0.5
position=8
BACKGROUND_COLOR=0,0,0
VISIBLE=0
ident=GPS_PANEL

gauge00=fs9gps!gps_500, 0,0


[Window03]
size_mm=279,479
position=0
visible=0
BACKGROUND_COLOR=0,0,0
ident=THROTTLE_PANEL

gauge00=A321_FD!A_POPUP_ECU, 0, 0
gauge01=A321_FD!FD_Fuel_system, 0,0,0,0

[Window04]
size_mm=761,354
position=2
visible=0
BACKGROUND_COLOR=0,0,0
ident=OVERHEAD_PANEL

gauge00=A321_FD!popup_overhead, 0, 0


[Window05]
size_mm=252,277
position=7
visible=0
BACKGROUND_COLOR=0,0,0
ident=MISC_POPUP_1

gauge00=A321_FD!A_POPUP_GEAR,0,0

[Window06]
size_mm=105,105
position=6
visible=0
BACKGROUND_COLOR=0,0,0
ident=270

gauge00=A321_FD!popup_clock,0,0


[Window07]
size_mm=514,270
position=7
visible=0
BACKGROUND_COLOR=0,0,0
ident=200

gauge00=A321_FD!A_POPUP_ECAMS_SCREEN_BEZEL_SMALL, 256,0
gauge01=A321_FD!B_ECAMS2, 277, 24,215,214


[Window08]
Background_color=0,0,0
size_mm=341,353 // 1024,768
position=6 // 0
visible=0
ident=500

gauge00=A321_FD!popup_pfd_mfd_screen_bezel, 0,0,341,353 //0,415,341,353
gauge01=A321_FD!A_PFD, 27,24,289,289 //26,441,289,289



[Window09]
Background_color=0,0,0
size_mm=341,353 // 1024,768
position=7
visible=0
ident=501

gauge00=A321_FD!popup_pfd_mfd_screen_bezel, 0,0,341,353 //341,415,341,353
gauge01=A321_FD!A_MFD, 27,24,289,289 //367,441,289,289


[Window10]
Background_color=0,0,0
size_mm=341,353 // 1024,768
position=8
visible=0
ident=502

gauge00=A321_FD!popup_pfd_mfd_screen_bezel, 0,0,341,353 //683,415,341,353
gauge01=A321_FD!A_ECAMS, 27,24,289,289 //707,441,289,289


[Window11]
Background_color=0,0,0
size_mm=341,353 // 1024,768
position=8
visible=0
ident=503

gauge00=A321_FD!A_POPUP_ECAMS_SCREEN_BEZEL, 0,0,341,353 //683,415,341,353
gauge01=A321_FD!B_ECAMS2, 27,24,289,289 //707,441,289,289


[Window12]
position=7
size_mm=530,260
child_3d=1
background_color=0,0,0
ident=MINIPANEL
gauge00=A321_FD!popup_pfd_mfd_screen_bezel, 0, 0, 260, 260
gauge01=A321_FD!A_PFD, 23, 18, 215, 214
gauge02=A321_FD!popup_pfd_mfd_screen_bezel, 262, 0, 260, 260
gauge03=A321_FD!A_MFD, 285, 18, 215, 214


[VCockpit01]
size_mm=1024,1024
pixel_size=1024,1024
texture=$A321_1
background_color=0,0,0
visible=1
gauge00=A321_FD!popup_clock, 859,626,105,105
gauge01=A321_FD!popup_overhead, 1,1,761,354
gauge02=A321_FD!hsi_backup, 859,735,114,135
gauge03=A321_FD!B_ECAMS2, 2,356,283,282
gauge04=A321_FD!A_ECAMS, 2,639,283,282
gauge05=A321_FD!attitude_backup, 858,518,105,104
gauge06=A321_FD!annunciator_panel_1, 574,412,438,103
gauge07=A321_FD!ias_backup, 4,941,79,79
gauge08=A321_FD!altimeter_backup, 91,940,79,80
gauge09=A321_FD!popup_radio, 765,114,246,296
gauge10=A321_FD!A_POPUP_ECU, 576,517,279,479
gauge11=A321_FD!A_PFD_MFD_SEL_PANEL, 765,1,207,110
gauge12=A321_FD!A_PFD, 287,357,283,282
gauge13=A321_FD!A_MFD, 287,640,285,285
gauge14=n_number_plaque!n_number_plaque, 574,360,89,25
gauge15=A321_FD!A_SFCC, 0,0,0,0
gauge16=A321_FD!A_AUTOFLARE, 0,0,0,0
gauge17=CALLOUT_SOUND!dsd_xml_sound3, 0,0,0,0, ./Sound/CALLOUT_1/Sound.ini
gauge18=A321_FD!A_CALLOUT, 0,0,0,0
gauge19=A321_FD!FD_Vnav, 0,0,0,0
gauge20=A321_FD!FD_Fuel_system, 0,0,0,0


[VCockpit02]
size_mm=512,512
pixel_size=512,512
texture=$A321_2
background_color=0,0,0
visible=1
gauge00=A321_FD!A_POPUP_GEAR, 19,12,252,277
gauge01=A321_FD!autopilot, 19,297,339,110
gauge02=A321_FD!A_SFCC, 0,0,0,0



[Default View]
X=0
Y=0
SIZE_X=8192
SIZE_Y=3250

[Color]
Day=255,255,255
Night=200,200,200 //255,255,255
Luminous=147,64,64

FD_Fuel_system is my gauge that initialize the aircraft, manage the engine startup and the aircraft fuel system.

With this last redaction, that's work for me; but some user, who help me to create this aircraft have some problems, other's not.

The problem is that I don't speak as well english and I have difficulty to explain the problem.

but on some computer, the aircrafts works fine, on others computer it doesn't work.

And FSX seems to have a cache memory and keep some paramters of the defaut saved flight or the previous flight and the result is different for each persons.

I will not bore you any longer, but I do not quite understand the logic of the statement panel.cfg, I'll try to find documentation about it.

But this is a silly idea that the code works in 10 different ways depending upon the person using it
 
I must declare only in [VCockpit01] section ? and it will work in 2D cockpit ?

Yes, that's it. And it will also work in 2D cockpit, because VC sections are loaded first and are always visible.
I would suggest as well that you write, for example, 0,0,5,5 instead of 0,0,0,0 so the gauge can be easily handled within a panel editor like FS Panel Shop.

Tom
 
Taguilo; You are say right ! That's works. No conflict

I have dielete of the main pae, [window00] all my specific gauge (SFCC, Autoflare, FD_fuel_system and Vnav.

There are only in the [VCockpit01]

All seem work fine, in VC and 2D cockpit.

So, that's work, because in my FSX menu configuration, I have selected the 3D cockpit by default.

But if I select 2D cockpit in the FSX menu, all my gauge don't work. the [VCockpit01] is not read à startup.

So, I want give this aircraft at the sim comunity and some users fly only in 2D cockpit.

Is There a solution for these gauge works in all cases ( for user who are selected the 2D cockpit or the 3D cokpit in FSX ?

Thanks
 
Put the gauge in the last [VCockpitnn] section!

Unlike FS9, FSX begins loading gauges from the last entry in the VC section of the panel.cfg file.
 
Hi n4gix,

This is the second time that you save my project !!!

That's works !! I have declared my gauges only at the end of the [VCockpit02] and, if I set the FSX menu option "Cockpit 2D", my gauges work !! they work in 2D mode and VC mode. no conflict, and no bugs !!!


Thank you very much at you and Taguilo

One week that I was in battle with my aircraft and you have found the solution in 3 messages !

many many many thanks !

François
 
Back
Top