Difference between revisions of "Fsx variable write"

From Sim Innovations Wiki
Jump to navigation Jump to search
(RPM wasn't writeable)
Line 5: Line 5:
'''fsx_variable_write''' is used write a variable to FSX or Prepar3D
'''fsx_variable_write''' is used write a variable to FSX or Prepar3D


You can find the available variables for FSX [http://msdn.microsoft.com/en-us/library/cc526981.aspx here] and the Prepar3D variables [http://www.prepar3d.com/SDKv2/LearningCenter/utilities/variables/simulation_variables.html here (official)].
You can find the available variables for FSX [http://msdn.microsoft.com/en-us/library/cc526981.aspx here] and the Prepar3D variables [https://www.prepar3d.com/SDKv5/sdk/references/variables/simulation_variables.html here (official)].


== Return value ==  
== Return value ==  

Revision as of 07:40, 3 May 2022

Description

fsx_variable_write(variable, unit, value)

fsx_variable_write is used write a variable to FSX or Prepar3D

You can find the available variables for FSX here and the Prepar3D variables here (official).

Return value

This function won't return any value.

Arguments

# Argument Type Description
1 variable String Reference to a variable from Flight Simulator X or Prepar3D
2 unit String Unit of the variable, can be found with the variable. Different units can be used for different variables. For example Hours, Knots and RPM (look here for FSX units and here for Prepar3D) 3 value Number The value to be written

Examples

Write a standard FSX / Prepar3D variable

-- Write false to variable "GENERAL ENG GENERATOR ACTIVE:1"
fsx_variable_write("GENERAL ENG GENERATOR ACTIVE:1", "Bool", false)

Write a LVAR

-- Write 50 to the IAS/TAS conversion chart
fsx_variable_write("L:AirspeedTAS", "number", 50)