Birth of a Timed Greenhouse Command Server in VB6

0. A zipped file is available that can be used to set up an executable VB6 program.
Run Setup.exe to install (then it is easy to uninstall via the control panel in Windows :-)  Or, find a copy of VB6,
compile and customize your own version.  In theory this program will communicate eventually with a MSP430 or PIC 
processor on the wall of the GH mud room/lab.  Currently it does all that a controller needs to do except control :-)

1. Type in commands in format given at bottom of form.  Two features simplify this, a text window at the bottom of
the screen provides code you can paste and edit in the entry box.  Also, if you decide you turned on the wrong lights
you can select that command by clicking on it and then right click, the code will appear in the entry box for additional 
edit and reentry  Then you can go back and delete the original command by selecting it ant then pressing the delete
key.  A practice program called "River" is stored in the zipped file as well. You can load it to see how it looks.  
A picture of the main screen appears below:

2. When you hit plot, a picture of the events should appear. There is a print button included that
can be used to create a hard copy plot.  There are six each light relays, water solenoids, and misting timers.
The misting timers are assignable to water solenoids using the P command followed by the requested mist
timer number.  You can then include 3 more numbers, on time, off time, and an offset in seconds for the 
sequence. This is used so the mist sprayers don't all turn on and off at similar times.

3. If you hit the sim button, a simulation of the greenhouse controller is run in a separate window.
4. The goal is to provide two remote modes.  In one, the simulator locally would pump the data as a simple numbered string
5. The second is to send all the control strings in temporal order to the microprocessor for execution as the day passes
6. At the bottom of the main form, whenever the code is run, a simplified comma delimited version of the script appears where all times are
    in seconds and all command lists are simple numbers, no letters.  This is in anticipation of actual success, ha!! FCIH.
    For example:
    timer P2  appears as the number 12,
    ON appears as the number 1
    Off appears as the number 0
    not programmed appears as the number -1
Why the simplicity. Well, while the MSP430 is more than capable of ripping down through such a list in a timely fashion, 
I already have a board designed just for this purpose using a PIC controller, but it only has an RS232 line with no 
flash memory and our local REMC is not that outage friendly.
So this is a pre-pre-pre-beta monster, raw code, virtually no documentation, no msp430 communications
no error checking, and variable names only I can remember after a few hours on a lawn tractor, etc.
Known issues:
1. What isn't?
*2. Won't handle single command programs.
*3. Won't handle situation where no control program exists.
4. Does not tolerate long time delays, pending command requires exact second by second match, silly me.
*5. One serious fatal is suspected to exist in simulation mode found out while writing plot routine.  
6. No error trapping
7. Forcing and preloading of light, heat, and water status not yet implemented. i.e. All those pretty
     checkboxes on the front form don't mean anything.
8. Loading and unloading of forms not properly coordinated, may crash after multiple loads.
*9. Print button too close to exit button on plot, 
9.5 no printer dialog box
10. Save and load are simplistic, no suffix support.
11. You really have to work to get stuff happening in real time and no way to FF (fast forward) the sim.
12. Plot and hard copy of plot do not show timer times
13. Print of long programs never tested
14. No communications yet
15. Plots and appearance not tested for screen resolutions and operating systems other than local computer
16. No sim "catchup", you start at current time and work your way thru the 24 hr. control cycle so a mister
that was supposed to be on at 3PM may not be if you just started the program at 2PM and the command is set to
engage at say 9AM every day.  Alternately a mister period could be set wrong for the same reason, and when 
flat 4 was supposed to get 1 second every 5 minutes, it got the default of 1 second of every 10 seconds. Glub, glub,
another drowned asparagus.


Main Screen after a sim or plot run.
main form should appear here

Plot as it appears on screen and printout
plot should appear here