User guide

eWON 500-2001-4001-4002 User Guide - Programming the eWON
eWON 500®2001®4001®4002® Version 4_3_0 - User Guide - 10/5/05 - ©ACT'L sa - Page 122
9 Programming the eWON
9.1 BASIC language definition
9.1.1 Introduction
The program of the eWON is based on syntax close to the BASIC, with many specific extensions.
9.1.2 Program flow
IMPORTANT:
• It is very important to understand how the eWON executes its program.
• You should understand the difference between how the eWON stores the program and how it is executed.
• The eWON has a program task that extracts BASIC requests from a queue and executes the requests.
A request can be:
• A single command, example: MyVar=1
• A branch to a label, example: goto MyLabel
• A list of commands (program block)
In the first case, the command is executed then the BASIC task is ready again for the next request.
In the second case, the BASIC task goes to label MyLabel and the program executes until the END command is encountered
or until an error occurs.
Suppose the eWON has no program, and you create:
An INIT SECTION with:
A CYCLIC SECTION with:
Then create a new section:
MY NEW SECTION with:
CLS
MyVar=0
FOR V%=0 TO 10
MyVar = MyVar+1
NEXT V%
PRINT MyVar
MyNewSection:
MyVar=0
pRINT "MyVar is Reset"