3 developers agree this does not work C# TransmitEvent(EventEnum.MASTER_BATTERY_ON, 1);

Please look at this. I am simconnect app in C#

//
THIS WORKS

public void SetMASTER_BATTERY_OFF()
{
TransmitEvent(EventEnum.MASTER_BATTERY_OFF, 1);
TransmitEvent(EventEnum.MASTER_BATTERY_OFF, 2);
}

WHY THEN DOESN"T THIS WORK (has no effect , electrical external power is on)

public void SetMASTER_BATTERY_ON()
{
TransmitEvent(EventEnum.MASTER_BATTERY_ON, 1);
TransmitEvent(EventEnum.MASTER_BATTERY_ON, 2);
}

they all call
simConnect.TransmitClientEvent(0, cmd, Param, GROUP.GROUP1, SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY);

MY AI tells me I should use something like this for the indexes

simConnect.MapClientEventToSimEvent(EventID.MASTER_BATTERY1_ON, “MASTER_BATTERY1_ON”);

is that correct?

THIS IS ALL IN THE Asobo A320

Have you tried sending test events using the Coherent debugger console?

SimVar.SetSimVarValue("K:MASTER_BATTERY_OFF", "Number", 1);

Quicker than coding up simconnect, and it’s great for testing since it’s real-time and with no registration to potentially make an error with.

I’m using K:BATTERY1_SET, index in my aircraft for battery control, might be something to try.

1 Like

I found that if you load a flight on the runway for example, you have to move the vehicle a bit so it unhooks from whatever the sim has hardcoded to initialize the flight. From my previous experience, setting stuff in the .flt doesn’t matter for some variables like the Battery Master.

If you try to turn off the Master battery when spawning on the runway for example, it will reset to on every second until the vehicle moves. I believe that works the other way as well, if you spawn at the gate for instance.

1 Like