GetModuleContext

Description:

Given a module-in-context, this function returns the parent object of an instance of that module when it is launched or called.

Warning: For use by advanced programmers only. Effective use of this function requires a thorough understanding of VTScada programming.
Returns: A reference to the context module where scope of the given module should be resolved.
Usage: Script or steady state.
Function Groups: Variable
Related to: GetInstance | GetModuleText
Format: \GetModuleContext(ModuleInContext)
Parameters:  
ModuleInContext
Required. A module-in-context object.
Comments: A "module-in-context" is a reference to a module associated to a specific context, or module instance. Refer to value type 49 in VTScada Value Types.

Examples:

MyModuleInContext = ParentObject\ChildModule;
 
Context = GetModuleContext(MyModuleInContext); // Context == ParentObject
ChildModuleObj = MyModuleInContext();  // Context == ParentObject(ChildModuleObj)