124
Script Errors
Errors encountered when running a script are displayed on the screen indicating the line number that the error occurred.
Any error also stops the script engine from executing any further commands. If necessary, the host can read the error
message with the
<GE>
command and the error line with the
<GL>
command.
Script Timeout (Firmware 3.4 Onwards)
The
<TO
n
>
command can be used in standard applications to show that the host has stopped sending data to the text
display. A new script command
*ST
n,label
has been added to perform this function within a running script.
As an example, the following script displays the value of input IN_1 on the screen while the host is sending data. 5
Seconds after the host stops sending data, the message 'Comms Lost, Press E to Clear' will appear at the bottom of the
screen.
Once the HOST has started sending data again, Pressing E will clear the message and re-enable the timer.
*BB
Become Busy
*EE0,6,cmsg
Set a Keyboard event to go to 'cmsg' when key 6 is pressed
*ST5,tout
Set a Script Time out to go to 'tout' if no communications for 5
seconds or more
SD
Set Display to a known format
NS
Clear all Mapped Variables
CM0,1
WTScript Timeout Test
Display a Message
F2
Set Font 2
CM3,30
DV1,5,2,1,1
Display Mapped Variable IN_1
*BI
Become Idle
*LBtout
Define Timeout Event
F2
Font 2
CM6,0
Move Cursor to line 6
CA
Set Centre Align
WM3
Set Inverse Text
WTComms Lost
Display Message
WM0
Clear Inverse Attribute
F1
Set Font 1
CM7,0
Move to Line 7
WTPress E to Clear>
Display Message
*BI
Become Idle
*LBcmsg
Clear Event
CL5
Clear Line 5
CL6
Clear Line 6
CL7
Clear Line 7
*ST5,tout
Set a Script Time out to go to 'to' if no communications for 5
seconds or more
*BI
Become Idle
Script Strings (Firmware 3.4 Onwards)
The text display can store 16 text strings of up to 8 characters in length. These can be placed anywhere on the screen
using the
*DX
n,l
command. Where
n
is the index of the string to display and
l
is the length of the field 1 to 8.
If the contents of the stored string is greater than the length parameter, then the display will only show the characters of
the string up to the length, i.e. the string will be truncated.