Custom ActiveX Controls
& Data Logging Software For Visual BASIC Versions 5 & 6. |
||||||||||||||||
Part 1 |
||||||||||||||||
Custom ActiveX controls allow the programmer to create powerful programs quickly and easily. Visual Basic applications can be created with a minimum of effort, and offer outstanding features that would normally take you many hours of programming & debugging. Essentially, an ActiveX control is just another program that someone else has written that you can include in your own Visual Basic programs, or simply drag & drop them onto a form to create a full-blown application within minutes. Our new custom ActiveX controls are designed to let even the [non-programmer] create highly functional, and visually appealing custom interfaces for use with the popular BASIC Stamp single board computers. They may also be used with many other different microcontroller types including the PIC, and 8051 microcontrollers. Our first ActiveX control deals with receiving RS-232 data from the PC serial port. Many applications include simple terminal programs such as this one, but ours has a variety of unique options that would require many tedious hours of programming & debugging to develop. Here's a list of features for the new RenTerminalControl.ocx.
On the right side, we'll show you part 1 of creating your own custom terminal program with full data-logging capabilities. Jump to the right side to get started. -----> |
Getting Started: Here are the steps to create you own custom RS-232 terminal program using the RenTerminalControl.ocx, ActiveX control. After you have successfully downloaded the ActiveX control .zip file and run the Setup program to install the control..
|
|||||||||||||||
Part 2 |
||||||||||||||||
Now you should have a blank form on your screen with nothing on it. Look at the toolbar and find the Comm Control. The Comm Control resembles a small telephone. Double-click the Comm Control. Your new form should now have a small icon of a telephone as shown above in figure 1. Drag the phone icon to the lower right corner of your form. Next double-click on the renTerminal icon. It looks similar to a small dark blue screen shot similar to figure 1. You should now have a form very similar to the one in figure 1 with the exception of the Exit button, and your form will probably need to be re-sized. After re-sizing your form, and adjusting the renTerminal window to look similar to figure 1, you're ready to add the Exit CommandButton. Double-click the CommandButton icon on the control bar. If you're not sure what each control is, you can hold the mouse cursor over each one for a second and a small window should pop-up indicating the name of each control. Now drag your new command button into place as shown in figure 1. Jump to the right column to proceed. ---->
|
You should have a new form very similar to the one above in figure 1. The next thing you'll need to do is write some Visual Basic code to make things happen. Don't get nervous yet, our custom control handles 99.9% of all the code for you. You'll only need to enter a couple extremely small VB code snippets to finish your new custom terminal program. In the project window to the right of your screen, click on the View Code button. A window should open showing you the area used to enter your VB code similar to the one in figure 2 below. Enter the following code as shown below. Private Sub Command1_Click() Figure 2 [shown below] shows what your code window will look like when your finished adding VB your code. |
|||||||||||||||
|
||||||||||||||||
Part 3 |
||||||||||||||||
You're almost there, so hang-on. If your code looks like the sample in figure 2, you're ready to test your new custom Data-Logging RS-232 Terminal Program. Operation: Before we go blazing off to test our new creation, let's take a minute to see just how it works. Figure 3 to the right shows the terminal program in operation. Notice the red LED..? This LED serves two distinct functions.
The Enable log check-box lets you enable or disable the built-in data-logging functions of the renTerminalControl. The default is OFF when you first start the program. You can select a log file location, or simply accept the default location. The default location will be in the directory that all of the files were installed to. You can also select another location by clicking the small button just to the right of the window showing the directory location. This will let you browse your hard-drive for another log file, or give you a chance to create your own filename to serve as your data log file in another directory. Jump to the right to proceed. -----> |
Putting it all together: Click the Start Button to run the terminal application, or press [F5] to test it out. You'll need to know beforehand what com port you have available, but if you don't, you'll quickly see an error message when you click the LED. The LED will turn green once you click on it if your chosen com port is available. This indicates that the terminal program is running. Click it again and it turns red. The color red indicates the terminal program has halted, and the com port has been closed. |
|||||||||||||||
Part 4 |
||||||||||||||||
Part 4 deals mainly with using your new custom data-logging RS-232 Terminal Program in a real-world application. In this example we'll use the BASIC Stamp II, to send data to the terminal program, simulating a temperature recorder. Below is the dummy code we used with our BASIC Stamp II. This sample code simply increments the temperature values stored in the variable temp and sends them to the terminal program. Jump to the right to proceed. -----> |
Obviously we wouldn't want to send dummy data to our data-logger, but this simple example shows how powerful the terminal program can be. Using the BASIC Stamp to read temperature data from a Dallas DS1620, we could send this data to the terminal program and store it in our log file. Many high-powered data acquisition systems and data-loggers costing considerably more than this application work very similar. The BIG difference in the other ones and the one you just designed all by yourself, is, you guessed it, a huge chunk of your hard earned money. You won't find many that you can completely customize like the renTerminalControl either. |
|||||||||||||||
temp var byte begin: for temp = 65 to 110 serout 0,16468,["The Current temperature is ", dec temp, " Degrees F",13] pause 750 next goto begin |
||||||||||||||||
Part 5 |
||||||||||||||||
Logging Data: Perhaps the biggest difference in our custom control and a standard terminal program is the ability to log all incoming data. With the ability to log incoming data, you have a very powerful software interface for using with embedded control systems. Anything you can send over the serial lines, you can log..! It may not be too obvious at first, but let's stop and think for a minute about just what we could do with this. Here are just a few examples of the real power of logging incoming serial data with the date & time stamp at the beginning of the log file:
You name it..! Once you get started, you'll come up with all sorts of excellent ideas for using the RS-232 data-logging terminal program. Figure 4 shows a sample of our log file simulating the temperature logger using the BASIC code samples in part 4. |
Your log files can be opened using any standard text editor, and then printed out for closer examination. The BASIC Stamp can send any messages you want to the terminal screen for logging, or you can run the terminal program as a simple RS-232 interface to see incoming data during experiments. |
|||||||||||||||
Part 6 ......."Get Your Own Copy"...... |
||||||||||||||||
|
As with all of our software, you will receive any upgrades or enhancements 100% FREE. When we complete an upgrade, we will notify you and forward instructions on how to obtain the latest versions absolutely FREE of charge. Important Note: Note: We send download locations & passwords to you manually once we receive your order. Please be patient. It may take us a few hours to email you download instructions. Orders placed on weekends, or after normal business hours (9 to 5 Mon-Fri), will normally be processed on the following day, or Monday if placed during the weekend. Double check your email address when you fill in the order forms using the order buttons below.
|
||||||||||||||||