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 124
As you can see, the code you have entered is present, but the eWON has added some remarks and labels in order to allow edition
and to provide program flow control.
For each section in the editor, the eWON has added an END statement at the end to prevent the program from continuing to the next section.
The example also shows that any label is global to the whole program and should not be duplicated.
We can also see here that there is not correlation between the section name and the label used in that section.
The section name is only a way to organize program listing during edition in the eWON.
The section names can contain spaces while the program labels can't.
When the program starts (click RUN from the web site for example), the eWON posts 2 commands in the Queue:
The eWON BASIC task will read the request in the queue that has the lowest index and will execute it until an END is found or until an error
occurs.
The first command is "goto ewon_init_section". The following lines will be executed:
The END command on the last line will end the program and the BASIC task will check in the queue for a new request:
The first available command is "goto ewon_cyclic_section", it will also be executed until the END is found.
When this END is executed the BASIC task will detect that the section it has just executed was a CYCLIC_SECTION
and it will post a new "goto ewon_cyclic_section" request in the queue.
This is how the program is continuously executed forever while the BASIC is in RUN mode.
Queue pos Content Type
3
2 goto ewon_cyclic_section CYCLIC_SECTION
1 goto ewon_init_section INIT_SECTION
Table 85: BASIC Queue - 1
ewon_init_section:
rem --- eWON user (start)
CLS
MyVar=0
rem --- eWON user (end)
end
Queue pos Content Type
3
2
1 goto ewon_cyclic_section CYCLIC_SECTION
Table 86: BASIC Queue - 2