System H-5000™ BASIC PROGRAMMING MANUALV1.4.4D32 0414
8BASIC FEATURES & FUNDAMENTALSBasic 5000 provides a number of commands that allow for string manipulation and processing.Functions that return str
9Basic Features and FundamentalsIn order to provide greater flexibility and reusability of Basic Programs on the System 5000™ ,an advanced subset of co
10The ‘GROUP: Symbol specifies where the Basic Program will appear in the Input/Output menus.If not specified or listed without a name, the program will
11BASIC COMMANDS & FUNCTIONS02 /
12BASIC COMMANDS & FUNCTIONSBasic 5000 uses a combination of commands and functions to allow more complex operations tobe performed on the System
13Basic Commands and FunctionsReturns the absolute value of the given number. var = ABS(-2.5) REM stores 2.5 in the var variable var2 = ABS(100)
14A parameter to the DATETIME function returning a string representation of the most recenttriggered alarm time, formatted as “HH:MM:SS”. var$ = DATE
15Basic Commands and FunctionsMulti-dimensional array: ARRAY myArray$(3,7) REM 2-dimensional string array (3 rows, 7 columns) FOR i = 1 TO 3 FO
Causes an immediate exit from a loop or SWITCH statement. a = 0 WHILE (a < 10) a = a + 1 IF (a > 5) BREAK REM the while loop exits onc
17Basic Commands and FunctionsReturns the result (return value) of the most recent PRINT to either a serial or ethernetconnection. If an error has occ
DIFFXX...DIGITALX...
18Used 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 PRIN
19Basic Commands and FunctionsA parameter to the DATETIME function returning the current day as a number, formatted as DD. var = DATETIME(DAY) REM
Causes the program to pause execution for the specified number of seconds. A decimal numbermay be used to specify more specific and smaller time increme
21Basic Commands and FunctionsBegins an infinite loop encompassed by DO and LOOP. A BREAK or GOTO statement may beused to leave the loop. DO REM
Immediately ends the Basic program. Optional if used as the last statement. var = 12 IF (var > 10) THEN var = 5 END ENDIF var = 10 R
23Basic Commands and FunctionsA parameter to the DATETIME function returning the number of seconds elapsed fromJan 1, 1970 00:00:00 until today’s date
24 GETPOWER ETHERNET, var REM stores a 1 if On, 0 if Off for the Ethernet REM port on the daughterboard in the var variable SETPOWER E
25Basic Commands and FunctionsReturns the fractional part of the given number. var = 26.245 REM stores 0.245 in varFRAC (number)Used in conjunction w
GETDB ERRORSTR, var$ REM stores the Default Error String in var$ GETDB SITEID, var$ REM stores the System 5000 Site ID in var$ task$ = “my
27Basic Commands and FunctionsReturns the provided Task’s most recent measured value. If an unknown Task is specied, the System 5000™ Default Error S
DIFFXX...DIGITALX...
28 slot$ = “SLOT2” GETVALUE DIFF34, var REM stores a new quadrature counter measurement of REM ports 3-4 from the daughterboard in the va
29Basic Commands and FunctionsJumps to the specified label or line number within the program. Unlike GOSUB, GOTO statements never return back to the po
30Used to take actions based on the evaluation of given conditional statements. True is determinedas anything non-zero; false is zero.The short form o
31Basic Commands and FunctionsReturns the integer part of the given number. var = INT(26.245) REM stores 26INT (number)Returns the position, starting
Returns a string, starting from the left side, containing the given number of characters from the given string. var$ = “Hello World” new_var$ = LEFT
33Basic Commands and FunctionsUsed within a subroutine, LOCAL marks the given variable as valid only within that subroutine. SUB change_var() LO
Returns a smaller section (substring) of a given string. The first parameter is the given string, the second is the starting point from the left side,
35Basic Commands and FunctionsDeclares the end of a FOR loop. The initial FOR variable may be optionally specified. FOR a = 1 TO 10 STEP 2 PRINT
36Opens a file, serial (COM) port, network (Ethernet) port, or connects to a listening serial ornetwork port.Files may be opened for either READING, WR
37Basic Commands and Functions FileExists = 1 FileName$ = “LogFile.csv” IF (NOT OPEN(#1, FileName$)) THEN FileExists = 0 ELSE CLOSE #1
BASIC FEATURES & FUNDAMENTALS01 /2
38A logical operator used between two expressions in conditional statements (e.g. if, while, etc). Returns TRUE if either the left, right, or both exp
39Basic Commands and FunctionsBegins a comment extending to the end of the line. An apostrophe (“ ‘ ”) may alternatively beused. REM does not need a s
40Begins a conditional loop encompassed by REPEAT and UNTIL. The condition is given after the UNTIL statement and while evaluated as TRUE, will contin
41Basic Commands and FunctionsReturns the given string with all whitespace removed from only the right side. PRINT RTRIM$(“ Hello World “) RE
42Sets the requested database value to the given number or string. Available parameters are SITEID and SCANRATE with a mentioned Task and number value
Basic Commands and Functions43Sets the provided Task’s most recent timestamp to the given number or string. If an unknown Task is specified, no value w
44BASIC COMMANDS & FUNCTIONSUsed in conjunction with the GETDB command, SITEID requests the System 5000™’s Site IDas specified in the System Settin
Basic Commands and FunctionsThe array will be automatically sized (larger or smaller) based on the number of strings that areproduced by the split. Th
46BASIC COMMANDS & FUNCTIONSDeclares a user-defined subroutine. Subroutines can specify and accept multiple arguments andcan return a number or str
Basic Commands and Functionsnumbers less than or equal to zero will turn the Switched +12 Volt Off. GETPOWER SW12V, var REM stores a 1 if On, 0 if
Basic Features and FundamentalsThe System 5000™ Data Collection Platform contains a built-in BASIC interpreter (as offirmware version 1.2.0) allowing f
48BASIC COMMANDS & FUNCTIONSReturns the current read position of the given file number. Presuming SiteID.csv contains: Digital2,AC-In 1,256.25 OPE
Basic Commands and Functions49A parameter to the DATETIME function returning a string representation of the current time, formatted as “HH:MM:SS”. va
50BASIC COMMANDS & FUNCTIONSMarks the end of a conditional loop encompassed by REPEAT and UNTIL. The condition is given after the UNTIL statement
A parameter to the DATETIME function returning a two-digit number representation of the current year, formatted as YY. var = DATETIME(YEAR) REM sto
1) The tissue in plants that brings water upward from the roots;2) a leading global water technology company.We’re 12,000 people unied in a common pu
Basic Programs on the System 5000™ can be used as either Inputs or Outputs and operate in thesame manner, being executed according to their associated
Basic Features and Fundamentals5The REM statement (meaning remark) or apostrophe (“ ‘ ”) introduce a comment that extends tothe end of the line. Notic
BASIC FEATURES & FUNDAMENTALSBasic 5000 supports traditional control statements such as GOTO and GOSUB as well as singleand multi-line IF-THEN sta
Basic Features and Fundamentals7Files stored on the System 5000™’s local le system can be accessed for reading, writing, andappending of data. The OP
Commentaires sur ces manuels