-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
K Variables with two values #87
Comments
Not 100% where you are geting the variable from, more info is needed. Example Pseudocode: event_to_trigger = Event(b'GENERAL_ENG_THROTTLE_LEVER_POSITION:index', sm)
# Need to set index befor read/write
event_to_trigger.setIndex(1)
# Note to set index 2 vs 1 just re-run
# event_to_trigger.setIndex(2)
event_to_trigger(1) This is the same to SimConnect as: event_to_trigger = Event(b'GENERAL_ENG_THROTTLE_LEVER_POSITION:1', sm)
event_to_trigger(1) By passing in the 'index' string the lib will handle switching as need, using the setIndex() |
Hi odwdinc, thanks for your reply. I tried your approach but I get "SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED" and "SIMCONNECT_EXCEPTION_ERROR", which is a different error (not crashing anymore). I suspect this variable doesn't accept the :1 or :2 index as you suggested. My code now is:
I attached two screenshots of my source. I'm trying to mimic the External Power Switch for the Cessna Grand Caravan EX. The standard "Toggle External Power" didn't do the trick, so I'm trying to figure out the commands of the xml file. Any thoughts? |
A K: value is internal variable visible to WASM code. Some of them are hooked up to Simconnect external interface but unfortunately many of the most interesting new variables are not. Especially those related to modern avionics. So far the MSFS2020 developers have shown no urgency to modernize Simconnect which they consider seem to consider a legacy interface. There are a couple of opensource projects using Simconnect to tunnel new commands into a stub running in WASM. These are all very aircraft-model specific as the K: variables are not consistent across models. |
I came across an issue while programming using the library.
The command:
Works fine and the switch moves accordingly. The variable is K:TURBINE_IGNITION_SWITCH_SET1 requires one value.
However, when dealing with a K variable that requires two values the program crashes, K:ELECTRICAL_BUS_TO_CIRCUIT_CONNECTION_TOGGLE variable for example.
If I try:
It catches and exception and crashes.
Is there any way to pass two values for a K variable? Passing them in a row didn't work (two separate event_to_trigger commands with different values).
The text was updated successfully, but these errors were encountered: