background image

 6

EA KIT129-6

MACRO PROGRAMMING

Single or multiple command sequences can be grouped together in macros and stored in the EEPROM.
You can then start them by using the 

Execute macro commands. There are 4 different types of macros:

Touch macros (1..255)
These are started when you touch a touch field (in versions with a touch panel - TP) or when you operate
an external key/matrix keyboard. Touch macro no. 0 is different: It is started when you release any key.
Port macros (0..255)
These are started when voltage is applied to IN  1..8.
Normal macros (1..255)
These are started by means of a command via the serial interface or from another macro. A series of
macros occurring one after the other can be called cyclically (movie, hourglass, multi-page help text).
Power-on macro
Normal macro no. 0 is different: It is executed automatically after power-on. It allows you to switch off the
cursor and define an opening screen, for example.

Note:

 Programming an endless loop in Power-On-Macro makes the display non-accessible. In that case

switch DIP 5 to ON position, power off, and then power on again and DIP 5 back to off position. Now all
fonts and macro must be downloaded again.

STORING 256 IMAGES IN THE EEPROM

To reduce the transmission times of the serial interface or to save storage space in the processor system,
up to 256 images can be stored in the internal EEPROM. They can be called using the "ESC U E"
command via the serial interface or from within a touch/port/normal macro. All the images can be used
in the Windows BMP format. They can be created and edit using widely available software such as
Windows Paint or Photoshop.

CREATING INDIVIDUAL MACROS

To create your own macros, you need the following:
- the EA DISK240

*) 

floppy disk, which contains the

compiler, examples and fonts

- a PC with a COM1 or COM2 serial interface and

approximately 500KB hard disk space

- a text editor such as WordPad or Norton Editor
To define a sequence of commands as a macro, all
the commands are written to a file on the PC (e.g.
DEMO.KMC). You specify which character sets are
to be integrated and which command sequences are
to be in which macros.
Once the macros are defined, you start the program
KITCOMPILER.EXE. This creates an EEPROM file
called DEMO.EEP, which is then automatically
stored in the display EEPROM with the baud rate
entered. This only takes a few seconds, and you can
then use your user-defined macros immediately. You will find a detailed description of how to program
macros, together with a large number of examples, in the files DOKU.DOC (for WORD) and DOKU.TXT
(DOS) on the EA DISK240

*)

 floppy disk.

WRITE PROTECTION FOR PROGRAMMED MACROS

You can use DIP switch 6 to prevent the programmed macros, images and fonts from being inadvertently
overwritten (see page 4).

*)

 Also on the Internet: http://www.lcd-module.de/deu/disk/disk240.zip

;Macro Demo

KIT129-6

; KIT type

COM2: 115200

; connected to COM2,

; baud rate 115,200 baud

;----------------------------------------------------------

;define constants

OFF =  0
ON  =  1

FONT4x6 = 1

FONT5x6 = 2

FONT6x8 = 3

FONT8x8 = 4
FONT8x16= 5

;----------------------------------------------------------

;include fonts

Font: FONT4x6,  32, 95  INTERN4x6

Font: FONT5x6,  32,158  INTERN5x6
Font: FONT6x8,  32,158  INTERN6x8

Font: FONT8x8,  32,158  INTERN8x8

Font: FONT8x16, 32,158  INTERN8x16

;----------------------------------------------------------

Makro: 0

; power-on/reset macro

#QC ON

; visible cursor

#FT FONT8x16

; set terminal font

#UL 0,20,<EA2.BMP>

; ELECTRONIC ASSEMBLY logo

Summary of Contents for EA KIT129-6

Page 1: ...A AND OR EXOR BARGRAPH UPTO256MACROSPROGRAMMABLE COMBINATIONOFTEXTANDGRAPHICSALLTHETIME BUILTINSOFTWARESUPPORTSTOUCHPANEL OPERATINGTEMPERATURERANGE 20 70 C STORAGE 30 70 C ACCESSORIES WITHTOUCHPANEL5x3AREAS ANTI GLAREANDSCRATCH PROOF FLOPPYDISKFORMACROPROGRAMMING PCDOS WIN EADISK240 CABLE 1 5m FORCONNECTIONTO9 PINSUB D RS 232FEMALE EAKV24 9B ORDERINGINFORMATION 128x64WITHTOUCHPANEL5x3 LED B L BLUE...

Page 2: ... keys and the labeling or grouping of several fields is handled by the integrated software SOFTWARE The graphic kits are programmed by means of commands such as Draw a rectangle from 0 0 to 64 15 Noadditionalsoftwareordriversarerequired Stringscanbeplacedwithpixelaccuracy Text and graphics can be combined at any time Up to 16 different character sets can be used Thus when the 8 times zoom is used ...

Page 3: ...rs convenient commands supporting this touch panel It is possible for example to group a number of touch fields to form a single large key and then draw and label the key Youcanalsoassignarecordcode 1 255 tothekeyyouhavedefined Ifareturncodeof0isassigned the key is disabled and has no effect when it is pressed When the touch keys are touched they can be automatically inverted and a tone can sound ...

Page 4: ...240 zip BAUDRATES The baud rate can be set by means of the 3 DIP switches on the left 9 600 baud issetatthefactory DIP 3ON Pleasenotethattheinternaldatabufferonlyholds 16bytes ItisthereforeimperativethattheRTShandshakelinebequeried alevel of 10Vmeansdatacanbeaccepted alevelof 10Vmeansthedisplayisbusy The data format is fixed at 8 data bits 1 stop bit and no parity WRITEPROTECTIONFORPROGRAMMEDMACRO...

Page 5: ...dforslowoperations inotherwords morethan 3changespersecondcannotbeeasilyexecuted Ifaninputisleftopen itislogical high internalypulled upvia100kOhm 8outputs Writing the command ESC Y M anz will redefine one or more line as an output Upper lines will be outputsandlowerlinesstayasinputs Command ESCYM2 forexample defines IO8 and IO7 as output lines and IO1 6 will stay as inputs Each re defined line ca...

Page 6: ...ble software such as Windows Paint or Photoshop CREATINGINDIVIDUALMACROS To create your own macros you need the following the EA DISK240 floppy disk which contains the compiler examples and fonts a PC with a COM1 or COM2 serial interface and approximately 500KB hard disk space a text editor such as WordPad or Norton Editor To define a sequence of commands as a macro all the commands are written to...

Page 7: ...rs A font editor on the EA DISKFONT1520 floppy disk allows you to create and program in any font you like with a size of up to 16x16 pixels Font 5 8x16 Font 3 6x8 Nr Char Height Lines x Chars Size in pixels ASCII area Note 1 2 6 mm 13 x 40 4 x 6 32 95 Micro 2 2 6 mm 13 x 32 5 x 6 32 158 Mini 3 3 6 mm 10 x 26 6 x 8 32 158 Normal 4 3 6 mm 10 x 20 8 x 8 32 158 Bold 5 7 2 mm 5 x 20 8 x 16 32 158 Big T...

Page 8: ...te 3 inverse 4 replace 5 inverse replace Set point ESC P x1 y1 Sets a pixel at position x1 y1 Draw straight line ESC G x1 y1 x2 y2 Draws a straight line from x1 y1 to x2 y2 Continue straight line ESC W x1 y1 Draws a straight line from the last end point to x1 y1 Rectangle commands Draw rectangle ESC R R x1 y1 x2 y2 Draws a rectangle frame from x1 y1 to x2 y2 Draw rounded rectangle N x1 y1 x2 y2 Dr...

Page 9: ... add Activates the kit with the address n1 n1 255 all D add Deactivates the kit with the address n1 n1 255 all A add Assigns a new address add in the power on macro for example Wait pause ESC X n1 Wait n1 tenths of a second before the next command is executed Buzzer on off ESC J n1 n1 0 tone off n1 1 tone on n1 2 255 for n1 1 10s long on Send bytes ESC S num data Sends num 1 255 0 256 bytes at the...

Page 10: ... ev value pat ret frm data Numerical values are transferred with 1 byte Example n1 15 dec 0F PROGRAMMINGEXAMPLE Thefollowing tableshowsanexampleinwhichthestring Test isoutputleftjustifiedatcoordinate7 3 Example Codes to be output In ASCII ESC Z L BEL ETX T e s t NUL In hex 1B 5A 4C 07 03 54 65 73 74 00 In decimal 27 90 76 7 3 84 101 115 116 0 For Turbo Pascal write aux chr 27 Z L chr 7 chr 3 Test ...

Page 11: ...graph but does not display it Example 1B 42 4F 01 04 02 09 1E 04 14 01 Bar graph no 1 which extends upwards is defined When it is fully extended it takes up an area from 4 2 to 9 30 The start and end values correspond to a 4 20 mA display The diagram shows the bar graph fully extended as represented with 42 01 14 ESC B no value Draw bar graph The bar graph with the number n1 1 2 is set to the new ...

Page 12: ... x2 y2 Create hard copy of display contents Requests the area from the upper left corner x1 y1 to the lower right corner x2 y2 The graphics chip then immediately sends the width and height of the image section followed by the image data See the upload image command U for the structure of the image data Example 1B 48 00 00 1F 0F The upper left part of the screen 32 x 16 pixels is sent via RS 232 ES...

Page 13: ...D 4E 0F The normal macro with the number 15 is executed ESC M T n1 Call touch macro Calls the touch macro with the number n1 0 255 Example 1B 4D 54 03 The normal macro with the number 3 is executed ESC M P n1 Call port macro Calls the port macro with the number n1 0 255 Example 1B 4D 50 01 The normal macro with the number 1 is executed ESC M A J n1 n2 n3 Execute macros automatically Calls the norm...

Page 14: ...rsor Example 1B 51 44 00 0F 07 10 Defines the flashing area from 0 15 to 7 16 ESC Q Z n1 Set flashing time Sets the flashing time to n1 1 15 tenths of a second When n1 0 the flashing function is deactivated and the original screen restored Example 1B 51 5A 03 Sets the flashing time to 0 3 seconds ESC R R x1 y1 x2 y2 Draw rectangle Draws a rectangle from the upper left corner x1 y1 to the lower rig...

Page 15: ...lower right corner x2 y2 with the pattern pat taking into account the set graphics mode ESC V set delete invert replace inverse replace Example 1B 52 4D 05 01 2D 1A 07 Fills the area with the pattern 7 45 cross from 5 1 to 45 26 ESC R O x1 y1 x2 y2 pat Draw box Draws a rectangle from the upper left corner x1 y1 to the lower right corner x2 y2 with the pattern pat The background of the box is delet...

Page 16: ... word TEST ESC T P R Preset reset touch fields Assigns P ascending return code 1 60 or R reset all touch fields to all 60 touch fields In the latter case all touch fields receive the return code 0 i e they are deactivated Example 1B 54 52 All touch fields are deactivated by this command and no longer recognized ESC T I S n1 Touch key response These commands set the automatic response of the touch ...

Page 17: ... P Set point ESC G Draw straight line ESC W Continue straight line ESC R R Draw rectangle ESC R N Draw rounded rectangle ESC R M Fill area with pattern Example 1B 56 03 Sets the link mode to inverse By way of example a rectangle is drawn alongside with the link modes set delete and inverse on an existing background Link mode n1 1 set black pixels irrespective of the previous value OR 2 delete whit...

Page 18: ...cation on page 5 Example 1B 59 57 02 01 Switches the output port I O2 to high level ESC Y A n1 Automatic port query on off Each change at the input port 8 bit binary value I O8 I O1 can call a port macro 0 255 This command activates n1 1 or deactivates n1 0 the automatic port query After power on the current port status is read and the associated port macro executed immediately Example 1B 59 41 01...

Page 19: ...xample 3 Writes the text Right Ok right justified at 49 0 1B 5A 52 31 00 52 69 67 68 74 7C 4F 6B 00 ESC Z O M U x1 y1 text NUL Vertical string Writes the string text rotated by 90 degrees top justified O vertically centered M or bottom justified U at position y1 taking into account the text mode ESC L Multi line text can also be output with the lines separated by the character 7C The string must b...

Page 20: ...without using of chemical solvents Themoduleisdesignedforindooruseonly Foroperatinginoutside enviromentadequateprecautions mustbeundertaken Maximumoperatingtemperaturerangefrom 20 70 Cshouldbenotexceeded Please note that ambient temperature range is different because of self heating of module In humid atmosphereorincondensingsituationsthemodulefunctionsmaydropout Directsunexposuretothe display sho...

Reviews: