电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

IFIX常用脚本

IFIX常用脚本_第1页
1/8
IFIX常用脚本_第2页
2/8
IFIX常用脚本_第3页
3/8
IFIX 常用的一些脚本 2010-04-30 20:29 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 Variable1 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 2、脉冲输出示例 Dim PauseTime, Start CloseDigitalPoint "Fix32.FIX.DDD.F_CV" PauseTime = 0.8 " 设置暂停时间。 Start = Timer " 设置开始暂停的时刻。 Do While Timer < Start + PauseTime DoEvents " 将控制让给其他程序。 Loop OpenDigitalPoint "Fix32.FIX.DDD.F_CV" 3、显示通讯状态 Is there a way to view communication status of the driver without using Mission Control? Resolution Using a digital input block reading a hardware register, the A_cualm field will be utilized. Chain the DI block to an event action block to a digital output tag using the SIM driver. In the event action block use the following script: IF the A_cualm =com Then set DO =1 Else set the DO=0 A data link can be made to the Sim block. The value of this block will determine the status of the communcation. 4、用VBA 脚本打开和关闭调度 为了打开和关闭调度,必须用下列方法: 打开一个名字为“ddd”的调度: Application.Documents.Open "C:\Dynamics\pdb\ddd.evs" 关闭一个名字为“ddd”的调度: Application.Documents("ddd").Close 注意:关闭调度时不用扩展名 .evs 。 5、在后台调度中访问画面中的对象 在调度中中的脚本不能直接访问画面中的对象。 办法: 使用FindObject ...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

IFIX常用脚本

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部