Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi.

I'm trying to change the range of the map in G1000 MFD using FSUIPC client, but with no success.

I've set and tested changing it using button mapping in FSUIPC7. It works and part of FSUIPC.ini looks like this:

7=PB,154,CPAS1000_MFD_RANGE_INC,0     -{Preset Control}-
8=PB,153,CPAS1000_MFD_RANGE_DEC,0     -{Preset Control}-

Now, I've used MSFSVariableServices to change value of AS1000_MFD_Brightness LVAR and it works. Setting the value in the 0.0-2.0 range changes brightness of MFD.

But there is no AS1000_MFD_RANGE_INC LVAR and as we can see in FSUIPC it's in fact the preset.

How FSUIPC does this through the preset?

How can I achieve this functionality using Client DLL in my project?

Thanks

Posted

Hi,

If you go to this site you can look up all the MSFS presets and find out how they work:

https://hubhop.mobiflight.com/presets/

(Make sure you select MSFS and not XPlane in the top left).

If you search for 'AS1000_MFD_RANGE_INC' and expand one of the results you will see the 'code' field. This is the 'calculator code' that get executed when you run the preset:

(>H:AS1000_MFD_RANGE_INC)

This is just setting an HVar (not LVar) called AS1000_MFD_RANGE_INC.

You have two choices to do this with the Client DLL:

1. Use MSFSVariableServices to execute this exact calculator code:

string incMFDRange = "(>H:AS1000_MFD_RANGE_INC)";
MSFSVariableServices.ExecuteCalculatorCode(incMFDRange);

2. Use MSFSVariableServices to set the HVar directly:

FsHVar mdfRange = MSFSVariableServices.HVars["AS1000_MFD_RANGE_INC"];
if (mdfRange != null)
{
    mdfRange.Set();
}

 

When you are looking for controls for an aircraft, be sure to check HVars as well as LVars. Many controls are done with HVars when no values need to be set or read.

Paul

  • Thanks 1
Posted

Hi Paul

Thanks for the link and advices.

I've tried to set HVar "AS1000_MFD_RANGE_INC", but I have no HVars at all.

VS.LVars.Count is 2516 and setting them works as I mentioned in my previous post.

VS.HVars.Count is zero. WASMClient also shows no HVar.

I did what you suggested and tried executing calculator code and it works.

Is there something I should have done initially to get access to HVars?

Thank you.

Posted
Quote

Is there something I should have done initially to get access to HVars?

It sounds like the WASM module isn't seeing the HVars. I don't have MSFS so I can't really help with that.

@John Dowson will be able to help with getting the HVars recognised by the WASM module.

Hopefully he will see this and reply here. If not, please ask John directly in the MSFS sub-forum: https://forum.simflight.com/forum/183-fsuipc7-msfs/

Paul

Posted
18 minutes ago, Paul Henty said:

@John Dowson will be able to help with getting the HVars recognised by the WASM module.

To get hvars recognised by the WASM and FSUIPC7, you need to use *,hvar files and place them in a specific location. Some *.hvar files are installed by default (for A320, DA40 TDI, DA40-NG, DA62, Skyhawk, TBM) and others are provided in a sub-folder of your FSUIPC7 installation folder called HvarFiles. To use these you must copy/move them to one of the folders where they are recognised, and also make sure that the name if the file is a sub-string of the aircraft name/title. Please see the section Using Hvars in page 47 if the Advanced User guide for details.

However, it is far easier to use hvars via calculator code or presets, and they do not need to be made known to FSUIPC with these methods.

John

  • Thanks 1
  • 11 months later...
Posted

Hi. I'm attempting to trigger h-events via the FSUIPC Client DLL Nuget package.

I am able to receive a list of l-vars and set them, but when I try to trigger an h-event nothing happens:

VS.ExecuteCalculatorCode(">H:AS1000_MFD_MENU_Push");

This is while running the Cessna 172 G1000, but I've also tried h-events in a different model.

Am I doing something wrong?

VS.HVars["AS1000_MFD_MENU_Push"] is null, but maybe that is to be expected?

Thanks.

Posted

First check if the calculator code is being sent and applied in the FSUIPC WASM module (presumably you have that installed - if not, you need to install that). To do this, set Debug level logging (via the FSUIPC_WASM.ini file) and check the FSUIPC_WASM.log file to see if the command/code is logged.

7 hours ago, TF1 said:

VS.HVars["AS1000_MFD_MENU_Push"] is null, but maybe that is to be expected?

Probably. Hvars are only known (i,e, loaded and provided) by name if they are given in an aircraft-specific *.hvar file. However, they don't need to be known if using them via calculator code. 

Posted

Thanks for your response. It turned out to be a simple problem. The command needs to be inside parentheses.

Example:

VS.ExecuteCalculatorCode("(>H:AS1000_MFD_MENU_Push)");

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.