On this page
fsVarsRegisterOVar
The fsVarsRegisterOVar function can be used to get or create an OVar.
Syntax
FsOVarId fsVarsRegisterOVar(
const char* name,
const char* componentPath,
FsObjectId target
);Parameters
| Parameters | Description |
|---|---|
name | The name of the (new) variable. |
componentPath | The path of the component, in the format path:to:component or path:to:component@alias. The alias is optional but recommended, for performance reasons and to avoid conflicts. |
target | The ID of the object from which the variable is being retrieved or created. Default: FS_OBJECT_ID_USER_AIRCRAFT. |
Return Values
The function returns the ID associated to the given variable name. If the given name has already been registered, the function will return the ID of the existing OVar. If an error occurred, the function will return FS_VAR_INVALID_ID.
Remarks
OVar are local to an instrument, and the variable (and therefore the ID) will be different for each component.
Example
FsOVarId oVarId = fsVarsRegisterOVar("TOTO", "LIGHTING:PANEL_EMISSIVE");