- Error
By Jeremy Pollard
Columnist Jeremy Pollard reviews VB Watch.
PRODUCT SPECS:
Name: VB Watch
Version: 2.04
Vendor: Aivosto Oy, Helsinki Finland
Application: VB development/runtime debugging
Price: $299-$900 US
Microsoft Visual Basic Version 6 (VB6) is an application development environment used by more than 500,000 programmers. In fact, most industrial software was written in VB6 at some point.
VB6 is not a gracious language, and the number of lines of code it has is staggering. Its syntax is esoteric at times, and trying to figure out why something doesnÃt work can be painful.
For instance, I wrote an application to gather data from 14 PLCs for a municipality. When I run the software here, I do not get any errors. When the customer runs it, however, there are errors that are not easily understood.
Runtime issues are at the heart of this problem, and VB Watch can help.
Normally, the source code would have to be developed in the integrated development environment (IDE), and you can troubleshoot the application while in that environment. But what happens when the application needs to be debugged on a target machine where there is no IDE?
We have to put in many lines of code to "trap" conditions, error handling, log files and the like. Many hours are spent performing these functions. But VB Watch can save the programmer from these time-consuming tasks, and make life easier.
The product has four parts:
• VB Watch Profiler determines how fast the code is and where the bottlenecks are;
• VB Watch Protector adds the error handling and trapping;
• VB Watch Debugger provides a real-time "periscope" on compiled files; and
• VB Watch Console automates the project instrumentation.
As usual, I start at the help file. There are many great things in the help file, including guided tours, references and code fragments to demonstrate how the software works. Very impressive.
Once installed, there is a tool bar added to your VB6 IDE. The main premise for VB Watch is that it adds code to your project and saves it in a separate directory, so you can keep your original code and then run the adjusted code.
It uses a plan, which is simply a configuration template that tells VB Watch what parts of the program you want to use, and where you want to place the results.
I started with the wizard to create my plan, and selected the "debugging" option.
One really cool feature is that you can monitor the application results over a network or over the Internet. This means that your application could be running in Calgary, and you could be in Toronto monitoring the runtime execution.
Once the plan was created, the option I selected was to create the new source code in the default directory and to open the new project in a new instance of VB6. I had a look under the hood to see what changes were made.
The first issue is with the fundamental code. If you have hard-coded any locations relative to the applications directory, these declarations will fail, since the new code is running from a different directory.
There are modules and class files added to your code. Depending on the selections made during the wizard, the resulting source code will have statements associated with these two code modules.
The "vbwDebugger.bas" file holds the common files used by VB Watch, and the "CvbwDebugger.cls" file initiates the Winsock communication link between the application and the VB Watch console. This is required so that the application can communicate with the console.
Another smart thing that happens is that all of the modules and forms that may be common to other applications are placed in the executing directory so that other applications are not affected. However, if one of these "public" modules or forms is responsible for any errors and you repair those errors locally, you need to remember to change the code in the common file location.
I ran the "profiler" option as well. This is a performance tool. Once the plan has been built for the profiler, you run the compiled "EXE" file. The application writes various data to a log file. Once the application is stopped, the profiler invokes and the statistics from the application are parsed and presented. In my application, I discovered that one routine ó Do Events ó was taking all of the clock cycles. It logs the activity from each procedure within that routine as well.
The error logging is very detailed and complete. The response window allows for an e-mail to be sent to the developer, which is very handy.
I would highly recommend trying VB Watch. Whether you are a novice or an experienced programmer, this "periscope" can be a learning tool as well as a method of fixing problems, without tedious or home-grown code.
Make sure that you are not running other applications at the same time, however, since the resources required are large.
Give it a try and go have some fun!
Jeremy Pollard is a 25-year veteran of the industrial automation industry. He has worked as a systems integrator, consultant and an educator in the field. Jeremy can be reached at This e-mail address is being protected from spambots. You need JavaScript enabled to view it .
Last modified on May 10, 2006
Columnist Jeremy Pollard reviews VB Watch.
PRODUCT SPECS:
Name: VB Watch
Version: 2.04
Vendor: Aivosto Oy, Helsinki Finland
Application: VB development/runtime debugging
Price: $299-$900 US
Microsoft Visual Basic Version 6 (VB6) is an application development environment used by more than 500,000 programmers. In fact, most industrial software was written in VB6 at some point.
VB6 is not a gracious language, and the number of lines of code it has is staggering. Its syntax is esoteric at times, and trying to figure out why something doesnÃt work can be painful.
For instance, I wrote an application to gather data from 14 PLCs for a municipality. When I run the software here, I do not get any errors. When the customer runs it, however, there are errors that are not easily understood.
Runtime issues are at the heart of this problem, and VB Watch can help.
Normally, the source code would have to be developed in the integrated development environment (IDE), and you can troubleshoot the application while in that environment. But what happens when the application needs to be debugged on a target machine where there is no IDE?
We have to put in many lines of code to "trap" conditions, error handling, log files and the like. Many hours are spent performing these functions. But VB Watch can save the programmer from these time-consuming tasks, and make life easier.
The product has four parts:
• VB Watch Profiler determines how fast the code is and where the bottlenecks are;
• VB Watch Protector adds the error handling and trapping;
• VB Watch Debugger provides a real-time "periscope" on compiled files; and
• VB Watch Console automates the project instrumentation.
As usual, I start at the help file. There are many great things in the help file, including guided tours, references and code fragments to demonstrate how the software works. Very impressive.
Once installed, there is a tool bar added to your VB6 IDE. The main premise for VB Watch is that it adds code to your project and saves it in a separate directory, so you can keep your original code and then run the adjusted code.
It uses a plan, which is simply a configuration template that tells VB Watch what parts of the program you want to use, and where you want to place the results.
I started with the wizard to create my plan, and selected the "debugging" option.
One really cool feature is that you can monitor the application results over a network or over the Internet. This means that your application could be running in Calgary, and you could be in Toronto monitoring the runtime execution.
Once the plan was created, the option I selected was to create the new source code in the default directory and to open the new project in a new instance of VB6. I had a look under the hood to see what changes were made.
The first issue is with the fundamental code. If you have hard-coded any locations relative to the applications directory, these declarations will fail, since the new code is running from a different directory.
There are modules and class files added to your code. Depending on the selections made during the wizard, the resulting source code will have statements associated with these two code modules.
The "vbwDebugger.bas" file holds the common files used by VB Watch, and the "CvbwDebugger.cls" file initiates the Winsock communication link between the application and the VB Watch console. This is required so that the application can communicate with the console.
Another smart thing that happens is that all of the modules and forms that may be common to other applications are placed in the executing directory so that other applications are not affected. However, if one of these "public" modules or forms is responsible for any errors and you repair those errors locally, you need to remember to change the code in the common file location.
I ran the "profiler" option as well. This is a performance tool. Once the plan has been built for the profiler, you run the compiled "EXE" file. The application writes various data to a log file. Once the application is stopped, the profiler invokes and the statistics from the application are parsed and presented. In my application, I discovered that one routine ó Do Events ó was taking all of the clock cycles. It logs the activity from each procedure within that routine as well.
The error logging is very detailed and complete. The response window allows for an e-mail to be sent to the developer, which is very handy.
I would highly recommend trying VB Watch. Whether you are a novice or an experienced programmer, this "periscope" can be a learning tool as well as a method of fixing problems, without tedious or home-grown code.
Make sure that you are not running other applications at the same time, however, since the resources required are large.
Give it a try and go have some fun!
Jeremy Pollard is a 25-year veteran of the industrial automation industry. He has worked as a systems integrator, consultant and an educator in the field. Jeremy can be reached at This e-mail address is being protected from spambots. You need JavaScript enabled to view it .
Latest from
MA Online Resource Centre
-
Videos
-
Manufacturing Automation's Editor Reports
Get the latest industry news from our magazine's editor
-
Manufacturing Automation's Editor Reports




