The simulator.createDataref()
method creates a new dataref, returning an object that can then be used to manipulate the dataref.
name
name
: The name of the dataref, e.g. lee/custom/mach_number
type
: The dataref type can be one of number
, array
, or string
.writable
: A boolean, indicating if this dataref can only be read (false) or both read and written (true)value_func
: A callback function that will provide a value for this dataref.An OwnedDataref
object is returned.
> latitude_dr = "lee/custom/total_thrust", "number", false,
OwnedDataref
> latitude_dr.value
25000
0
OwnedDataref
object, returned by this functionXPLMRegisterDataAccessor
is the C-API used by this function.create_dataref
functioncreateGlobalProperty
, and when to use it