1、從后臺調度中訪問或修改全局變量的代碼
描述:
在iFIX中使用調度要后臺運行的時候需要啟動FixBackgroundServer程序,而該程序實際上是啟動了獨立于Workspace的進程,所以在后臺調度中不能直接訪問全局變量。下面的例子代碼描述了怎樣訪問的方法:
" 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
|