plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

donstim avatar image
donstim asked Boris_ commented

Fuel System Trigger Issues

I am having some issues with the fuel system triggers. First, it appears that there is a typo in the SDK regarding the fuel tank imbalance conditions. The SDK says (for the imbalance below condition for example) :

"Checks if there is a relative fuel imbalance between two tanks below the given Threshold (threshold in Gallons). Requires the Target key to hold two tank names, eg:

#Target=TankLeft,TankRight"

I think this should be "#Target:TankLeft,TankRight", that is, a colon instead of an equals sign after the #Target.

Second, I am trying to use the StopTrigger event to prevent a trigger from occurring, but am unable to get it to work. I would like to use a fuel imbalance trigger to open certain fuel valves, but only if the overall fuel quantity in the associated tanks is less than a certain value.

The triggers I have (at this point in development) are:

Trigger.1 = Name:SetFwdGalleryJunc1#Target:LeftInner#Threshold:1#Condition:TankQuantityAbove#EffectTrue:SetJunction.FwdGalleryJunction.1

Trigger.2 = Name:InnerXfer1Start#Target:Feed1#Threshold:6437#Condition:TankQuantityBelow#EffectTrue:OpenValve.FeedTank1FwdTransferValve,StopTrigger.InnerXfer4Start

Trigger.3 = Name:InnerXfer2Start#Target:Feed2#Threshold:6858#Condition:TankQuantityBelow#EffectTrue:OpenValve.FeedTank2FwdTransferValve

Trigger.4 = Name:InnerXfer3Start#Target:Feed3#Threshold:6858#Condition:TankQuantityBelow#EffectTrue:OpenValve.FeedTank3FwdTransferValve

Trigger.5 = Name:InnerXfer4Start#Target:Feed4#Threshold:6437#Condition:TankQuantityBelow#EffectTrue:OpenValve.FeedTank4FwdTransferValve,StopTrigger.InnerXfer1Start

Trigger.6 = Name:FeedTank1EndRefill#Target:Feed1#Threshold:6765#Condition:TankQuantityAbove#EffectTrue:CloseValve.FeedTank1FwdTransferValve,StopTrigger.Equalize1and4

Trigger.7 = Name:FeedTank2EndRefill#Target:Feed2#Threshold:7186#Condition:TankQuantityAbove#EffectTrue:CloseValve.FeedTank2FwdTransferValve

Trigger.8 = Name:FeedTank3EndReFill#Target:Feed3#Threshold:7186#Condition:TankQuantityAbove#EffectTrue:CloseValve.FeedTank3FwdTransferValve

Trigger.9 = Name:FeedTank4EndReFill#Target:Feed4#Threshold:6765#Condition:TankQuantityAbove#EffectTrue:CloseValve.FeedTank4FwdTransferValve,StopTrigger.Equalize1and4

Trigger.10 = Name:Equalize1and4#Target:Feed1,Feed4#Threshold:10#Condition:TankAbsImbalanceBelow#EffectTrue:OpenValve.FeedTank1FwdTransferValve,OpenValve.FeedTank4FwdTransferValve

The bolded triggers are the ones I am having difficulty with. Triggers 6 and 9 seem to be unable to stop Trigger 10 from occurring. The SimVars show triggers 6, 9, and 10 to all be active at the same time.

Question: Is the StopTrigger effect supposed to deactivate an already activated trigger, or to prevent a not yet activated trigger from activating, or both?

flightmodeldocumentation
2 comments
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Boris_ avatar image Boris_ ♦♦ commented ·

Hello @donstim ,

Can you send us your flight_model.cfg please ?
See 3) Provide Private Content

Thanks,

Regards,
Boris

0 Likes 0 ·
donstim avatar image donstim Boris_ ♦♦ commented ·

I've done as you asked. I have an additional question as well. The SDK provides for a trigger condition identified as "manual." It is described as follows: "This is a manual trigger event that can only be triggered by using a Key Event." It is not clear to me exactly how this would be done. For example, would there need to be a "target" or a "threshold" identified?

Could you provide an example of the syntax needed? I am most interested in using this to allow a cockpit pushbutton to place fuel pumps in either an auto state where they would be controlled by the fuel system triggers, or an off state that would disable triggers that would otherwise start the pumps.

In thinking about the above stated desire, it appears that there are additional issues with attempting to do this. Apparently, triggering a fuel pump to start or stop via a fuel system trigger in the flight_model.cfg file will cause the associated cockpit push button to also switch to the "on" or "off" position, when what is desired is that it remains in an "auto" or "enabled" position. (This "auto" is different than the "auto" mode currently in the SDK.) In the A380, for example, a fuel pump switch could either be put in an "auto" position that would allow fuel pumps to start and stop in response to specific conditions, or an "off" position. Stopping the fuel pumps via a specific triggering condition should not result in the fuel pump push button going to the off position.

This same issue applies to the fuel valves. There are two switch positions -- auto and manual (which would manually open the valves). If in auto, they would open in response to certain triggers. But it appears that in MSFS, opening the valves via a fuel system trigger would cause the switch position to change from auto to manual (open).

1 Like 1 ·
Boris_ avatar image
Boris_ answered Boris_ converted comment to answer

Hello @donstim,

We think this is due to the way aircraft editor handles triggers and how the cfg is built then. They normally support up to 10 parameters but for some reason this was limited to a maximum of 7 and so the last 3 parameters were not taken into account. We will fix this.


About the typo, we will update the doc

Thank you for reporting this


Regards,
Boris

7 comments
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

donstim avatar image donstim commented ·
Thank you for your answer, but I'm afraid I don't really understand it. I did not use the aircraft editor to build the cfg. What exactly are the parameters in the fuel system section that are limited to 10 in number and where is this stated in the SDK? For example, in a trigger would the "name" be one parameter, the target be another, the conditions be another, and each event also be one?

Is the a limit to the number of "triggers" that can be used?

Could you clarify whether a "stop" trigger prevents another trigger from being activated, deactivates a trigger that has already been activated, or both?

Do you have an answer for the additional question I asked in a comment above on 22 January?

When should I expect to see the fix you identified incorporated?

Thanks again.

0 Likes 0 ·
donstim avatar image donstim commented ·

I have done some additional testing and still do not understand how the start and stop triggers are supposed to work (also see previous comment). It does not appear to me simply be an issue with the number of parameters. For this test, I used the Asobo A320NEO and edited the flight_model.cfg file to add a name to trigger 1 in the fuel system and to add a trigger 5 as follows:

Trigger.1 = Name:Trigger1#Target:LeftInner#Threshold:250#Condition:TankQuantityBelow#EffectTrue:OpenValve.LeftTransferValve1,OpenValve.LeftTransferValve2#EffectFalse:CloseValve.LeftTransferValve1,CloseValve.LeftTransferValve2

Trigger.2 = Target:RightInner#Threshold:250#Condition:TankQuantityBelow#EffectTrue:OpenValve.RightTransferValve1,OpenValve.RightTransferValve2#EffectFalse:CloseValve.RightTransferValve1,CloseValve.RightTransferValve2

Trigger.3 = Condition:Autostart_Enabled#EffectTrue:OpenValve.LeftEngineValve,OpenValve.RightEngineValve,OpenValve.CrossFeedValve,OpenValve.APUValve,StartPump.CenterTankPump1,StartPump.LeftInnerTankPump1,StartPump.RightInnerTankPump1,StartPump.CenterTankPump2,StartPump.LeftInnerTankPump2,StartPump.RightInnerTankPump2,StartPump.APUPump

Trigger.4 = Condition:Autoshutdown_Enabled#EffectTrue:CloseValve.LeftEngineValve,CloseValve.RightEngineValve,CloseValve.CrossFeedValve,CloseValve.APUValve,StopPump.CenterTankPump1,StopPump.LeftInnerTankPump1,StopPump.RightInnerTankPump1,StopPump.CenterTankPump2,StopPump.LeftInnerTankPump2,StopPump.RightInnerTankPump2

Trigger.5 = Target:Center#Threshold:1#Condition:TankQuantityAbove#EffectTrue:StopTrigger.Trigger1#EffectFalse:StartTrigger.Trigger1

I started a flight on the runway. I added fuel to the center tank. Simvarwatcher shows that the SimVar for fuelsystemtriggerstatus:5 is 1. This should activate stoptrigger.Trigger1, which is the name I gave for trigger 1. However, when I reduce the left inner fuel tank quantity to less than 250 gallons (the condition for triggering trigger 1), trigger 1 is activated. This is shown by the Simvarwatcher fuelsystemtriggerstatus:1 =1 and by observing the left outer fuel tank transferring fuel into the inner tank. Trigger 5 and trigger 1 are both shown as activated by Simvarwatcher even though the effect of trigger 5 is supposed to stop trigger 1.

The same thing happens if I start with no center fuel, then reduce the inner tank fuel level to activate trigger 1, then add center fuel to activate trigger 5, which should stop trigger 1. It appears to me that either the stop triggers don't work, or the syntax I am using (which I believe matches what is stated in the SDK) is wrong.

I also noticed two more issues with the SDK in this area:

1) It says the name parameter for a trigger is required. Yet the triggers in the Asobo A320NEO do not have names and neither does the example of a trigger you provide in the SDK, and

2) In this line in the SDK showing structure of the trigger line:

Trigger.N = Name:<trigger_name>#Title:<trigger_title>#Target:<target_name>#Threshold:<value>#:Index:<target_index>#DelayTrue:<seconds_value>:#DelayFalse:<seconds_value>#Condition:<string>#EffectTrue:<effect_list>#EffectFalse:<effect_list>

there is a colon between "#" and "Index" that I don't think belongs there. I just noticed that there is also an extraneous ":" after the first <seconds_value>."

0 Likes 0 ·
Boris_ avatar image Boris_ ♦♦ donstim commented ·

Hello @donstim ,


"I started a flight on the runway. I added fuel to the center tank. Simvarwatcher shows that the SimVar for fuelsystemtriggerstatus:5 is 1.....trigger 1 is activated. This is shown by the Simvarwatcher fuelsystemtriggerstatus:1 =1 and by observing the left outer fuel tank transferring fuel into the inner tank. Trigger 5 and trigger 1 are both shown as activated by Simvarwatcher even though the effect of trigger 5 is supposed to stop trigger 1."

- That's not how it's supposed to work. The effects of triggers only refresh when the state changes. This means that they do not refresh continuously. If you make the Trigger5 go false and then on, it will trigger its EffectTrue, otherwise it will not.


"It says the name parameter for a trigger is required. Yet the triggers in the Asobo A320NEO do not have names and neither does the example of a trigger you provide in the SDK, and".

- The name is needed for the components to refer to each other, so it's needed for all the other things because they need to refer to each other to be in the fuel circuit. For some triggers it is not necessary but it's strongly recommended to put a name.


there is a colon between "#" and "Index" that I don't think belongs there. I just noticed that there is also an extraneous ":" after the first <seconds_value>.

You're right and the doc will be updated.


Could you clarify whether a "stop" trigger prevents another trigger from being activated, deactivates a trigger that has already been activated, or both?

For example, let's assume a Trigger1 that has a stop condition for Trigger2. Trigger2 will deactivate when Trigger1 activates, but if there is something else that causes Trigger2 to reactivate, there is nothing to block it. As long as Trigger2 doesn't change its state, it does nothing.


The SDK provides for a trigger condition identified as "manual." It is described as follows: "This is a manual trigger event that can only be triggered by using a Key Event." It is not clear to me exactly how this would be done. For example, would there need to be a "target" or a "threshold" identified?

No, it's not necessary to define a target or a threshold when using a manual trigger. They can be used to group interractions. For example, instead of having to call two key events to open two valves, you can just have one trigger that opens those two valves and then call that trigger when you do your interraction.


As for your other questions :
- There is no limit to the amount of trigger that can be used.
- About the 10 parameters I mentioned above, this limit is not visible for you, it's when the params are processed. No ETA for the fix yet but I will let you know.

Regards,
Boris

0 Likes 0 ·
donstim avatar image donstim Boris_ ♦♦ commented ·

[Edited - After conducting additional testing, I've completely re-written this comment to provide further clarity and information]

For example, let's assume a Trigger1 that has a stop condition for Trigger2. Trigger2 will deactivate when Trigger1 activates, but if there is something else that causes Trigger2 to reactivate, there is nothing to block it. As long as Trigger2 doesn't change its state, it does nothing.

What could be that "something else" that would cause Trigger 2 to reactivate? I had assumed that it would need to be a start trigger, but apparently that's incorrect. And what do you mean by "reactivate?" Does this mean; (1) Cause the trigger to be available to listen for and react to events, or (2) Cause the trigger to have whatever condition it is listening for to be resolved as true?

In fact, I've already shown numerous examples where it does not work how you described it. Here's another, very simple one. I have removed all other triggers from the Asobo A320neo fuel system except for trigger 1. I then added a trigger 2 that is supposed to stop trigger 1 whenever the cg is greater than 25% MAC.

Trigger.1 = Name:Trigger1#Target:LeftInner#Threshold:250#Condition:TankQuantityBelow#EffectTrue:OpenValve.LeftTransferValve1,OpenValve.LeftTransferValve2#EffectFalse:CloseValve.LeftTransferValve1,CloseValve.LeftTransferValve2

Trigger.2 = Condition:CGAboveLimit#Threshold:0.25#EffectTrue:StopTrigger.Trigger1

I then started a flight in cruise with a bit over the trigger point of 250 gallons of fuel in the left inner tank. I changed the cg until it was above the trigger 2 trigger point, verified by fuelsystem trigger status.2=1. When the fuel level in the left inner tank went below 250 gallons, trigger 1 activated (as evidenced by the fuel transfer from outer to inner being initiated and by the simvar fuelsystem trigger status.1=1 ) even though trigger1 was supposed to be stopped. I then changed the cg position to less than 25% MAC, so that trigger 2 was false (correctly shown by fuelsystem trigger status.2=0), then increased the cg position until the trigger 2 condition was again true (fuelsystem trigger status.2=1, which should stop trigger 1 according to your description. However, there was no change to the status of trigger 1. The fuel continued to transfer and the related simvar stayed at 1.

Now, maybe you could say that well, trigger 1 is no longer being monitored, so the status does not change. But then if I add enough fuel to cause the trigger event to become false, the fuel transfer stops, and the trigger 1 simvar changes to 0. Why would this happen if the trigger is no longer being monitored?

How should the fuel system be behaving with the 2 triggers above?

It is still unclear to me how the start and stop trigger events are supposed to work. Currently, these events don't appear to me to offer much utility and don't meet our needs in using the MSFS modern fuel system to model the A380 fuel system. Before I had the benefit of your explanation, my assumption (based on the sparse SDK documentation) and influenced by our particular needs) was that a stop trigger would effectively remove the named trigger, i.e., as if it was completely deleted from the cfg file. A start trigger would effectively re-introduce the named trigger as if it were adding the trigger back into the cfg file, which would be needed before the trigger could then be reactivated (through meeting its trigger condition).

Seeing as the stop and start triggers don't appear to work in this logical fashion, is there another means within the modern fuel system to accomplish what I described in the paragraph above? (Or, conversely, is there a reason that the start and stop triggers should not or cannot be modified to work in that manner? I have yet to see any airplane where these conditions are used.)

I'm also confused by the following exchange:

Me - "I started a flight on the runway. I added fuel to the center tank. Simvarwatcher shows that the SimVar for fuelsystemtriggerstatus:5 is 1.....trigger 1 is activated. This is shown by the Simvarwatcher fuelsystemtriggerstatus:1 =1 and by observing the left outer fuel tank transferring fuel into the inner tank. Trigger 5 and trigger 1 are both shown as activated by Simvarwatcher even though the effect of trigger 5 is supposed to stop trigger 1."


You - That's not how it's supposed to work. The effects of triggers only refresh when the state changes. This means that they do not refresh continuously. If you make the Trigger5 go false and then on, it will trigger its EffectTrue, otherwise it will not.

In fact, what you described about how triggers should work sounds exactly like what I did. I started with a Trigger 5 that is false and then added fuel to change its effect to true. It did so (exactly as expected). What it did not do was stop trigger 1 in the way that I expected, i.e., to change its state to false. In fact, it doesn't appear to do anything at all.

1 Like 1 ·
Show more comments
Boris_ avatar image
Boris_ answered Boris_ commented

Hello @donstim ,

StopTrigger and StartTrigger are meant to be used only for manual triggers, not dynamic ones. It explains why you are behaving this way.


I apologize, I should have detailed this in my previous answers.


Regards,
Boris

2 comments
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

donstim avatar image donstim commented ·

Ahh, the answer! Thanks! Please update the SDK with this very important information. Also consider adding an example, which would serve 2 purposes -- to show how to use both a stop trigger and a manual event condition.

Please mark you comment above as the answer rather than your previous "answer."

0 Likes 0 ·
Boris_ avatar image Boris_ ♦♦ donstim commented ·

Thanks for the feedback. Indeed we will update the doc to add this information ;)

@Nocturne
Regards,
Boris

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.