X-317™ Users Manual
Appendix D: BASIC Scripts
sensitive. The SUB and END SUB statements always must follow the END statement. The format is:
END
'*** Subroutines Go Here ***
SUB (name of subroutine)
(contents of subroutine)
END SUB
SUB (name of subroutine)
(contents of subroutine)
END SUB
REM or '
The REM or apostrophe (') statement designates remarks made by the programmer. The interpreter will
disregard any characters on the line following these statements.
The PRINT statement relays a variable or message to the display. The PRINT statement is only
available for the PC version of the BASIC interpreter. The device will not recognize the command since it
does not have an operator display. The format is:
PRINT (variable)
'relay variable value to screen
PRINT "(message)" 'relay '(message)' to screen
User-Defined Variables
Two types of variables are available for use in the ControlByWeb™ BASIC interpreter, user-defined
variables, and predefined variables.
Up to 10 user-defined variables are allowed to be used in scripts. Variables are represented by single,
lower-case characters ranging from the letter 'a' to the letter 'j'. They are always global and stored
internally as floating point numbers. Variables are defined using the LET statement.
Examples:
Let b = 5
'variable b will be set to 5
Let d = b + 2
'variable d will be set to 7
Predefined Variables
The following are useful predefined variables for the ControlByWeb™ BASIC interpreter. These are
useful for accessing internal values and features states.
Timer Variables
Six timers are available for use in BASIC scripts. They are designated as t0 through t5. Timers can be
set to any positive integer (or 0) by using the LET statement. As soon as a value is assigned to a timer, it
will begin to count down immediately by decrementing one count every 100ms until it reaches zero.
Examples:
Let t3 = 1500
'set timer 3 to 150 seconds
Let t1 = 0
'disable time 1
Analog Output Variables
The analog outputs can be set in BASIC scripts. The LET statement is used to set the analog output.
Note: the output value is subsequently processed by the Y=mX+b equation to generate the actual output
of the digital to analog converter. In the example below the
User Input Max
and
User Input Min
fields of
Xytronix Research & Design, Inc.
Page 59
Содержание ControlByWeb X317
Страница 1: ......