creating a virtual control console for hardware using visual basic
DESCRIPTION
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 - PowerPoint PPT PresentationTRANSCRIPT
Creating a Virtual Control Creating a Virtual Control Console for Hardware using Console for Hardware using
Visual BasicVisual Basic
Presented by Presented by William KochWilliam Koch
Kochworx, Ltd.Kochworx, Ltd.October 24, 2002October 24, 2002
SummarySummary
GoalsGoals Hardware & InterfaceHardware & Interface Visual Basic ConceptsVisual Basic Concepts Solution DevelopmentSolution Development DemonstrationDemonstration
GoalsGoals
Create a Virtual Console to Create a Virtual Console to Demonstrate HardwareDemonstrate Hardware
Describe Visual Basic ConceptsDescribe Visual Basic Concepts Use the RS-232 PortUse the RS-232 Port
Hardware & InterfaceHardware & Interface
Virtual Hardware – the RGB BeastVirtual Hardware – the RGB Beast 4 Addressable Channels4 Addressable Channels Each Channel has 0-FF settings for Each Channel has 0-FF settings for
Red, Green, BlueRed, Green, Blue Settings Tx Via RS-232 InterfaceSettings Tx Via RS-232 Interface Start Sequence = 4 $FFStart Sequence = 4 $FF Data Sequence = Channel# R G BData Sequence = Channel# R G B Sample: FF FF FF FF 01 C0 FF D6Sample: FF FF FF FF 01 C0 FF D6
RGB Beast VirtuwareRGB Beast Virtuware
Software to Hardware ConnectionSoftware to Hardware Connection
Hardware Control Console(VB Software)
Serial Port (RS-232) NULL Modem Serial Port (RS-232)
RGB BeastVirtual Hardware
Visual Basic ConceptsVisual Basic Concepts
Basis of all Visual Tools is Object Basis of all Visual Tools is Object Oriented DesignOriented Design
Functionality is Encapsulated in Functionality is Encapsulated in ControlsControls
Properties, Methods & Events provide Properties, Methods & Events provide programming hooksprogramming hooks
VB is powerful because of Reusable VB is powerful because of Reusable ComponentsComponents
Solution DevelopmentSolution Development
Begin a Project as a Standard EXEBegin a Project as a Standard EXE Add Controls for Project to the Add Controls for Project to the
Toolbox (ex. MSCOMM Control 6.0)Toolbox (ex. MSCOMM Control 6.0) Design the Form Visually by Adding Design the Form Visually by Adding
Controls and Setting PropertiesControls and Setting Properties Write Code to Interact with Visual Write Code to Interact with Visual
ObjectsObjects
Constructing Virtual ConsoleConstructing Virtual Console
Add a Label and a Slider Control to Add a Label and a Slider Control to FormForm
Set Slider Properties, Label Set Slider Properties, Label PropertiesProperties
Replicate for Blue, GreenReplicate for Blue, Green Add a Timer, MSCOMM ControlAdd a Timer, MSCOMM Control Write Code to Transmit DataWrite Code to Transmit Data
Simple Control ConsoleSimple Control Console
Coding the TimerCoding the Timer
Must send 4 FF’s, Channel#, R, G, BMust send 4 FF’s, Channel#, R, G, B When Byte Stream Ready, SendWhen Byte Stream Ready, Send Timers specified in millisecondsTimers specified in milliseconds Finest granularity is ~55ms, max is Finest granularity is ~55ms, max is
65535ms (60K=1 minute)65535ms (60K=1 minute)
Adding a Channel SelectorAdding a Channel Selector
TextboxTextbox Spinner ControlSpinner Control Command ButtonsCommand Buttons Radio ButtonsRadio Buttons ……many options availablemany options available Hook the Channel Selector Into Data Hook the Channel Selector Into Data
StreamStream
Other Visual ControlsOther Visual Controls
Microsoft Standard Microsoft Standard ControlsControls
33rdrd Party Controls Party Controls for just about for just about anythinganything
SummarySummary
Goal was to create a Virtual Console Goal was to create a Virtual Console to control a hardware deviceto control a hardware device
Hardware was a 4-Channel Hardware was a 4-Channel addressable RGB display deviceaddressable RGB display device
VB Components encapsulate large VB Components encapsulate large amounts of functionalityamounts of functionality
Drag/Drop Development of UIDrag/Drop Development of UI Demonstrated Hardware ControlDemonstrated Hardware Control
Questions (?)Questions (?)
William KochWilliam [email protected]@kochworx.comwww.kochworx.comwww.kochworx.com973.534.6367973.534.6367