qq240559043
干就完了
级别: 略有小成
精华主题: 0
发帖数量: 192 个
工控威望: 332 点
下载积分: 4111 分
在线时间: 143(小时)
注册时间: 2012-06-06
最后登录: 2024-11-15
查看qq240559043的 主题 / 回贴
楼主  发表于: 2022-01-18 19:25
触摸屏存储数据,用的配方存储。一个配方分两次存。先得到前半部分数据->存储->后半部份如何写空

if RFormula_Selection > -1  then
           SetData(RFormula_Selection, "Local HMI", RECIPE, "DATA1.Selection")
          
           StringGet(Mode[0], "Local HMI", RECIPE, "DATA1.Mode")
           GetData(QR[0], "Local HMI", RECIPE, "DATA1.ProdInfo")
           //StringGet(QR[0], "Local HMI", RECIPE, "DATA1.ProdInfo")
           StringGet(date[0], "Local HMI", RECIPE, "DATA1.Date1")
           GetData(AirP, "Local HMI", RECIPE, "DATA1._Result")
           StringGet(date2[0], "Local HMI", RECIPE, "DATA1.Date2")
           GetData(TestP, "Local HMI", RECIPE, "DATA1.TestP")
           GetData(Leap, "Local HMI", RECIPE, "DATA1.Leak")
           StringGet(Result1[0], "Local HMI", RECIPE, "DATA1.T_Result")
          
          
           StringSet(Mode[0], "Local HMI", LW, 1000 + index*100, 1)
           StringSet(QR[0], "Local HMI", LW, 1001 + index*100, 20)
           StringSet(date[0], "Local HMI", LW, 1022 + index*100, 11)
           SetData(AirP, "Local HMI", LW, 1040+ index*100, 1)
           if StringLength(date2[0]) == 0 then
              //StringSet(null[0], "Local HMI", LW, 1042 + index*100, 11)
              SetData(null[0], "Local HMI", LW, 1042 + index*100, 11)
           else
              StringSet(date2[0], "Local HMI", LW, 1042 + index*100, 11)
           end if
           SetData(TestP, "Local HMI", LW, 1060+ index*100, 1)
           SetData(Leap, "Local HMI", LW, 1062+ index*100, 1)
           StringSet(Result1[0], "Local HMI", LW, 1064 + index*100, 4)
       else  //写入空值
           SetData(null[0], "Local HMI", LW, 1000 + index*100, 1)
           SetData(null[0], "Local HMI", LW, 1001 + index*100, 20)
           SetData(null[0], "Local HMI", LW, 1022 + index*100, 11)
           SetData(F_Zero, "Local HMI", LW, 1040+ index*100, 1)
           SetData(null[0], "Local HMI", LW, 1042 + index*100, 11)
           SetData(F_Zero, "Local HMI", LW, 1060+ index*100, 1)
           SetData(F_Zero, "Local HMI", LW, 1062+ index*100, 1)
           SetData(null[0], "Local HMI", LW, 1064 + index*100, 4)
       end if
本帖最近评分记录:
  • 下载积分:+1(bruce2020) 真诚感谢!