Hello I have a comprehensive Simconnect application developed in C# where I
read and write approximately 20 variables there’s one variable I am unable to
set whatever I try to write which is "BRAKE PARKING POSITION " I add it to a
struct definition together with another 10 variables and so and then update
regularly, all other variables work…
SimConnect.AddToDataDefinition(DEFINITIONS.AircraftVelocities, “BRAKE PARKING
POSITION”, “Position”, SIMCONNECT_DATATYPE.FLOAT64, 0,
SimConnect.SIMCONNECT_UNUSED); I am trying to set it to 1 or fully engaged, I
tried float64, int bool etc… could you please test if it is working and how
? thanks Fred
Hello Fred, I confirm the issue is on our side as I am unable to write this
simvar through the SimVarWatcher provided with the SDK. I created a ticket on
this issue and we will have a look. Thank you for reporting the issue.
Regards, Sylvain
Hello Fred. In the end, the documentation is the culprit, the “BRAKE PARKING
POSITION” simvar is not writable directly but you can use the
KEY_PARKING_BRAKES event id to toggle it through SimConnect. Sorry for the
inconvenience. Regards, Sylvain
Hi @FlyingRaccoon Just a quick note to say the SDK docs still show the brakes
as being settable - is it possible to send the KEY_PARKING_BRAKES event via
JS?
SimVar.SetSimVarValue(“K:KEY_PARKING_BRAKES”, “number”, 1); ??
Hello @CaptMatto The doc will be good with SU6. You can call events with
Coherent.call(name, params…) method. Parameters will match the ones
defined in the EventId section of the doc (very incomplete at the moment,
we’re working on it) Example: Coherent.call(“HEADING_BUG_SET”, 1,
Math.round(heading)); Regards, Sylvain
That’s awesome thank you! I actually managed it with but will dig into the
MSFS code for Coherent.calls and work out how they work. Thank you
SimVar.SetSimVarValue("K:PARKING_BRAKES", "number", Number(this.pBrake));
The correct code (C++) is as follows:
hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_PARKING_BRAKES_TOGGLE, “PARKING_BRAKES”);
if (FAILED(hr)) {
AfxMessageBox(_T(“Fehler beim Mapping des Events PARKING_BRAKES”), MB_ICONERROR | MB_OK);
return;
}
Later with a pushbutton:
void CMFCAppSimConnectDlg::ToggleParkingBrake()
{
OutputDebugString(_T(“ToggleParkingBrake() called\n”));
HRESULT hr = SimConnect_TransmitClientEvent(
hSimConnect,
SIMCONNECT_OBJECT_ID_USER,
EVENT_PARKING_BRAKES_TOGGLE,
0,
SIMCONNECT_GROUP_PRIORITY_HIGHEST,
SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY
);
if (FAILED(hr)) {
CString errorMsg;
errorMsg.Format(_T(“Fehler beim Senden des PARKING_BRAKES-Events: HRESULT = 0x%08X”), hr);
AfxMessageBox(errorMsg, MB_ICONERROR | MB_OK);
}
}
Hence, the correct event is “PARKING_BRAKES” (without KEY_).
It works with Cessna 152, PMDG B-737-700, …
Best regards,
Erhard