117
Scripting
A table is presented at the end of this section (page 126) showing the syntax of each command. The following text
should be read and understood before attempting to generate any scripts.
Overview
Scripts are a sequence of standard BEKA commands that are downloaded into the display. These commands are then
automatically executed by the display without any host intervention. As the download program is stored in EEProm, it
remains in the unit even when the power is turned off. There are a number of ways to start and stop scripts, depending
on the protocol that is being used with the unit. If a script is present in the unit then it is automatically executed when
the power is first applied.
To aid understanding, this section of the manual discusses each command in groups of like functionality rather than
alphabetic order.
Downloading and controlling scripts
The previously described BEKA Protocol commands are used to construct the required program flow. To conserve
memory space, each command is stripped of its usual < > delimiters and is instead terminated by a
nul
character (ASCII
0). The end of the script is indicated by a second
nul
.
The <DP
n
>Download Program command is used to transmit a script from the host to the display. The maximum size of
a script can be 2048 bytes, but instead of one large download it is broken down into 32 64 byte blocks.
The transfer process MUST start with <DP0> and be done in ascending order. The value of n can be from 0 to 31,
meaning that a 2048 byte script can be loaded. The end of the script is marked by a
nul
following the command
terminator, i.e. two consecutive 0x00s.
e.g. CS
nul
WTHello world
nulnul
would (when downloaded and run) clear the screen and put “Hello world” on the top
line of the display.
Some basic checks are carried out on the script as it is downloaded, so it is possible to get a parameter error returned. To
help pinpoint the source of the error, some details will be displayed on the screen e.g. “Line too long”. Each command
delimited with a
nul
is treated as a line for error reporting
The following commands are used to control the running of the script:
Execute Script (<ES>) starts the script running from the first line.
Terminate Script (<TS>) stops the script operation but leaves the script present.
Kill Script (<KS>) removes the script from the unit.
Operation with BEKA protocol
Scripts are supported in when the display is in Text Display mode. It should be noted that the unit must be in Operation
Mode 2 and above for scripts to operate (OP Mode 1 would simply display the contents of the script).
When a script is present in the unit a script control menu will appear in the configuration menus accessed by pressing
the P+E buttons. This allows the script to be Started, Stopped and Erased by the user.
While the script is running it will reply S0 or B0 to all BEKA commands sent to it apart from a few special ones. These
are Terminate Script <TS>, Cyclic Data <CD>, Jump Register <JRn>, Set Event <SEn>, Screen Option <SOn>.
(The B0 indicates that the Script is busy - see the <*BB>, <*BR> & <*LB> commands later.)
To aid program development, we offer a Programming Utility free of charge. The “download” option in this utility
deals with the formatting automatically.