How to control H-Events (HTML Events) with SimConnect and/or WASM?

Intro

I’m building my own airbus A320 cockpit, using the FBW A32NX. To proof that I’m serious (:slight_smile: ), below is a picture of my fully functional FCU.

I created my own tool using SimConnect and WASM. You can read all about it here. So I do have some experience, but still don’t know everything.

So far, I only used A-vars (SimVars), L-vars (through WASM) and K-vars (both native events via SimConnect as FBW-events through WASM).

Now I’m developing the MCDU. The design is ready, as you can see here.

image

Now the question

To be able to control the buttons of the MCDU, I have to use H-Events, which is completely new for me. Example: “H:A320_Neo_CDU_1_BTN_DIR” will simulate pressing the “DIR” button on the MCDU.

My tool allows me to “register” variable (A, L and K), but also allows me to register variables that are handed over to the WASM module and use the “execute_calculator_code” directly (I call them “X-vars”). By this method, I can execute them without a problem. In my WASM code, this is then translated as:

execute_calculator_code(1 (>H:A320_Neo_CDU_1_BTN_DIR))

I probably don’t need to provide a parameter “1”, but my X-var implementation always takes a parameter, hence I use this “1”.

So far so good - it works as a charm.

But I wonder if there is a way to do this without using execute_calculator_code. For the L-Vars, I make use of the Gauge API “set_named_variable_value” and “get_named_variable_value”, which is faster than using execute_calculator_code. For K-Events, I use the SimConnect method “MapClientEventToSimEvent”. But can I do something similar for H-Events? I googled for hours, but as usual with SimConnect, there is not much useful documentation available.

Or is the execute_calculator_code the only way to deal with H-Events?

2 Likes

Just realized that I have an option to use execute_calculator_code without parameters. Sorry, but it has been a while since I wrote my code :slight_smile:

It means that this works as well (pressing the F-PLN button):

execute_calculator_code((>H:A320_Neo_CDU_1_BTN_FPLN))

But still would like to know if it is possible without using execute_calculator_code.

HBilliet,

You clever ‘so-and-so’. Your work looks fantastic! Keep us updated…

Charles.

1 Like

Once my MCDU is finished, I will create a post in the cockpit hardware section of this forum. Promis!

1 Like

wonderful work, would you be interested in building one for me?

Hello @ZenMusic2,

I"m afraid that I even don’t have enough time to build my own stuff :frowning: Also be aware that my modules are based on the PIC-microcontroller and communicate with MSFS through my propriatery communication tool (see here), so not sure how useful this would be for you.

But I’m thinking of offering all files and designs for a small fee somewhere in the near future. This would include all the drawings, 3D models, schematics, etc… Would you be interested in that?

1 Like

This is a great thread >> Tool to connect Serial USB devices to MSFS2020 via SimConnect/WASM using VS2022<<
I’ll read through this to get the details and then get back to you. ( I have built Arduino devices).

a side question: I have a C# app (addon for MSFS) working very well, but it is only using simconnect.
I need to add a WASM module to aceess the VARS I can’t reach via simconnect. (I’m a professional retired programmer) . How do I proceed to do that? Is it possible to merge the WASM with the app I have developed (can my main window call WASM to get/set the VARS?) This question is without hardware references.

thanks impressive work you’ve done

Hello @ZenMusic2,

Definitely! For this, I suggest you first read another great thread in which I explain all the steps. It’s based on VS2019, but you can simply upgrade to VS2022 as I did in the other thread you mentioned.

Enjoy reading!

1 Like

got your example with WSAM running on VS22 , great , very cool . Now I need to study it …thanks

1 Like