|
1、從后臺(tái)調(diào)度中訪問或修改全局變量的代碼
描述:
在iFIX中使用調(diào)度要后臺(tái)運(yùn)行的時(shí)候需要啟動(dòng)FixBackgroundServer程序,而該程序?qū)嶋H上是啟動(dòng)了獨(dú)立于Workspace的進(jìn)程,所以在后臺(tái)調(diào)度中不能直接訪問全局變量。下面的例子代碼描述了怎樣訪問的方法:
" First get a pointer to the Application object in the Workspace
Dim WrkSpcApp As Object
Set WrkSpcApp = GetObject("", "Workspace.Application")
" Get a pointer to the Variable object called Variable 1 in the User globals
Dim TargetVar As Object
Set TargetVar = WrkSpcApp.Documents("User").Page.FindObject("Variable1")
" Set the current value in the variable object to a 1
TargetVar.CurrentValue = 1
|
|