beautypg.com

Basic commands & functions – Xylem System 5000 BASIC Manual User Manual

Page 20

background image

18

Used to begin the next iteration of a FOR, WHILE, REPEAT, or DO loop.

FOR var = 1 TO 10

IF (var = 5) CONTINUE

REM “5” won’t be printed

PRINT “ “, var;

REM prints “ 1 2 3 4 6 7 8 9 10”

REM Note: the semicolon removes the default new line (\n)

REM that appears at the end of a PRINT statement

NEXT var

CONTINUE

Returns the cosine value of the given number.

var = COS(0) REM stores 1 in the var variable

PRINT COS(PI) REM prints “-1”

COS (number)

Used in conjunction with the GETVALUE command, COUNTERX requests a new counter

measurement to be made on the specified digital port and stores the value in the given variable.

Used in conjunction with the SETVALUE command, COUNTERX specifies the counter on the

specified digital port 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 COUNTER3, var REM stores a new Counter measurement of digital

REM port 3 from the daughterboard in the var

REM

variable

slot$ = “SLOT1”

GETVALUE COUNTER4 slot$, s$

REM stores a new Counter measurement of

REM digital port 4 from Slot 1 in the s$

REM

string

variable

SETVALUE COUNTER2, 86 REM sets the Counter on Digital Port 2 on the

REM

daughterboard

to

86

a = 23.05

SETVALUE COUNTER1 SLOT2, a+2 REM sets the Counter on Digital Port 1 on

REM Slot 1 to 25 (INT(a+2))

COUNTERX

BASIC COMMANDS & FUNCTIONS

A parameter to the DATETIME function returning a six-digit number representation of the

current date, formatted as YYMMDD.

var = DATETIME(DATE)

REM stores 91231, inferring Dec 31, 2009

DATE