wincc读text数据到变量

已锁定

zhangli0

版主 西门子1847工业学习平台

  • 帖子

    17137
  • 精华

    63
  • 被关注

    889

论坛等级:至圣

注册时间:2003-06-06

钻石 钻石 如何晋级?

wincc读text数据到变量

814

3

2016-11-15 14:54:50

Sub OnLButtonUp(ByVal Item, ByVal Flags, ByVal x, ByVal y) 

  Dim fso 

  Dim txtfile 

  Dim a

  a=HMIRuntime.Tags("FileName").Read

  Set fso = CreateObject("scripting.filesystemobject") 

  If fso.FileExists("D:\\Export&Import\\"&CStr(a)&".txt") Then

   Set txtfile = fso.OpenTextFile("D:\\Export&Import\\"&CStr(a)&".txt")

   HMIRuntime.Tags("Var_1").Write txtfile.ReadLine

   HMIRuntime.Tags("Var_2").Write txtfile.ReadLine

   HMIRuntime.Tags("Var_3").Write txtfile.ReadLine

   HMIRuntime.Tags("Var_4").Write txtfile.ReadLine

   HMIRuntime.Tags("Var_5").Write txtfile.ReadLine

   MsgBox "导入数据成功/Import Successful"

   txtfile.Close

  Else

   MsgBox "文件不存在/File is not existing"

  End if

  End Sub


wincc读text数据到变量 已锁定
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC WinCC / Panel

共有32574条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

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

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

  • 分享

  • 只看
    楼主

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