找回密码
 注册

QQ登录

只需一步,快速开始

搜索

iFix从后台调度中访问或修改全局变量的代码

[复制链接]
coolice 发表于 2020-4-27 11:43:07 | 显示全部楼层 |阅读模式
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

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|ELEOK |网站地图

GMT+8, 2024-4-26 22:12

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表