Monday, July 23, 2007

Using Visual Basic in Technical Applications

Visual Basic is the best software programming language for developing technical applications, and it is the easiest one to learn. Sure, you can also use it to design fancy Internet sites, business applications, the most advanced database systems, and distributed transactions. For industrial and technical applications, however, Visual Basic is better than anything else. In this article I will try presenting few of the reasons behind my affirmations.
First of all, Visual Basic comes with an exceptional graphic interface, which is definitely the easiest one to work with. For those who know how to do it, Visual Basic does everything Visual C++ does, only ten to twenty times faster and easier. It takes just few minutes to insert a label or a red line to display the dynamic value of a technical parameter. Of course, some graphic controls are very complex, but you do not necessarily need them. The most important controls in technical applications are: labels, text-boxes, buttons, MSFlexGrid, then lines, rectangles and circles. This is all! You do not need fancy graphics. Using only the few basic controls I summarized you can design the most powerful technical applications today, in the entire World.
When we control hardware the most important is to process data as bytes and bits. In C and C++ we use pointers to break integers into bytes, or to concatenate bytes into integers and doubles. In Visual Basic we use mathematical operations on bytes, and results are exactly the same. In order to process individual bits we use masks and bit-shifting in C and C++. In visual Basic we also use masks, and we replace bit-shifting with mathematical operations. Few are aware Visual Basic has incredibly rich libraries of mathematical functions, and they are optimized for very fast calculations. You can easily discover logic and statistical functions, sine, log, exp, and all other mathematical goodies that bring happiness and sunshine in our lives.
Now, many readers will object saying Visual Basic is limited to Windows PC OS (Operating System). No doubts about that, but we are talking here about 80% of the World market! What more would you expect? The next step in PC development is what we name today Tablet PC, and Windows has a good grip on that one with Windows Mobile OS. Even on the PDA market (Peripheral Device Adaptors) Windows CE is one of the best OS available. Besides, all software applications are written for Windows PC first of all, and before everything else.
Right! Now, lets detail a little this issue of controlling hardware using Visual Basic. The first thing to do is, design your intelligent hardware module using, say dsPIC30F3011 or even dsPIC30F4011. If you have no idea how to do it, this is perfect, and you do not have to worry about it. Once you have your nice little piece of hardware working, you will have to write an intelligent firmware program to give it life. Again, I suspect you do not know how to write firmware in C for Microchip dsPIC microcontrollers, but this is just fine--trust me with this one. I can guarantee you will become an expert in hardware and firmware in about 60 days--this is, considering you want to, and you do invest little, minimal efforts for this.
Next, it should take you a couple of weeks to learn how to write a Visual Basic application to talk to your hardware module. Hardware and firmware working together collect field data from peripherals, and they send it to your Visual Basic application. Wow! Your intelligent Visual Basic application is going to display analog field data dynamically, on a Graph Trace control--and you will know how to design this one--just like on an oscilloscope screen. You can store your processed data in binary files on PC; you can send commands to and from your hardware module; and you process field data as bits and bytes, mathematically, the way it pleases you most! To end, you can send the entire binary file to hardware and back, or even to an Internet site.
You are asking, probably, how you are going to do all those wonders. This is truly easy! Just visit my home website, and discover there a tutorial book about learning hardware, firmware, and software design. This is no joke, and the book I refer to is the best one you can find in the entire World today. It is just beyond belief! Find and read Table of Contents and the introductory chapters, and you will learn everything you want to know about it. Next, it is up to you, but my advice is, do not toss away precious, useful information, because you are going to need it one day. Knowledge it is never sufficient or too much.

No comments: