fsVarsAircrafVarGet

The fsVarsAircraftVarGet function can be used to get the value of a specific SimVar.

 

Syntax
FsVarError fsVarsAircraftVarGet(
    FsSimVarId simvarId,
    FsUnitId unitId,
    FsVarParamArray param,
    double* result
);

 

Parameters
Parameters Description
simvarId

The id of a simvar (found using fsVarsGetAircraftVarId).

unitId The id of an unit (found using fsVarsGetUnitId).
param The parameter which might be mandatory to access the simvar (in case of an indexed simvar for instance). Elements in param can be FsCrc, String or index.
result The value that will receive the value of the simvar if others parameters are right.

Return Values

The function returns a FsVarError, 0 means there is no error. In that case, the value of the simvar has been set in result.

 

Example
FsUnitId unitId = fsVarsGetUnitId("DEGREES");
FsSimVarId simvarId = fsVarsGetAircraftVarId("ATTITUDE INDICATOR PITCH DEGREES");
FsVarParamArray param = FsCreateParamArray("i", 0);
double result = 0;
if (fsVarsAircraftVarGet(simvarId, unitId, param, &result) == FS_VAR_ERROR_NONE)
{
    // valid
}
else
{
    // error
}