回复:全局脚本中的VB编程问题

youhm

  • 帖子

    4924
  • 精华

    81
  • 被关注

    51

论坛等级:至圣

注册时间:2008-06-28

普通 普通 如何晋级?

发布于 2011-12-28 09:20:28

3楼

假设你前面已经打开Excel工作表对象xlsheet

IF HMIRuntime.BaseScreenName = "Z1" THEN
IF HMIRuntime.Tags("TAG1").Read = 1 THEN
xlsheet.Cells(1,1)=HMIRuntime.Screens("Z1").ScreenItems("S11").OutputValue
xlsheet.Cells(1,2)=HMIRuntime.Screens("Z1").ScreenItems("S21").OutputValue
END IF
IF HMIRuntime.Tags("TAG2").Read = 1 THEN
xlsheet.Cells(2,1)=HMIRuntime.Screens("Z1").ScreenItems("S11").OutputValue
xlsheet.Cells(2,2)=HMIRuntime.Screens("Z1").ScreenItems("S21").OutputValue
END IF
END IF
IF HMIRuntime.BaseScreenName = "Z2" THEN
IF HMIRuntime.Tags("TAG1").Read = 1 THEN
xlsheet.Cells(1,1)=HMIRuntime.Screens("Z2").ScreenItems("S11").OutputValue
xlsheet.Cells(1,2)=HMIRuntime.Screens("Z2").ScreenItems("S21").OutputValue
END IF
IF HMIRuntime.Tags("TAG2").Read = 1 THEN
xlsheet.Cells(2,1)=HMIRuntime.Screens("Z2").ScreenItems("S11").OutputValue
xlsheet.Cells(2,2)=HMIRuntime.Screens("Z2").ScreenItems("S21").OutputValue
END IF
END IF
评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC WinCC / Panel

共有32564条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

快扫描右侧二维码晒一晒吧!

再发帖或跟帖交流2条,就能晋升VIP啦!开启更多专属权限!

  • 分享

  • 只看
    楼主

top
您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。