beautypg.com

Frac (number), Gateway, Frequencyx – Xylem System 5000 BASIC Manual User Manual

Page 27: Getdb

background image

25

Basic Commands and Functions

Returns the fractional part of the given number.

var = 26.245 REM stores 0.245 in var

FRAC (number)

Used in conjunction with the SETNETWORK command, GATEWAY sets the given parameter as the

Gateway address to use for the network. A specified gateway should be given after the IP MANUAL

and NETMASK commands have been issued.

SETNETWORK GATEWAY, “192.168.0.1”

GATEWAY

Begins a for loop encompassed by FOR and NEXT with an optional STEP parameter (default STEP

is 1, negative STEPs may be used).

FOR x = 1 TO 5

PRINT x * x, “ “;

REM prints “1 3 9 16 25 “

NEXT x

FOR a = 10 TO 1 STEP -2

PRINT “ “, a; REM prints “ 10 8 6 4 2”

NEXT a

FOR

Used in conjunction with the GETVALUE command, FREQUENCYX requests a new frequency

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

slot$ = “SLOT1”

GETVALUE FREQUENCY1, var

REM stores a new frequency measurement of

REM digital port 1 from the daughterboard in

REM

the

var

variable

GETVALUE FREQUENCY2 slot$, s$ REM stores a new frequency measurement of

REM digital port 2 from Slot 1 in the

REM

s$

string

variable

FREQUENCYX

Used to retrieve a system database value. The response is stored in the last variable provided.

Available parameters are ERRORSTR, SITEID, SCANRATE with a given Task, and TASKNAME.

ERRORSTR returns the Default Error String (default is -99.99). SITEID returns the System 5000™’s

Site ID, SCANRTE returns the Scan Rate of the given Task as a measurement of seconds, and

TASKNAME returns the calling Task’s name (if the program is run as an Input or Output) or the

Default Error String (if not run as a Task I/O).

GETDB