WINCC VBS调试,诊断功能,ADO
来源:互联网 发布:简品花果茶淘宝 编辑:程序博客网 时间:2024/06/03 18:31
Introduction
One way to debug VBScript run-time is simple usingHMIRuntime.Trace metod. For example in this way:
Public Function LogErr () ' log current error using HMIRuntime.Trace Dim s s = "" If (Err.Number<>0) Then s = "Error # " & CStr(Err.Number) & " " & Err.Description & " " & Err.Source & vbCrLf HMIRuntime.Trace s Err.Clear ' Clear the error End If LogErr = s End Function
But much more powerfull is using script debuging withMicrosoft_Development_Environment. So you can use breakpoints, step-by-step code execution,inspect and modify variables, check call_stack and some more.
Details
Allow debuging
- Check VBS debug options in WinCC Computer Properties Dialog.
Start Runtime
- During runtime activation an 'Runtime error' Dialog box appear. Yes will startMicrosoft_Development_Environment (MDE) for debugging instance 'GlobalScript Runtime'. But there are no any sources at this view, and for now I don't know how to use it. So we say No.
- After activating Runtime the same Dialog appears again. But in this case Yes will startMDE for debugging instance 'PDLRT'. And that is the thing we need.
Working inMicrosoft Development Environment
- Say No for 'Open project' Dialog - we have'nt project.
- Open Running_Documents Debug Window.
In this window listed sources for all currently visible pictures. They named like 'PdlName.pdl_Events'. If a picture is invisible - its source is'nt listed there, but will be automatically added when picture become visiblity. But, and it is very nice, even if source is hidden for now, editor still save breakpoints in it, so when picture will open, source already contains breakpoints, and we can debug picture OnOpen event. :)
Each source contain complite run-time code for each Picture, and combined from all code relative to Picture:
- global modules called from local picture sources;
- local picture event handlers and triggers.
This approach well described in WinCC documentation (at least 100 times:) Unfortunally approach tocopy global modules into each picture causes that any data in global modules are not global over all runtime, but has isolated instance in each picture. So global modules can'nt hold global data, and how to implement this - is one ofHowTo question.
- Click over source name for open it.
- Set any numbers of breakpoints you need.
- Switch to Runtime and make action (or event) you want to debug.
- Switch to MDE. Script execution now stopped at breakpoint.
- You can perform standart debuging actions: step into, step over, run to cursor and so on.
- Use Immediate Debug Window
When script run-time in step mode execution (after breakpoint)Immediate Window provide an single-line VBS interpretator in context (variables) of current function. So we can:
- inspect variables and object properties,
- modify variables with single-line VBS instructions.
Not a big deal, but much better than nothing :)
And one moment:
- It is'nt good idea to stop script execution. This will totally break script runtime in WinCC session, and you will need to completly restart WinCC runtime for continue normal operation.
- WINCC VBS调试,诊断功能,ADO
- wincc VBS脚本解密
- Visual Studio 2010并行编程及调试诊断功能
- Visual Studio 2010并行编程及调试诊断功能详解
- WinCC V6.0 VBS 脚本在自动汽车
- WinCC + Excel + VBS = 定时自动打印报表
- wincc 。。。。
- WINCC
- wincc
- vbs调试方法
- Xcode 调试问题诊断
- [LCS]启用WindowsMessenger5.0的调试日志功能来诊断登录LCS服务器
- [LCS]启用WindowsMessenger5.0的调试日志功能来诊断登录LCS服务器
- [LCS]启用WindowsMessenger5.0的调试日志功能来诊断登录LCS服务器
- Script_Notepad++如何调试VBS脚本
- 嵌入式系统调试诊断方法
- VBS常用函数及功能
- vbs脚本实现Ping功能
- 经典排序算法 – 插入排序Insertion sort
- 二叉树的非递归遍历
- fortran读文本文件--汉字问题
- strcpy(d,s)的溢出问题
- PHP单文件入口URL路由原理
- WINCC VBS调试,诊断功能,ADO
- 条件编译
- Oracle闪回flashback总结
- Anagrams
- C#:在用VS2005开发WinCE6.0应用程序时,部署报错的处理
- ubuntu 下设置git 命令的字符颜色
- 不同操作系统下Java线程的区别
- at
- 非负矩阵分解中基于L1和L2范式的稀疏性约束