Jump to content
The simFlight Network Forums

FSUIPC WASM module + client-side API + lvar/hvar discussion topic


John Dowson
 Share

Recommended Posts

38 minutes ago, jaxx said:

I tried with the new DLL and still can't read L/Hvars through it.
But I tried writing and that works for what I can see.

  • log L/Hvars functions -> No vars found
  • get list/values functions -> nothing
  • get Lvar (name, id) functions -> returns nothing/0
     
  • set lvar functions -> works!
  • set hvar function -> works!
  • createLvar -> works!
  • createAircraftLvarFile -> works!

Yes, I see the same. It seems that he requests from the WAPI to the WASM are working, but the data from the WASM isn't getting back to the client, so the client-side lvar/hvar lists are empty. I think this is because a lot of the functions from the WAPI.lib are missing from the dll, but I'm not sure how to correct this at the moment and don't have the time/resources to look into this, sorry.

As I said, the project is now in github, so if anyone has any experience in wrapping a static lib in a dll wrapper, please take a look!

Link to comment
Share on other sites

Posted (edited)

A few bug fixes and improvements, and max number of lvars increase to 2044 in this version (now the latest and only supported version, so please update): FSUIPC-WASMv0.4.8.zip

@andhogThis also contains a few further corrections for when using >  1022 lvars, so can you please test this and let me know. I have released anyway, as this version contains a few other corrections that need to be released, the main one being that lvar/hvar CDAs were getting confused on a reload.

 

Edited by John Dowson
Updated as forgot to update WASM
Link to comment
Share on other sites

On 4/8/2021 at 6:44 PM, John Dowson said:

A few bug fixes and improvements, and max number of lvars increase to 2044 in this version (now the latest and only supported version, so please update): FSUIPC-WASMv0.4.8.zip

@andhogThis also contains a few further corrections for when using >  1022 lvars, so can you please test this and let me know. I have released anyway, as this version contains a few other corrections that need to be released, the main one being that lvar/hvar CDAs were getting confused on a reload.

 

I've not been at home for a while, but now that I am I will have a look at your latest accomplishments 🙂.

I must also learn some SimConnect and figure out a way to trigger the read and write of LVars when the sim is paused and started. I recon it's a pretty basic task, but without any prior experience in this particular department it's a challenge. But hey, who doesn't like a challenge? 🙂

I'll let you know as soon as I've tested.

Link to comment
Share on other sites

34 minutes ago, andhog said:

I've not been at home for a while, but now that I am I will have a look at your latest accomplishments 🙂.

No problem.

34 minutes ago, andhog said:

I must also learn some SimConnect and figure out a way to trigger the read and write of LVars when the sim is paused and started.

What do you men by this? You can read and write lvars when the sim is paused. However, I have disabled lvar functionality (from the WASM) when MSFS is in a main menu (or aircraft in a parking state). There are some lvars available in this state from the loaded (or partially loaded) aircraft, but there is really no point doing anything with them. 

FSUIPC detects 3 out of the 4 pause states - still not possible to detect the default 'pause' (but more like an alt/att freeze), but that one really shouldn't be used - even though it is currently the MSFS default pause!
I have posted in the Asobo forums on how to detect the various pause and in-menu states via simconnect events, if you are interested check there.

With MSFs especially, I find its best not to do anything (via simconnect or WASM) until a plane & flight are already fully loaded, or the results are unpredictable. Another issue is that this state is also very difficult to detect! In the WASM, I have added a delay of 1500ms (can change using the ini parameter LvarScanDelay) which delays scanning of lvars for that amount of time after the 'ready-to-fly' state is deduced. If you increase this (or you can just issue a reload command instead) you will see that you will get a few more lvars than the first time (for complex aircraft) as the aircraft model continues to load and/or change.

34 minutes ago, andhog said:

I'll let you know as soon as I've tested.

Ok, thanks.

 

Link to comment
Share on other sites

3 hours ago, John Dowson said:

What do you men by this?

The app I've built around your module and the API is for saving and loading the cockpit state (switches, knobs etc) in the CRJ (for now, but it should be relatively easy to apply it to other aircraft as well). At the moment one have to do this manually, but I would like to add an option so that it loads the state automatically when you start a flight and saves it when the flight ends.

3 hours ago, John Dowson said:

I have posted in the Asobo forums on how to detect the various pause and in-menu states via simconnect events, if you are interested check there

Super! I will look it up. It was just a side note, nothing I expect you to help me with. But I appreciate that you explained a little bit about it. Perhaps I should skip the idea of subscribing to the events, keeping the manual loading and do the saving on a regular interval instead.

Link to comment
Share on other sites

16 hours ago, John Dowson said:

I have posted in the Asobo forums on how to detect the various pause and in-menu states via simconnect events, if you are interested check there.

I have gone through all your posts on the forum now but I can't find that description. Could you please give me a link to it?

Link to comment
Share on other sites

7 hours ago, andhog said:

I have gone through all your posts on the forum now but I can't find that description. Could you please give me a link to it?

Ah, sorry, probably is in a restricted or beta forum....

But we are going off-topic here....this is a discussion topic for the WASM!

Please raise another topic for other issues. 

Link to comment
Share on other sites

2 hours ago, andhog said:

So I've finally tested version 0.4.8 and it finds more LVars than the previous version, but unfortunately not 2044. The CRJ has 1738 LVars and when I create the LVar file(s) it lists all of them (in 14 files), but I've only access to 1738 with the client and using the WAPI in my app.

But 2044 is the maximum. Your CRJ has 1738, and you can see/access/update them. no? Why to you expect there to be more than are available?

Is it working ok for you with  1738 lvars? Why do you expect to see more?

 

 

Link to comment
Share on other sites

9 hours ago, John Dowson said:

But 2044 is the maximum. Your CRJ has 1738, and you can see/access/update them. no? Why to you expect there to be more than are available?

Is it working ok for you with  1738 lvars? Why do you expect to see more?

 

 

Sorry, copy&paste error there. I can only access 1168 Lvars, as you can see in the log files.

Link to comment
Share on other sites

Boa noite, já fiz o download da versão beta, já comprei o programa mas continua sempre igual ou seja anteriormente com a versão beta conseguia correr o programa self loading control e aparecia a dizer que o FSUIPC estava conectado de repente deixei de conseguir tudo isso, não compreendo porquê, no simMarket aparece no programa várias janelas diferentes e quando eu carrego no programa abre directamente o flight simulator e nem sei como abrir as definições , alguém me pode ajudar , obrigado. Porquê não consigo que o FSUIPC fique activado ?

Link to comment
Share on other sites

10 hours ago, leao65 said:

Boa noite, já fiz o download da versão beta, já comprei o programa mas continua sempre igual ou seja anteriormente com a versão beta conseguia correr o programa self loading control e aparecia a dizer que o FSUIPC estava conectado de repente deixei de conseguir tudo isso, não compreendo porquê, no simMarket aparece no programa várias janelas diferentes e quando eu carrego no programa abre directamente o flight simulator e nem sei como abrir as definições , alguém me pode ajudar , obrigado. Porquê não consigo que o FSUIPC fique activado ?

Você sequestrou um tópico que não está relacionado ao seu problema.

Please see the provided documentation - start with the Installing and Registering FSUIPC, then check the User Guide.
I'm sorry, but they are only available in English. If you have any issues, please check the forums first (as ALL issues with installing and registering have been reported before), and if you still have problems, then post (either in a topic that reports the same issue or start a new topic).

In Portugese (from google):

Quote

Consulte a documentação fornecida - comece com Instalação e registro do FSUIPC e, em seguida, consulte o Guia do usuário. Sinto muito, mas eles estão disponíveis apenas em inglês. Se você tiver qualquer problema, verifique os fóruns primeiro (já que TODOS os problemas com a instalação e registro foram relatados antes), e se você ainda tiver problemas, poste (em um tópico que relata o mesmo problema ou inicie um novo tópico) .

 

Link to comment
Share on other sites

Hi,

I have tested FSUIPC_WAPID.dll posted on April 7th with FSUIPC-WASMv0.4.9, focusing on the King Air's Lvar "XMLVAR_YokeHidden1". I used 2 cases:

 

1: using fsuipcw_init() with a NULL value as the 1st argument.

fsuipcw_getLvarList() returns an empty list
fsuipcw_getLvarIdFromName() returns 0
fsuipcw_getLvarFromName() returns 0.0

 

2: using fsuipcw_init() with a valid window handle as the 1st argument.

fsuipcw_getLvarList() results in a runtime error (as already mentioned previously)

fsuipcw_getLvarIdFromName() returns 1

fsuipcw_getLvarFromName() returns a correct value reflecting the status of the yoke (hidden or not)

To write a value, my successful workaround:

    first, enumerate the IDs and Lvars using fsuipcw_getLvarNameFromId(), incrementing ID starting at 0, until the name is either found or left equal to ""; "XMLVAR_YokeHidden1" is actually found.

    then, use fsuipcw_setLvarAsShort() with the found ID; this actually changes the status of the yoke.

 

So the second case actually allows to read and write a Lvar through FSUIPC_WAPID.dll.

Link to comment
Share on other sites

6 minutes ago, d147 said:

fsuipcw_getLvarIdFromName() returns 1

There was an error in this function, corrected now.

Also, the dll posted on the 7th is not build against the latest WAPI. Please try the attached:FSUIPC_WAPID.dllFSUIPC_WAPID.lib

FSUIPC_WAPI.h

You may get better results with those, but I don't think its fully functional but I'm not sure why..

12 hours ago, andhog said:

I have also tried the dll in a C# WinForms application and it works as well. Thank you!

Thats interesting...even the list functions?

Link to comment
Share on other sites

13 hours ago, andhog said:

I have also tried the dll in a C# WinForms application and it works as well. Thank you!

Could you share how you are using the DLL from C#? Because I still cannot read or log data via the DLL...

Link to comment
Share on other sites

Please find attached v7.1.0d of FSUIPC7 that has lvar support via macros and lua scripts. (i.e. as in FSUIPC5/6).
This is an early 'pre-release' for testing. I am planning on updating the installer (to add the WASM) + the documentation this week, and when that is done I will release as a beta.

To use, you must have the FSUIPC WASM module installed. When FSUIPC7 is started, if the WASM is detected there will be a new LVAR menu under the Add-ons menu. To activate lvar functionality, you need to Enable through this menu (you only need to do this once!).

Once I have updated the installer + documentation (and released officially as a beta), I am planning in adding the following new FSUIPC controls to allow direct assignments to lvars/hvars:
     L:var Set
     L:var Toggle
     L:var Increment
     L:var Decrement
     H:var Activate
     Execute Calc. Code

FSUIPC7.exe

John

Link to comment
Share on other sites

1 minute ago, SAC002 said:

Wonderfull...thanks..looking forward to be able to access hvars...

You can only access hvarsfrom the new lvar menu at the moment (Activate Hvar...). As well as the new controls above (which are still to be implemented), I also need to add lua/macro functions for hvars....

Link to comment
Share on other sites

I have re-tested my app using FSUIPC_WAPID.dll and FSUIPC_WAPI.h posted earlier today. I had missed the new way to enumerate Lvars and Hvars, rather than using map's. Everything is OK now. Thanks a lot, and thanks also for the new FSUIPC version.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.