中国自动化学会专家咨询工作委员会指定宣传媒体
免费注册 登录 广告服务 | 客服中心
您现在所在的是:

工控软件

抖音 德嘉 泓格论坛 FLIR红外热像论坛
工控论坛首页 工控软件 → 浏览主题: iFIX用脚本制作标签组数据
发表新帖 回复该主题
回帖:0个,阅读:1351 [上一页] [1] [下一页]
* 帖子主题:

iFIX用脚本制作标签组数据

分享到
113
Springal
文章数:53
年度积分:-223
历史总积分:113
注册时间:2009/2/15
发站内信
发表于:2009/8/11 23:46:07
#0楼
来源 极易ifix论坛
http://www.geifix.com/dispbbs.asp?boardid=5&replyid=67&id=56&skin=1
本例子,提供了下列按钮的编程脚本。
这段脚本重找了所有的标签组变量,并产生了一个字符串来代替标签组变量的名称。
这段脚本假设含有指令按钮的画面已经预先用retrievedefinition的方法从标签组对象中得到标签组。
例:制作标签组数据
private sub commandbutton1_click()
    dim vasymbols as variant
    dim vasubstitutions as variant
    dim vadescriptions as variant
    dim ssubstitutions() as string
    dim sdescriptions() as string
    dim picpath as string
    this will contain the number of symbols in a picture
    dim size as integer
    dim counter as integer
    dim filename as string
    set the filename
    filename = test
    delete tag group file if it exists. kill permanently
    deletes the specified file form the hard drive. use with
    caution.
    picpath = system.picturepath
    if dir(picpath + filename + .tgd  then
         kill picpath + filename + .tgd
    end if
    get the symbols from the picture
    me.retrievetaggroupvariables size, vasymbols
    if size = 0 then
    exit sub
    end if
    redim ssubstitutions(size - 1) as string
    redim sdescriptions(size - 1) as string
    fill in the symbols and the descriptions
    for counter = 0 to size - 1
    temp$ = fix32.thisnode. + vasymbols(count2) + .f_cv
    ssubstitutions(counter) = temp$
    sdescriptions(counter) = generated tag
    next counter
    create the tag group file object
    dim tgf as object
    vasubstitutions = ssubstitutions
    vadescriptions = sdescriptions
    set tgf = _
   createobject(taggroupdefinitioninterfacedll_
    .taggroupdefinitioninterface)
    tgf.updatedefinition filename, size, vasymbols, _
    vasubstitutions, vadescriptions

[URL=http://blog.csdn.net/cnauto/archive/2009/08/11/4436606.aspx][/URL]

----------------------------------------------
此篇文章从博客转发
原文地址: Http://blog.gkong.com/more.asp?id=96959&Name=springal
工控学堂推荐视频:

关于我们 | 联系我们 | 广告服务 | 本站动态 | 友情链接 | 法律声明 | 非法和不良信息举报

工控网客服热线:0755-86369299
版权所有 工控网 Copyright©2024 Gkong.com, All Rights Reserved

31.2002