Programming with IZL  - examples

General tips

The following examples are tested with IZL 2.0 from December, 12 1995.

Many of the following examples have i created for the Controlprogram for
my YAESU FRG-100 between other programs, they use the serial port. You can
use this examples also for other projects. In this text you found a part of
each program with description.

With this collection i will make easier the beginn of programing with IZL.
And i think a little program with explanation is better as nothing.

If you need a special example or program or have you some interesting
example, please write to me. See at contact.

Many thanks to John Ferras, the programmer from IZL for his help.

Sorry for my bad english.
Dirk Haase

contact:
--------
Internet e-mail: haased@aol.com
AOL:             HaaseD
GeoholicsNet:    54:496/1520.11
Fido:            2:249/3570.10
GeoBoxNet:       230:236/0.9997

--------------------------------------------------------------------------
WECHSEL.IZL - 8 change-buttons (on/off), output as decimal value.

This example cpme from a sub-program from DEMO.IZL (bundeled with IZL 2.0)
and was broaden with the evaluation of the buttons. The 8 buttons present
a value from the 8 bit row, the first button has the value 128 and the last
(8th) value is 1. (128 / 64 / 32 / 16 / 8 / 4 / 2 / 1 ) This assign can you
change in what you will. For my project i need the 8 bit row to control a
circuitry on the serial port (for example: switch on/off a lamp). The
output from the decimal-value i need only to control.

Explanation for button one:

button bout1, ftasten;            # definie the button "bout1" into the frame
                                  # "ftasten".
char_size 2,1;                    # define the size to 2 charters width and
                                  # 1 charter high.
display btn1;                     # diplay the variable btn1. btn1 was defined in
                                  # the variables-section with btn1="";
invokes bout;                     # prush you the button, the call IZL the
                                  # function bout.
end;                              # end of the button-definition

function bout;                    # evaluation (shorten for button 1)
if btn1 = "";                     # when btn1 = "",
 btn1 = char(195);                # then get btn1 the charter 195.
else;                             # else (btn1 = charter 195),
 btn1 = "";                       # get btn1 = "".
end_if;                           # end of first if.
put bout1, btn1;                  # get variable btn1 to button bout1 - this
                                  # is the change.
end_if;                           # end of second if.

The evaluation for the value follow in a similar way, but the numeric
variable o1 get a value. At the end of the function "bout" are add all
values (o1 to o8) and put it into a textfield. 

--------------------------------------------------------------------------
TASTEN.IZL - directly input as decimal-value.

This example demonstrate the teamwork from the functions "button" and
"startup". Where you earlier have define button for button, you can do
that now with some lines of IZL-code. This is important, because the
number of objects and functions is limit.

I use this program in my control-program to call a memory channel
directly.

Note: The function "startup" will run automaticly the you run the
program. Into the frame-definition i have set the wrap to 8.

button btn[size], fgesamt;        # button-definition in frame "fgesamt"
char_size 2,1;                    # set sizee to with 2 an hight 1
invokes anzeige;                  # when you prush the button, IZL call
                                  # the function "anzeige"
end;                              # end of button-definition

function startup;                 # definie the function "startup"
while i < size;                   # if "i" smaller as the value from "size"
                                  # run the following command.
  put btn[i],i;                   # put the value "i" to the button "i".
                                  # So have every button one value and this
                                  # will displayes on the button.
  i=i+1;                          # the value of variable "i" enlarge around 1
end_while;                        # end of sub-function "while".
                                  # jump to start of sub-function "while",
                                  # to "i" = "size".
hide btn[0];                      # hide the button with the value 0,
                                  # reason: the receiver has no memory
                                  # channel 0.
end;                              # end of "startup"-function.

text tmem;                        # definie the text-field "tmem"
char_size 3,1;                    # size: 3 x 1 charter
end;                              # end of definition from "tmem"

function anzeige;                 # function "anzeige"
amem = string(invokersub,0);      # "amem" is the converted string
                                  # from the prushed button.
put tmem, amem;                   # put "amem" to the textfield "tmem"
end;                              # end of deinition.

---------------------------------------------------------------------

8EINGANG.IZL - Optical evaluation.

This example demonstrate the optical evaluation from a decimal value.
Put in the value into the value-field and click on the button "testen".
This evaluate the value and display the result. This program use also
the 8 bit row, value maximum 255. If the value bigger than 255 you get
a error-message.

Example for 8th Output-field:

value vinput;                     # value-input
display a;                        # when the program starts then display "a"
end;                              # end of definition

text itext8, fausgabe;            # define the text-field "itext8" in frame
                                  # "fausgabe".
char_size 2,1;                    # fieldsize: 2 x 1 charter
end;                              # end of definition

function idisplay;                # Output-function
put itext8, e8;                   # Put the string "e8" to the text-field
                                  # "itext8". In the variables-definition we
                                  # define e8 = "" and so is the field empty.
end;                              # end of definition

function itest;                   # function "itest". This runs, when you
                                  # click on the button "testen".
get vinput, a;                    # get value "vinput" to variable "a"

if a >= 128;                      # if value "a" bigger or identical with 128,
 a=a-128;                         # then add up 128 from "a" and define
 e8 = "X";                        # variable "e8" with "X"
end_if;                           # end of if-funkcion

# all values are worn down from the the 8 bit row. At the end is
# a = 0.

call idisplay;                    # call function "idisplay".
                                  # description see up.
e8 = "";                          # set string "e8" to "", this avoid an error
                                  # by the next pass.
end;                              # end of function "itest".

--------------------------------------------------------------------------
E-BINAER.IZL - Evaluation in a binary-value

The format as 8EINGANG.IZL (see up). The difference is that you set the
string not to "" or "X", but 0 and 1 - the binary-code. If the value bigger
than 255, then will the program fill all fields with "8".

--------------------------------------------------------------------------
T-SENSOR.IZL - graphic evaluation, example for temperature-sensor

The following program demonstrate the graphic evaluation from values,
that the program get over the serial port - from a temperature-sensor.
In this example i simulate the the sensor with a value-input-field.
Note: this statement works only on the desktop correct, if you will use
it on a black/wihte screen (Zoomer, HP OmniGo 100) you must correct the
values by postion.

Insert a value in the value-field bottom and click at "Temperatursensor",
this will display the value in the graphic-area.

graphic g1,f_temp;                # definition of graphic-object g1
                                  # for the thermometer
pixel_size 10, 200;               # size: 10 pixel wide and
                                  # 200 pixel high.
end;                              # end of definition.

value vtemp1;                     # value-field "vtemp1"
display vtemp;                    # display the temperature-value.
                                  # at the start ist the value = 0.
end;                              # end of definition.

label ltemp0;                     # label for scale-inscription
                                  # "0C" with line.
display "- 0 " & char(251) & "C"; # definition of the strings.
position 80,235;                  # display the label at position
                                  # x = 80 and y = 235.
end;                              # end of definition

function temp;                    # function "temp". They evaluate and
                                  # dispplay the temperature
get vtemp1, vtemp2;               # get value to variable
vtemp = 200 - (vtemp2 * 3);       # value "turn" - for correkt
                                  # display and zoom the value for better
                                  # display.

set g1, fill_color, "red";        # set fill-color to red
fill g1, rectangle, 10, 200;      # fill the graphic-object "g1"
                                  # with red.
set g1, fill_color, "white";      # set fill-color to white
fill g1, rectangle, 10, vtemp;    # fill the not-used are with white

# This both functions will ever overwrite the previous displaying and
# so you get the appearance from a right thermometer.

--------------------------------------------------------------------------
DATUM-K.IZL - make topical the date and time with one click.

This example evaluate and display the actually date (european format) and
time with IZL. Make topical the date and time with one click. I use this
for my logfile that read the actually data (frequency, mode...) from
the receiver and put it together with the date and time into it. If you
need a leading sero then make a if-function and if the string one-digit
then add "0" to the string. (10:3:7 --> 10:03:07) If you start the
program, then will display it 00.00.00 - 00:00:00.

variables;                        # begin of variables-definition
showtime= "00.00.00 - 00:00:00";  # set variable "showtime"
end;                              # end of definition

label l1, ftime; display ""; end; # put free space between the top and
                                  # label "lakt"
label lakt, ftime;                # define label for date and time
display showtime;                 # display date and time.
end;                              # end of definition
label l2, ftime; display ""; end; # put free spave between label "lakt"
                                  # and the button
button akt, ftime;                # define button "akt"
display "Auffrischen";            # display "Auffrischen" on the button
end;                              # end of definition

function akt;                     # ser-function

showtime=DAY(NOW())&"."&MONTH(NOW())&"."&YEAR(NOW())&" - "&HOUR(NOW())&  
":"&MINUTE(NOW())& ":" & SECOND (NOW());

# The date and time-variable "showtime" includes the single-functions:
# DAY, MONTH and YEAR for the date and HOUR, MINUTE and SECOND for the time.
# NOW get the actually values.

put lakt, showtime;               # get the date and time to the label
                                  # "lakt" and this display the
                                  # actually values.
end;                              # end of function.

--------------------------------------------------------------------------
DATUM-D.IZL - date and time make topical the date and time ever

This program is similar DATUM-K.IZL (see there), but if you click on
"Start" the date and time is ever actually. With help from the timer-
function will run the read-function each second.


label nowtime, ftime;             # define the label for the date
                                  # and the time
display showtime;                 # display date and time
end;                              # end of definition

button refrshtime, ftime;         # button to start the evaluation
                                  # and timer-function
display "Start";                  # display "Start" on the button
end;                              # end of definition

function refrshtime;              # evaluation and timer-function

showtime=DAY(NOW())&"."& MONTH(NOW())& "."&YEAR(NOW()) &" - " &  
HOUR(NOW())& ":"& MINUTE(NOW())& ":" & SECOND (NOW());

put nowtime, showtime;            # put date and time to variable
                                  # "showtime" and display the
                                  # actually date and time.

timer refrshtime, 60;             # timer-function: the function
                                  # "refrstime" will run after 60/60
                                  # seconds = 1 second.

end;                              # end of definition

--------------------------------------------------------------------------
UMSCHALT.IZL - several screens and other things

This example demonstrate the possibility of serveral screens. This is
very meaningful, when you have many buttons and fields and not enough
space on one screen. Also will display this program the definition of
the size from frames and buttons, show and hide menu-items.

menu_item fs1;                    # definie the menu-item "fs1"
display "Zum Screen 1";           # inscription for menu-item
hidden;                           # hidden menue-item, because screen1
                                  # is the start-screen.
end;                              # end of menu-item definition.

frame f1;                         # frame-definition
pixel_size 250,300;               # size: x=250 and y=300 pixel
vertical;                         # arrangement: vertical
center_h;                         # arrangement: center horizontal
box;                              # display the frame
end;                              # end of frame-definition

button fs2, f1;                   # button "fs2" in frame "f1"
display "Zum Screen 2";           # inscription for the button
char_size 20, 10;                 # size: x=20 and y = 10 charter
end;                              # end of button-definition

button fs3, f1;                   # button "fs3" in frame "f1"
display "Zum Screen 3";           # inscription for the button
pixel_size 100, 100;              # size: x=100 and y=100 pixel
end;                              # end of button-definition

label lt2e, f2; display "den Men"&char(159)&"eintrag UMSCHALT.";

# label into frame "f2". Level-headedness here are the special-charter
# in the text. "char()" display the special-charter. For the code see
# handbook C.2. and C.3.

function fs1;                     # function for menu-item "fs2".
hide f2;                          # hide frame 2 "f2"
hide f3;                          # hide frame 3 "f3"
show f1;                          # show frame 1 "f1"
hide fs1;                         # hide menu-item 1 "fs1"
show fs2;                         # show button 2 "fs2"
show fs3;                         # show button 3 "fs3"
end;                              # end of definition

--------------------------------------------------------------------------
CAT4GEOS.IZL - control the shortwave-reciever YAESU FRG-100 over the
               serial port

That program i write specially for my shortwave-receiver. Some examples
work into this. The each functions (use the serial port, convert
hexadecimal in decimal ...) are adapt for this specially use. If you have
questions, write me.

At time (july 1996) i work on version 1.0. New features are:
- read the s-meter (signal-strength)
- read some parameters (frequency, mode ...)
- write some informations to a log-file
- i will make a version for the desktop and one for the HP OmniGo 100

--------------------------------------------------------------------------
END
