Quadxx rem – Xylem System 5000 BASIC Manual User Manual
Page 41

39
Basic Commands and Functions
Begins a comment extending to the end of the line. An apostrophe (“ ‘ ”) may alternatively be
used. REM does not need a statement separator if used on the same line as another statement.
REM This is a comment
‘ This is also a comment
PRINT “Hello World” REM This is a valid comment
PRINT “Hello World” ‘ This is also a valid comment
Used in conjunction with the GETVALUE command, QUADXX requests a new Quadrature counter
measurement to be made on the specified Digital ports and stores the value in the given variable.
Used in conjunction with the SETVALUE command, DIFFXX specifies the Quadrature counter on
the specified ports to be set to the desired number. The counter will be set to the integer value of
the number if a floating point value is passed in.
GETVALUE DIFF34, var
REM stores a new quadrature counter measurement of
REM ports 3-4 from the daughterboard in the var
REM
variable
GETVALUE DIFF12 “SLOT2”, s$
REM stores a new quadrature counter
REM measurement of ports 1-2 from Slot 2 in
REM the s$ string variable
SETVALUE DIFF12, 12.5
REM sets the quadrature counter on ports 1-2 on
REM the daughterboard to 12 (INT(12.5))
a = 156.0
SETVALUE DIFF34 SLOT1, a+2
REM sets the quadrature counter on ports 3-4
REM on Slot 1 to 158 (a+2)
Network communication:
PRINT “OPENING Ethernet connection”
REM prints to terminal
OPEN “192.168.0.1:20” AS #1
REM format must be host:port
PRINT #1 “Digital2,AC-In” REM newline automatically added
var = 1
var2 = 256.25
var3 = 12.565
REM following line prints “1,256.25”
PRINT #1 var, “,”, var2, “,”;
REM newline not added
PRINT #1 var3 USING “##.##”
REM prints “12.57” followed by a newline
PRINT #1 “Done”
REM newline automatically added
CLOSE #1
QUADXX
REM