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_numbertype: 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
250000
OwnedDataref object, returned by this functionXPLMRegisterDataAccessor is the C-API used by this function.create_dataref functioncreateGlobalProperty, and when to use it