请问这段脚本是什么意思

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日
下一篇 2019年6月11日

相关推荐

  • WINCC运行时出现unhandled exception was raised look wincc diagnose directory for details

    小弟在画面时使用了CCMediaControl,加载了一张GIF图 但是在做是否显示的动态的时候 出现了运行错误。删除动态变量后恢复正常。求大神指点。 最佳答案…

    SIMATIC WinCC 2019年6月10日
  • wincc 能否使用vbtimer控件?

    在wincc的一个画面中,需要定时循环运行一段脚本,然后想到了vb中的timer控件,但是无法在wincc中调用,不知道能否调用,谢谢大侠指导! 想过用全局脚本使用定时器…

    SIMATIC WinCC 2019年6月11日
  • wincc v6.0报警窗口提示没有到数据服务器的连接!

    wincc v6.0,画面上放置wincc alarm control窗口,运行后提示没有到数据服务器的连接,这是怎么原因? 最佳答案 1、取消激活2…

    SIMATIC WinCC 2019年6月10日
  • winccflexible 版本确定

    我用V1.3.0.0_1.83.0.1版本(见图2)打开项目,提示版本不正确,不能打开(见图1).我想知道什么版本的可以打开这个项目。 图片说明:    &nb…

    2018年12月3日
  • mp277上载

    上载程序时提示SSF文件不存在(MP277) 最佳答案 确定是ssf文件?不是pzd? 上载条件: 1、有sd卡; 2、下载时设置允许上载的选项; 提…

    SIMATIC WinCC 2019年6月11日
  • WINCCmiyao

    买了正版的WINCC 传送的时候密钥丢了一个应该 怎么办有什么方法吗 现在运行是以演示模式运行的  并且外部变量的点也超了应该去哪…

    SIMATIC WinCC 2021年7月5日
  • WINCC与S7-200通讯?

    有16个站点的S7-200PLC,现在这16个站点和一台WINCC走DP通讯?1、PC ACESS是不是只能挂8个站点?16个站点选什么好?2、走DP硬件接线怎么接,是不…

    SIMATIC WinCC 2017年12月1日
  • SQL SERVER2000(WINCC)装不上

    我安装WinCC之前装SQLserver2000时出现这样:Installing sofwaer failed A previous&nbs…

    SIMATIC WinCC 2019年6月11日
  • 急!wincc中负数无法显示/输入

    step7和WINCC的集成项目,在STEP7中变量为int格式,通过编译变量自动导入到wincc中为有符号16位数,但是在发现在运行画面时负数无法正常显示,step7程序里面监视…

    SIMATIC WinCC 2019年6月11日
  • wincc与300做通讯

    我想做一个监控!监控两个模拟量!plc是300的!适配器PC Adapter(Auto)!我在wincc下新开了一个项目!在变量管理中装入s7的驱动!然后再在mpi中建立…

    SIMATIC WinCC 2019年6月11日