Xytronix Research & Design ControlByWeb X317 User Manual page 60

Web-enabled analog output module
Table of Contents

Advertisement

Appendix D: BASIC Scripts
the Analog Outputs tab have been set for a 1 to 1 output relationship (no scaling). This allows the
BASIC calculations and output settings to be in engineering units.
For example:
Let ana1 = 0
Let ana2 = 2.5
Let ana3 = 10
Let ana4 = -2.5
Let ana5 = 20
External Variables
There are five external variables, extvar0 through extvar4. External variables are similar to general
purpose variables and can be used in the same manner. The difference between general purpose
variables and external variables is that external variables can be accessed by the user through a web
browser and modified while the script is running. Scripts can use external variables as a method of
retrieving user input. The following example demonstrates this by creating a script that will turn Relay 1
ON if extvar1 equals 1 and turn Relay 1 OFF if extvar1 equals 0.
Example:
Do
If extvar1 = 1 Then
Let relay1 = 1
Else
Let relay1 = 0
End If
Loop
End
Extvar1 can be set and cleared by entering the following requests into a web browser:
http://192.168.1.2/state.xml?extvar1=1
http://192.168.1.2/state.xml?extvar1=0
Testing and Debugging
A copy of the BASIC interpreter for Windows is also available on our website for the use of testing and
debugging. The X-317 will only acknowledge errors as it runs. This means that if a path of the script is
not encountered, errors may still exist. The Windows version of the interpreter, however, will check for
errors before the script is run.
The PRINT function is available for use with the Windows version of the BASIC interpreter. The
interpreter on the device, however, will not recognize this command.
Note: The script will be restarted by submitting any of the setup pages or by power cycling the unit.
Page 60
'set analog output 1 to 0.0V
'set analog output 2 to +2.5V
'set analog output 3 to +10V
'set analog output 4 to -2.5V
'set analog output 5 to 20.0mA
X-317™ Users Manual
Xytronix Research & Design, Inc.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ControlByWeb X317 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents