Creating a Virtual Control Console for Hardware using Visual Basic
Presented by William Koch Kochworx, Ltd. October 24, 2002
Summary
Goals Hardware & Interface Visual Basic Concepts Solution Development Demonstration
Goals
Create a Virtual Console to Demonstrate Hardware Describe Visual Basic Concepts Use the RS-232 Port
Hardware & Interface
Virtual Hardware the RGB Beast 4 Addressable Channels Each Channel has 0-FF settings for Red, Green, Blue Settings Tx Via RS-232 Interface Start Sequence = 4 $FF Data Sequence = Channel# R G B Sample: FF FF FF FF 01 C0 FF D6
RGB Beast Virtuware
Software to Hardware Connection
Serial Port (RS-232)
NULL Modem
Serial Port (RS-232) RGB Beast Virtual Hardware
Hardware Control Console (VB Software)
Visual Basic Concepts
Basis of all Visual Tools is Object Oriented Design Functionality is Encapsulated in Controls Properties, Methods & Events provide programming hooks VB is powerful because of Reusable Components
Solution Development
Begin a Project as a Standard EXE Add Controls for Project to the Toolbox (ex. MSCOMM Control 6.0) Design the Form Visually by Adding Controls and Setting Properties Write Code to Interact with Visual Objects
Constructing Virtual Console
Add a Label and a Slider Control to Form Set Slider Properties, Label Properties Replicate for Blue, Green Add a Timer, MSCOMM Control Write Code to Transmit Data
Simple Control Console
Coding the Timer
Must send 4 FFs, Channel#, R, G, B When Byte Stream Ready, Send Timers specified in milliseconds Finest granularity is ~55ms, max is 65535ms (60K=1 minute)
Adding a Channel Selector
Textbox Spinner Control Command Buttons Radio Buttons many options available Hook the Channel Selector Into Data Stream
Other Visual Controls
Microsoft Standard Controls 3rd Party Controls for just about anything
Summary
Goal was to create a Virtual Console to control a hardware device Hardware was a 4-Channel addressable RGB display device VB Components encapsulate large amounts of functionality Drag/Drop Development of UI Demonstrated Hardware Control
Questions (?)
William Koch wkoch@kochworx.com www.kochworx.com 973.534.6367