BitMachine Screen: External Design      1.00                12/15/97 Terry King

Ŀ
HelpLoadQuitEditRun StopStepBreak   Save                           
 F1  F2  F3  F4  F5  F6  F7  F8   F9 F10                           
Ĵ
OUTPUT NAMES AND PIN NUMBERS                    INPUT PIN NUMBERS AND NAMES   
Out0    (2)Ŀ                   (17)In7     
Out1    (3)Ŀ TIMER1 01:30:23.367 (16)In6     
Out2    (4)Ŀ  TIMER2        4.528  (15)In5     
Out3    (5)Ŀ                         (14)In4     
Out4    (6)Ŀ                           (13)In3     
Out5    (7)Ŀ     COUNTER1          6     (12)In2     
Out6    (8)Ŀ                               (11)In1     
Out7    (9)Ŀ                                 (10)In0     
                                                              
StepName Step  - O U T P U T -                   - I N P U T - -      NextStep
-------- ---- |   |   |                 |   |   |     --------
Start    0001  1 0 1 0 1 0 1 0                                        +       
         0002  x x x x x x I I                                        +       
         0003  WAIT .100                                              +       
         0004  I I I I I I I I                                        Start   
                                                                              
Ĵ
StepNow = 000 ---( ...Context-Dependent Messages )-----      Samples = 00099

Design Notes:      (-)Means 'not done yet!'
1. Stepnames:  1 to 8 chars. Case INsensitive, converted to UC.
2. NextStep :  One of:   <Stepname>   Go to step StepName
                         <blank>      Next step (default)
                    (-)  + n          Add n to current Step for NextStep
                    (-)  - n          Subtract n from current Step for NextStep
3. OUTPUT Bits: One of:  1            Set to 1
                         0            Set to 0
                         X            Unchanged
                         I            Invert from value in BitsNowOn
                         R            Random 1 or 0
                    (-)  < or >       Shift into adjacent Bit. "^" means do
                                         not propagate further
                         <Internal Command> (See following section)
                         <External Command> (See following section)

3. INPUT  Bits: One of:  1            Test for 1
                         0            Test for 0
                         X            Don't Care
At each step, each input bit that is not X (Don't Care) is tested for it's
value.
The possibilities are:
1.The test result is TRUE. The machine goes to the step in NextStep
2.The test result is FALSE.The machine waits SampleTime and Tests again.
3.The test result is FALSE, and 1 or more additional tests follow:
  Additional tests are entered with the T (Test) prefix and define
  another test in the Input area. In this case, multiple tests are
  done in order. If any test is TRUE, it's NextStep is taken. If all tests
  (Up until a non-BLANK output definition) are FALSE, then after SampleTime
  the tests are repeated in top-to-bottom order. 
NOTES: <Alt> Single-Key Functions: <Alt> Key Plus the Letter/Number Key

F2     :  Save   : Program on file.
F3     :  Quit   : Prompt/check
F4     :  Edit   : Edit the current line
F5     :  RUN    : Start executing from current step
F6     :  STOP   : Stop wherever we are
F7     :  STEP   : Execute the next step, then stop
F8 (-) :  BREAK  : Set a Breakpoint by Step or StepName. A running program will
                   Halt before executing the Breakpoint Step.
                   Later?: Breakpoint on data value.
F10    :  Load   : Load   Program from File

N Names (-) : Switches to a screen to edit Output and Input Names
 <Up Arrow>: Scrolls program window up one line
  <Page Up> : Scrolls program window up n lines
 <Dn Arrow>: Scrolls program window down one line
  <Page Dn> : Scrolls program window down n lines
Ctrl<Page Up> : Scrolls thru last messages
Ctrl<Page Dn> : Scrolls thru last messages
H Help      : Displays Help file (Or hopefully, context-dependent Help)
D PgmDesc   : Allows user to enter PgmDesc (shown at load time)

  Insert    : Insert a Blank Line BEFORE current (highlighted) step
  Delete    : Delete the current (highlighted) step
C Copy      : Copy current line to 'clipboard'
P Paste     : Copy 'clipboard' ON TOP OF current line

A sAmples   : Allows user to set SampleTime (Saved with program)
R Restart   : Sets Step back to beginning, clears counters/timers etc.

??Preference: Allows user to set preferences such as:
 (-)          - Display: what's visible, update rate, colors etc
              - File:    Auto save, save desktop status etc

<Alt>1 thru <Alt>8 : Toggle Output Bits ON/OFF. (Bits 7..0 Left-Right)
0

INTERNAL AND EXTERNAL COMMANDS:
-------------------------------

Commands may be entered in a step. They take the place of any Input or Output
definitions, and are entered on a line immediately after the Step label, and
can be up to 32 characters long, including command line arguments.

Commands are entered in EDIT when the cursor is on the OUTPUT entry,
by Hitting these keys:

I or i : INTERNAL Command. Built-in functions:  (Examples below)
         - WAIT       (Waits for defined time )
         - WAITRANDOM (Waits for Random time up to max of defined time )
         - SHOW       (Shows message in Msg area)
         - BEEP       (Makes sound on PC speaker)
         - COUNTER    (Controls 1 of 4 internal Counters)
         - TIMER      (Controls 1 of 4 internal Timers)
         ----( DEBUGGING COMMANDS )-----
         - STOP       (STOP the Bitmachine at this step)
         - STEP ON    (STOP the Bitmachine, wait for SINGLE-STEP button)
         - STEP OFF   (Disable single-step, resume running)

E or e : EXTERNAL Command. DOS programs that are executed and then return to
                           the BitMachine. The DOS Return Code can be used
                           to make decisions.
         Possible Examples:

         SAY "You pushed Susies button."       (Text to Speech Synth)
         PLAY brakes.wav                       (recorded audio)
         OUTDTEMP > 32                         (Check temperature)
         SONAR    < 2FT                        (Read sonar ranger)


EXAMPLES: WAIT
---------
  WAIT <time>          (Stop BitMachine for specified time)

    TIME UNITS/FORMAT:  HH:MM:SS.TTT
                       (HOURS:MINUTES:SECONDS:DECIMAL FRACTION SECONDS)
          EXAMPLES:     1:00:00   - 1 hour
                          10:00   - 10 minutes
                           1      - 1 second
                            .05   - .05 Seconds (50 Ms)
                            .001  - 1 millisecond (Approx resolution)
                       15:30.01   - 15 minutes, 30.01 seconds


EXAMPLES: BEEP <n>
---------
  BEEP             (Normal quick beep)
  BEEP <n>         (Other sound variations)
        1: BeepHi
        2: PassTone
        3: FailTone
        4: IntErrorTone
        5: Click


NOTE: COUNTERS and TIMERS are invisible until referred to in a program. Then
they appear in the area between OUTPUT and INPUT names.

EXAMPLES: TIMER<n>
--------
  TIMER1 RESET                         (Reset and start this timer.)
  TIMER1 START
  TIMER1 STOP
  TIMER1 > (TIME: TIMEFORMAT)          (Result is FALSE or TRUE (take NEXTSTEP))
  TIMER1 < (TIME: TIMEFORMAT)          (Result is FALSE or TRUE (take NEXTSTEP))

EXAMPLES: COUNTER<n>                   NOTE: COUNTERS are longint (+- 1 billion)
--------
  COUNTER1 RESET                       (Clear the counter. Default at startup)
  COUNTER1 + <n>                       (+1 : add 1, +5 :Add 5 to counter)
  COUNTER1 - <n>                       (-1 : sub 1, -5 :sub 5 from counter)
  COUNTER1 + 200
                                       ----( Compare, act on result )-------
  COUNTER1 > <n>                       (Result is FALSE or TRUE (take NEXTSTEP))
  COUNTER1 < <n>                       (Result is FALSE or TRUE (take NEXTSTEP))
  COUNTER1 = <n>                       (Result is FALSE or TRUE (take NEXTSTEP))
  COUNTER1 > 1000




TEST MULTIPLE LINES:
--------------------

This will work this way:

(Here there are 3 tests that are the only ones being checked each sampletime)
 BitMachine will loop thru steps 2 thru 4

StepName Step  - O U T P U T -                   - I N P U T - -      NextStep
-------- ---- |   |   |                 |   |   |     --------
Start    0001  1 0 1 0 1 0 1 0                   X X X X X X X X      +       
         0002  TEST---------->                   X X X X X X X 1      STEPONE 
         0003  TEST---------->                   X X X X X X 1 X      STEPTWO 
         0004  TEST---------->                   X X X X X X 1 1      STEPBOTH
         0005  WAIT .100                                              +       
         0006  I I I I I I I I                                        Start   
                                                                              

(Here there is a machine step with actions, plus a test. It is followed
 by 3 Test steps. BitMachine will loop thru testing lines 1 thru 4)

StepName Step  - O U T P U T -                   - I N P U T - -      NextStep
-------- ---- |   |   |                 |   |   |     --------
Start    0001  I I R R R R X X                   X X X X X X 0 0      STEPZERO
         0002  TEST---------->                   X X X X X X X 1      STEPONE 
         0003  TEST---------->                   X X X X X X 1 X      STEPTWO 
         0004  TEST---------->                   X X X X X X 1 1      STEPBOTH
         0005  WAIT .100                                              +       
         0006  I I I I I I I I                                        MORE    
                                                                              



SOUND:    (Sounds available as:  C: SOUND <name> <number/duration>   )
------

SOUND AttnTone               Attention-getting
SOUND IntErrorTone           Mild error
SOUND FailTone               Uh--Oh
SOUND PassTone               Upward happy sweep
SOUND PhoneRing(NumRings)    Sounds like a modern phone ringing
SOUND Ringing(NumRings)      Sounds like ringing heard on handset
SOUND Busy(NumRings)         Sounds like busy heard on handset
SOUND Washing(NumSecs)       Washing Machine agitating
SOUND Filling(NumSecs)       Washing Machine filling
SOUND Spinning(NumSecs)      Washing Machine Spinning
SOUND Drips(NumDrips)        Water drips


TO DO: (+ means Done!)
------
+ NameBits: Don't clobber program steps !!!!

- Program editing:
 + Clean up partial line stuff
 + insert/delete
 + copy/paste

- WAIT: TimeFormat

+ WAITRANDOM: <ms>

+ Timer: > and <

- NAMES editing

- SAVE / SAVEAS

MORE IDEAS:
-----------
- WAITKEY               (Wait until any key hit)
- "CLEAR" without quitting
- 'Save Screen to text' function for documentation, tutorials
- 'List Program to text file': Documents I/O, options, program, page #'s etc
- 'Test Program' checks Labels, external programs can be found,
   parameters within range, etc.
- BITMACH <ProgramName> (<RUN>)
- 'Save Read-only' for 'unbreakable' demo programs
- Incrementally compile 'time < > etc' ???
+ scroll thru last N messages (Ctrl-PageUp )
- print/file last N messages
- TIMERn CLEAR (Remove from display)
- timern NAME <TimerName>
- Inverted bit definitions different color
