请问这段脚本是什么意思

Sub OnClick(ByVal Item)                                                                                                                                         
 Dim i
 Dim plt_thk,plt_wid,plt_len,pdi_tar_thk,pdi_tar_wid 
 Dim stl_code,pdi_tar_len
 Dim mystr,mystr1
 Dim Msg
 Dim shear_len,shear_amount,shear_len2,shear_amount2
 Dim mydate,myorder,myclass
 Dim inputtime,myuser,prod_status
 Dim d_num

 myorder=HMIRuntime.Tags("D_order").Read 
 If myorder=0 Then
   Msg=MsgBox("Data not complete",16,"Input Information")
  Exit Sub
 End If 

 mydate=HMIRuntime.Tags("D_plan_date").Read 
 If mydate="" Then
   Msg=MsgBox("Please input plan date!",16,"Input Information")
  Exit Sub
 End If

 plt_thk=HMIRuntime.Tags("D_plt_thk").Read
 plt_wid=HMIRuntime.Tags("D_plt_wid").Read
 plt_len=HMIRuntime.Tags("D_plt_len").Read
 pdi_tar_thk=HMIRuntime.Tags("D_tar_thk").Read
 pdi_tar_wid=HMIRuntime.Tags("D_tar_wid").Read
 stl_code=Trim(HMIRuntime.Tags("D_steel_grade").Read)
 shear_len=HMIRuntime.Tags("D_shear_len").Read 
 shear_amount=HMIRuntime.Tags("D_shear_amount").Read 
 shear_len2=HMIRuntime.Tags("D_shear_len_2").Read 
 shear_amount2=HMIRuntime.Tags("D_shear_amount_2").Read 

 prod_status=HMIRuntime.Tags("D_prod_status").Read 
 inputtime=Now
 myclass=HMIRuntime.Tags("D_class").Read 
 myuser=HMIRuntime.Tags("@CurrentUser").Read 
 d_num=HMIRuntime.Tags("D_amount").Read 
 If   pdi_tar_thk=0 Or pdi_tar_wid=0 Then
   Msg=MsgBox("data inputing not complete",16,"Input Information")
  Exit Sub
 End If

 mystr1="(" & myorder & ",'" & Trim(stl_code) & "'," & plt_thk & "," & plt_wid & "," & plt_len & "," & pdi_tar_thk & "," & pdi_tar_wid & ","_
  & shear_len & "," & shear_amount & "," & prod_status & "," & shear_len2 & "," & shear_amount2 & ",'"   & inputtime &"','" & mydate & "','" & myuser &"'," & myclass &","& d_num &")"
  mystr="INSERT INTO D_plan_data VALUES" & mystr1
 HMIRuntime.Trace "mystr=" & mystr & vbCrLf 
 Datamanage(mystr)

 
 If err.number=0  Then

  msg=MsgBox("Save OK! ",0,"Dispatcher Plan") 
 Else

  msg=MsgBox("  Save failure! ",0,"Dispatcher Plan")
 End If

 

 End Sub

问题补充:
能具体注明下各段程序的含义嘛?
 我以前没学过VB~!~!

最佳答案

这是插入数据到数据库中.是WINCC与数据之间的一段代码

提问者对于答案的评价:
恩 是这样的

原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc274548.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2019年6月11日 上午10:50
下一篇 2019年6月11日 上午10:50

相关推荐

  • wincc 计算机列表里客户端的启动顺序不能勾选报警运行系统

    wincc 计算机列表里客户端的启动顺序不能勾选报警运行系统,而服务器端可以勾选,怎么解决啊?现在客户端连不上报警信息 图片说明:     …

    2021年7月5日
  • wincc 结束运行卡死

    结束wincc运行系统时,偶尔卡在10%动不了。有时还会弹一个system32的错误~~~~请高人解答 问题补充:有没有不重装系统的解决办法 最佳答案 部署操作系统费点时间,才能保…

    SIMATIC WinCC 2019年6月11日
  • 没有文件扩展“.V”的脚本引擎

    1, "开始->运行 regedit" 2, 按"CTRL + F 找&n…

    SIMATIC WinCC 2017年6月3日
  • Wincc安装过程中安装补丁KB929046报错

    在Windows Server2003系统下安装WinCC6.2SP3的过程中,如图一所示提示安装KB929046补丁,按提示安装,如图二所示报错,查了许多资料,不得要领…

    2017年11月1日
  • mp277 10寸 如何写,读U盘中的数据

    如何通过触摸屏把待加工件的型号写入u盘,生产的时候,根据工件的型号,查找存在u盘中的数据,传给plc 最佳答案 MP277是运行WINCC V7版本吗?如果是的话,可以通…

    SIMATIC WinCC 2021年7月5日
  • WINCC安装后无法打开

    WINCC 7.0 Asia在安装后无法打开。提示是“没有找到CCEInfoDlgs.dll.因此这个应用程序未能启动。求原因和解决方案。 最佳答案 1.安装时…

    SIMATIC WinCC 2019年6月11日
  • wincc归档变量查询

    我要做一个流量按日查询和按月查询,就是看一天生产了多少和一个月生产了多少,流量的累计值我存在了一个变量内,然后进行了变量归档,请教各位高手这要怎么实现。不胜感激。 问题补充:如果有…

    SIMATIC WinCC 2019年6月11日
  • WinCC安装提示重启系统

    WinCC SP4安装时提示需要重启系统,可是重启后还是出现提示重启系统这个页面,无法安装,我的是Win7旗舰版系统重新换了内存条后原来的step也无法使用了,点击运行后…

    SIMATIC WinCC 2017年6月8日
  • 数据格式转换

    从温控表上读取温度值  格式是 字符串  所以上位机上显示出来温度值的经常会出现字母,而且温度设定值 也要求以字符串的格…

    SIMATIC WinCC 2019年6月11日
  • WINCC项目打不开 报找不到网路路径

    我用的WINCC是6.2版的,机子用360杀毒软件杀了后WINCC就打不开了,报找不到网路路径,我急死了,哪位大哥指点一下,在线等,非常感谢 问题补充:原项目文件找到了也打不开,以…

    SIMATIC WinCC 2019年6月11日