Category : Science and Education
Archive   : HC21DEMO.ZIP
Filename : README.TXT

 
Output of file : README.TXT contained in archive : HC21DEMO.ZIP
Changes between HC2000 versions 1.1 and 2.1.
--------------------------------------------

A User Program that was created for version 1.1 will work with 2.1 if
the file extension (.HC) is schanged to .HC2 and if a spare byte in each
"Call" and "After delay Call" is set to zero. The HCUPDATE.EXE utility
is provided to do this in one quick pass.


Here are the additions and changes to the HC2000 language:-
-----------------------------------------------------------

It is now easier to get the remainder of an integer division with the
"Modulo" statement. Thus the following statement will leave the remainder
of XXX divided by 60 in XXX:-

XXX Modulo by 60

The "in the" padding and the quotation marks (which just waste space
on the line) has been removed and the Room name appears first. The User
Program does not have to be changed for this, because it is a feature
of the new HC2000 Interpreter. Thus:-

Old form (1.1) ... "Ceiling Light in the Kitchen"
New form (2.1) ... Kitchen Ceiling Light


A "Flush" statement has been added that forces a call to the X10 Driver.
This means that all pending X10 signals will be flushed into the buffer
now rather that waiting for the end of the Event sequence. Thus the
following example , the module will sweep up and down in a series of
Brights and Dims. Without the Flush statements, the module would just
go to 100% :-

Woo-Woo the Kitchen ::=
Set Kitchen Ceiling Light to 100%
Flush
Set Kitchen Ceiling Light to 20%
Flush
Set Kitchen Ceiling Light to 80%
Flush
Set Kitchen Ceiling Light to 0%
Flush
Set Kitchen Ceiling Light to 100%


The "If" statement has an additional form to test the current brightness
level of a Module. Examples:-

If Kitchen Ceiling Light = 40%, then
If Kitchen Ceiling Light >= 10%, then
If Kitchen Ceiling Light is 40%, then
If Kitchen Ceiling Light is not ON, then


The "Right" shift command to indent statements that are subject to "If"
and "Else" statements has an added feature. After ten shifts, the whole
statement is "Commented out" and will not be executed. The "Left" shift
will bring it back again.


The Editor makes a better estimation of when to indent after an "If"
statement; not perfect, but better.


There are five Boolean Option Flags that control features in the HCEDIT
Editor program. They are:-

Share Addresses ... Allow two or more Module names to be assigned to
the same X10 Address. (Forbidden in 1.1).

Screen Timeout .... Causes the Screen to Blank-out if showing the Status
Display and there have been no changes for one minute.

Go Status ......... Go directly to the Status display when HCEDIT is
loaded.

Enable F10 ........ Allow the direct execution of any Subroutine from
within the Editor. Once a subroutine has been "Marked",
(first select the subroutine name and press F5,)
it can be executed with the F10 function key no matter
which Editor display is showing at the time. You can
now watch the Log Buffer from the Editor (new feature
in 2.1), or the Variables list or the Status of all
modules. This feature is most useful during program
creation and debugging.

Call Keyword ...... The "Call" keyword can be shown, or not. This option
makes User Program reading better if subroutine names
that expect a Module Parameter (see next item) are
carefully chosen:-

Turn Down the Kitchen Ceiling Light
Lower the Kitchen Blind
After 5 Mins, Close the Garden Left Gate

In the above, "Turn Down the", "Lower the" and
"Close the" are subroutine names.


Subroutines can have one optional Module name Parameter. (Use User defined
Variables to pass other numeric information). Within a subroutine, the
passed parameter is specified as "the Module". (This is shown as a Room
called "the" with one Module called "Module".) The parameter can be
passed to nested subroutines too. In the following example, "Level Code" is
a variable (0, 1, 2, or 3) that signals what is to happen to the named
Module. If the Code is 3, then another subroutine is called to act on the
same Module:-

Adjust the ::=
If Level Code = 0, then
Set the Module to 0%
If Level Code = 1, then
Set the Module to 40%
If Level Code = 2, then
Set the Module to 100%
If Level Code = 3, then
Do crazy things to the Module

Do crazy theings to ::=
Set the Module to 100%
Flush
Set the Module to 0%
Flush
Set the Module to 80%
Flush
Set the Module to 50%
Flush
Flash the Module 3 times

And now to "Call" the above...

Into Level Code put 2
Adjust the Kitchen Ceiling Light


There is a new System Variable called "Button Number" that contains an
encoded ID of the most recent X10 external event. The numeric value is
composed of the House Code, the Unit number and an ON/OFF indicator. Thus
it is the sum of:-

The House Code * 100 { A = 100, B = 200, ... P = 1600 }
The Unit or Key code { Button 1 = 1, Button 12 = 12, Dim = 31 }
ON/OFF Flag { ON = 0, OFF = 50 }

Thus:- 231 ... House Code "B" Dim.
306 ... House Code "C", Unit 6 ON.
356 ... House Code "C", Unit 6 OFF.
1623 .. House Code "P", Bright.

Here is an example of how it can be used:-

On Undefined ::= {Any unfielded X10 event comes here}
Into House Code Put Button Number
Divide House Code by 100 {House Code is now 1..16)
Into Unit Code Put Button Number {get another copy}
Modulo Unit Code by 100 {Unit Code may have 50 extra}
if Unit Code = 23, then
{Do something with the BRIGHT button }
if Unit Code = 31, then
{Do something with the DIM button}
If Unit Code > 50, then
From Unit Code Subtract 50
{Do something with the ON button}
Else
{Do something with the OFF button}

This feature is most useful when many buttons can be processed by the
same set of subroutines. Remember that a correcly formed Remote subroutine
name in the User Program will catch specific buttons and not call the
"On Undefined" routine. So, if a Button is used as a unique item, use the
Remote name, otherwise the above technique may be best. (It costs less in
Subroutine Names which are limited to 100 total.)


A new "Sound" statement has been added. It plays a very short beep at a
frequency determined by a user Variable. It is not meant for playing music
but rather for simple confirmation signals:-

Toggle and Confirm the ::=
Toggle the Module
If the Module < 50%, then
Sound Middle C
Sound A
Else
Sound A
Sound Middle C

The above could be called by:-

Toggle and Confirm the Kitchen Ceiling Light
Toggle and Confirm the Garden Pool Pump


There is a "Trace" statement that turns ON or OFF the new trace feature.
When turned ON, all X10 signals are logged to the Log Buffer along with
Module references, User Program line numbers and a Time Stamp. This is
useful for setting a debugging trap:-

If Hour > 23, then
If the Cat is out, then
Trace ON
...... { All trace info goes to Log}
Trace OFF


The "Cut" and "Paste" commands use a FIFO stack (30 deep) instead of the
single line Clipboard in version 1.1 of HCEDIT. Also, a "Copy" command
has been added that copies lines to the stack without deleting them. This
makes it much easier to move lines around the User Program.


The List of User Variables permits you to move items around, leave blanks
and group together related items (such as Constants, Log messages etc). If
you can spare a line as a Comment or Blank, the list reads better:-

--- Some Constants ---
True 1
False 0
Middle C 261
A 440
Awake 1
Sleeping 2
On Vacation 3

--- My Variables ---
House Code 9
Unit Code 12
Level Code 2
The House 1
Kitchen Delay 600

--- My Log Msssages ---
Someone is at the Front Door
The Alarm has been set

--- Foreground DOS Calls ---
DOS PLAY.EXE TADA.VOC
DOS PLAY.EXE GIDAY.VOC
DOS PAGER.EXE 5924609 567


The Colors used by HCEDIT have been tamed. However, if you are using a
Black/White display, it helps to specify BW80 at the DOS level:-

C:> mode bw80


You can use a Variable as a delay in any statement that uses a delay. The
list of User Variables will be found after the "About 12 Hours" entry.

After Kitchen Delay Shutdown the Kitchen
Set Kitchen Ceiling Lamp to 100% then 0% after Kitchen Delay


And finally, both Version 2.1 HC2000 Home Control Terminate and stay
resident X10 driver dedicated PC internal battery backup real time
auto correcting sixty Hertz to User Clock Interrupt phase-shift
wimble-washer range limiting truncation constant values have been
improved, but you are not likely to notice much difference.


Graeme Scott
613-592-4609












  3 Responses to “Category : Science and Education
Archive   : HC21DEMO.ZIP
Filename : README.TXT

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/