Basic Programming manual V1.0. Storm 3 D
|
|
|
- Raymond Ross
- 9 years ago
- Views:
Transcription
1 Basic Programming manual V1.0 Storm 3 D
2 CONTENTS Introduction to Basic Programming...2 Basic Features... 3 Basic Fundamentals... 4 Scheduling a Program... 4 Listening Programs... 4 Error Handling... 4 Grammar and Examples... 5 Comments... 5 Variables, Strings and Arrays... 5 Control Statements and Loops... 6 Arithmetic, Comparison and Logical Operators... 6 Math Functions... 6 Subroutines... 6 File and Serial I/O... 7 Escape Sequences and Hex Values... 7 String Processing... 7 Commands and Functions...8 ABS (number)...9 ACOS (number)...9 AND....9 ARRAY....9 ARRAYDIM (array) ARRAYSIZE (array, number) ASC (string)...10 ASIN (number)...11 ATAN (number)...11 BREAK CASE CEIL (number)...11 CHR$ (number)...12 CLEARSDI ( )...12 CLOSE CONTINUE COS (number)...13 DATETIME DEFAULT DELAY DO ELSE ELSEIF END ENDIF END SUB END WHILE EOF (filenumber) ERROR EULER EXP (number) FALSE FLOOR ( ) FLUSH FOR FRAC (number) GETVALUE VSWD VREF ANALOGX COUNTERX DIGITALX... SDIXN or SDIXNN... SENSOR... SENSORRAW SENSORFUNCTION SYSBATT SYSTEMP GOSUB GOTO H377C (number) H377F (number)) HEX$(number) IF INPUT INSTR (string, string, number) INT (number) LABEL LEFT$ (string, number) LEN (string) LINE INPUT LN (number) LOCAL LOG (number) LOOP LOWER$ (string) LTRIM$ (string) MAX (number, number) MID$ (string, number, number)... 26
3 Contents MIN (number, number)... MOD (number, number)... NEXT... NOT... ON number GOSUB labels... ON number GOTO... OPEN... OR... PI... PRINT... REM REPEAT... RETURN... RIGHT$ (string, number)... RINSTR (string, string, number)... RND (number) RTRIM$ (string) SEEK SETPORT SETVALUE VSWD VREF COUNTERX DIGITALX SENSORFUNCTION SGN (number) SIN ( ) SLEEP SPLIT (string, array, string) SQR (number) SQRT (number) STEP STR$ (number, string) SUB SWITCH TAN (number) TELL (filenumber) THEN TO TOKEN (string, array, string) TRIM$ (string) TRUE UNTIL UPPER$ (string) USING VAL (string) WEND WHILE XOR (number, number) Example Programs AutoPrint.bas CompassCorrection.bas SensorAvg.bas SensorMax.bas Listener.bas VR2C.bas
4 01 / BASIC PROGRAMMING 2
5 Basic Programming Each Storm data logger contains a built-in BASIC interpreter (as of firmware version 1.4.2) allowing for more complex procedures and more specific control over operations performed by the data logger. Many traditional BASIC commands and features have been combined with an added subset of Storm-specific operations to create the Basic programming language available on the Storm. Programs can be easily created, edited, and debugged directly on the Storm, enabling quick and verified programs to enhance the Storm experience. This manual will cover all of the major Basic commands and provide examples on how they are used. Basic Features User-defined number and string variables, including single and multi-dimensional arrays support Built-in string and number processing functions (for both received and user-created variables) Easy access to RS-232 COM/RS-485 serial ports using simple PRINT and INPUT commands Easy access to log and data files using simple PRINT and INPUT commands User-created subroutine support Support for traditional BASIC constructs such as goto, gosub, and line numbers Structured programming commands including SWITCH-CASE statements, single and multi-line IF-THEN statements, FOR, WHILE, REPEAT, and DO loops Ability to perform raw measurements of data logger Inputs (e.g. Analog, Digital, SDI-12, etc) Ability to retrieve current and previously measured values of any Sensor Access to system variables such as date and time Ability to perform complex math operations using built in trigonometric and logarithmic functions Ability to use a Basic program s returned values within Outputs (Log File, GOES, etc) Ability to run a program in response to incoming RS-232 serial communication No limit to the number of variables created or used within a program No file size limit on Basic programs No limit to the number of Basic programs installed and/or used on the system Easy to install on or retrieve programs from the data logger Programs are saved as part of the configuration file Simple program troubleshooting via the User Interface debug option Ability to create and/or edit a Basic program directly on the User Interface Basic programs can be easily run on a scheduled basis or from a digital or serial event 3
6 BASIC PROGRAMMING Basic Fundamentals Understanding the available functions and commands as well as the overall operations and flow of Basic is essential to its use within the Storm. Primary Basic concepts and examples are provided below, followed by a listing of all available commands and functions. Each command is given a description and an example of its use. Additional examples are included at the end of this manual. Before a Basic program can be used, it must first be installed on the Storm. This is done through the Sensors > Basic Programming screen. Basic programs should have a.bas extension to identify them as Basic programs. There is no limit to the number of programs that can be installed or used on the Storm Scheduling a Program Basic programs on the Storm can be set up to run on a timed schedule. A Basic program is set up similar to any other sensor through the Sensor > Add New Sensor screen. Selecting Basic Program from the available list will create the structure necessary to schedule a Basic program. When a program is selected, the program s internal variables are displayed as selectable items. Each variable s value can be captured and used after a program has run. These values can be used with one or more outputs, such as logging to a file, sending to GOES, or sending to Storm Central. Basic programs are evaluated according to their ordering within the sensor list, set by each sensor s Scan Order. Basic programs should be placed last in the Scan Order if the programs use values from other sensors measuring at the same scan time, in order to retrieve the latest measurement values. Listening Programs Basic programs can also be used to respond to listen and respond to communication on the RS-232 Com port. Programs can be used to respond to specific commands, make measurements, send data, etc. Using a listening program, data loggers or other serial devices (e.g. a PC or server) can communicate and send data back and forth. Listening programs are assigned under the Outputs > Communication Ports Setup screen in the Storm. Examples of listening programs can be found under the OPEN command. Error Handling Basic programs are parsed before execution and validatedthroughout. If any syntax errors are found in the code, the Basic program will abort and the Storm will continue its operations. To assist with troubleshooting, the Sensors >Basic Programmingscreen contains a Debug section that allows line by line execution of an installed Basic program with detailed reporting of variables information and other related output. Any errors that are reported should be resolved before implementing the program into the Storm s schedule. 4
7 Basic Programming Grammar and Examples Basic programming examples provided throughout the manual will follow a specific format. All Basiccommands and functions will be capitalized while all variables and strings may contain both uppercase and lowercase lettering. Though this format is used, the Basicinterpreter is not casesensitive with respect to commands and functions. Variables, however, are case-sensitive. In other words, the following PRINT, Print, and print commands are all interpreted as valid PRINT commands, whereas variables var and Var are interpreted as two different variables. Code examples given in the manual will appear similar to the following: PRINT Hello World var = Comments The REM statement (meaning remark) or single quote ( ) can be used to introduce a comment that extends to the end of the line. Comments can exist anywhere and span a single line. Once a comment has been started, the remainder of the line will also be considered a comment. Comments are not necessary in a program (they are ignored by the interpreter), though can provide helpful clarification when trying to understand. The following examples all represent valid uses of comments: REM This is a comment This is also a comment PRINT Hello World REM This is a valid comment after a command PRINT Hello World This is also a valid comment after a command Variables, Strings and Arrays Unlike the case-insensitive nature of Basic statements, variables and strings are uniquely identified by their names. Thus a variable named var is understood to be different than a similarly named variable Var. Standard variables represent a number. var = 15.2 REM sets var to 15.2 Var = 0 REM sets Var 0 String variables are also available and require a trailing $. var$ = Hello World REM sets var$ to Hello World Traditional variables do not need to be declared before their first use. Number variables are initialized to zero ( 0 ) while string variables are initialized to an empty string ( ). Arrays, on the other hand, need to be created first using the ARRAY command, prior to being used. Arrays contain multiple number or string variables. Array contents are initialized to zeros or empty strings depending on their declaration type. REM create a single-dimension, two element number array ARRAY myarray(2) var$ = myarray(1),, myarray(2) REM sets var to 0 0 5
8 BASIC PROGRAMMING Control Statements and Loops Basic supports traditional control statements such as GOTO and GOSUB as well as single and multi-line IF-THEN statements and SWITCH-CASE statements. GOTO and GOSUB can jump to labels or line numbers within the code. Line numbers may be used in the Basic program, but they are not required. Loops are also allowed using FOR, WHILE, REPEAT, and DO statements. BREAK statements may be used to leave any of the previously mentioned loops while the CONTINUE command can be used to begin the next iteration of a loop Arithmetic, Comparison and Logical Operators Traditional arithmetic, comparison, and logical operators are available for use within Basic and are noted below (ordered by precedence): Arithmetic: ^ (power) - (unary minus) * / % (integer modulus) + - Math Functions Basic provides a comprehensive list of math functions including logarithmic and trigonometric functions. All trigonometric functions use radians. The following functions are available: ABS, ACOS, ASIN, ATAN, CEIL, COS, EXP, FLOOR, FRAC, H377C, H377F, INT, LN, LOG, MAX, MIN, MOD, RND, SGN, SIN, SQR, SQRT, TAN, XOR. Constants EULERand PI are also available for use within Basic programs. Subroutines In order to ease the structure and flow of a Basic program, subroutines may be declared and used to perform various operations. The separation of these subroutines allows a more procedural approach to be taken within the code as well as simplify the reuse of segments of code in later programs. These subroutines can accept multiple parameters, numbers or strings, and can likewise return a number or a string, if desired. Subroutines are declared with the SUB command, ended with the END SUB command, and return values using the RETURN command. REM Calculate the Volume of a Rectangle height = 3 width = 4 depth = 5 Comparison: = == <><= >= <>!= volume = calc_volume(height, width, depth) REM sets volume to 60 Logical: NOT AND OR 6 SUB calc_volume(h, w, d) vol = h * w * d RETURN vol END SUB
9 Basic Programming File and Serial I/O Files stored on the Storm s local file system can be accessed for reading, writing, and appending of data. The OPEN command allows files to be opened and assigned a number for use throughout the program. Using the INPUT and PRINT commands with the file s assigned number allows Basic to read and write to the opened file. Other commands such as EOF, LINE INPUT, SEEK, and TELL allow for further traversal and manipulation of data files. The Storm s RS-232 Comand RS-485 ports can be opened, closed, read from, and written to with OPEN, CLOSE, INPUT, and PRINT commands as well. More information and examples relating to both file and serial I/O can be found under each of the respective commands. Escape Sequences and Hex Values Special escape sequences are available for use within Basic. Non-printable characters such as a tab or newline can be created by a using a backslash ( \ ) followed by a single letter or hex value sequence as detailed below. Additional printable and nonprintable characters from the ASCII chart can be accessed by specifying a hexadecimal value, using the escape sequence \xxx, where XX is the hexadecimal value for the desired symbol in the ASCII chart. For example, from the table above, the carriage return character (\r) would be represented by the hexadecimal escape sequence \x0d. String Processing Escape ASCII Value Hex Value Description Sequences \b 8 08 backspace \t 9 09 horizontal tab \n 10 0A newline \v 11 0B vertical tab \f 12 0C form feed \r 13 0D carriage return \ double quote \ single quote \\ 92 5C backslash \xxx N/A N/A hex value Basic provides a number of commands that allow for string manipulation and processing. Functions that return string variables contain a trailing $ whereas functions returning number variables do not have a $. Functions such as LEFT$, MID$, and RIGHT$ can be used for extracting parts of a string. Separating a string into usable sections can be done with TOKEN and SPLIT. Converting strings to numbers and numbers to strings can be quickly accomplished with the STR$ and VAL functions. The + operator may also be used to concatenate strings. There are many other string functions available including ASC, CHR$, HEX$, INSTR, LEN, LOWER$, MID$, UPPER$ that may be used to manipulate strings and their contents. 7
10 02 / COMMANDS AND FUNCTIONS 8
11 Commands and Functions The Storm s implementation of Basic uses both commands and functions to perform actions and return values, though each is syntactically different. Commands such as INPUT and GETVALUE return values to the variable specified at the end of line (following a comma): REM the following command stores the value of Analog 1 in variable a1 GETVALUEANALOG1, a1 Functions, on the other hand, specify the variable first, followed by the equal operator ( = ) to assign the calculated value: REM the following function stores the result in variable dt dt = DATETIME(TIME) Commands and Functions available to the Basic language are listed alphabetically below. ABS (number) Returns the absolute value of the given number. var = ABS(-2.5) REM sets var to 2.5 var = ABS(100) REM sets var to 100 ACOS (number) Returns the arc-cosine value of the given number. AND var = ACOS(0) REM sets var to (PI/2) var = ACOS(0.5) REM sets var to (PI/3) A logical operator used between two expressions in a conditional statement (e.g. IF, WHILE, etc.). Returns TRUE if the left and right expressions are TRUE, otherwise FALSE is returned. ARRAY var = 75 IF (var > 0 AND var < 50) var = 0REM does not set var (FALSE) IF (var >50 AND var < 150) var = 100 REMsets var to 100 (TRUE) Declares and creates an array. Arrays may be single or multi-dimensional and filled with numbers or strings. Number arrays, when created, are filled with zeros, while string arrays are filled with empty strings ( ). To enlarge an array s size (not its dimension), re-declare the array with a larger size. Existing data will be preserved. Re-declaring an array with a smaller size does nothing. ARRAYDIM and ARRAYSIZE can be used to determine the number of dimensions of an array as well as the sizes of those respective dimensions. 9
12 COMMANDS AND FUNCTIONS Single-dimensional array: ARRAY myarray(5) FOR i = 1 TO 5 myarray(i) = i * 2 REM Duplicate the number s value inside the array NEXT i REM myarray(i) now contains values Multi-dimensional array: ARRAY myarray$(3,7) REM 2-dimensional string array (3 rows, 7 columns) FOR i = 1 TO 3 FOR j = 1 TO 7 myarray$(i,j) = str$(i * j) REM str$ converts a number to a string NEXT j NEXT i REM myarray$(i,j) now contains values ARRAYDIM (array) Returns the given array s number of dimensions. ARRAY arr(10) var = ARRAYDIM(arr()) REM sets var to 1 as arr is one-dimensional ARRAY myarr(2,4,4) var = ARRAYDIM(myArr()) REM sets var to 3 as myarr is three-dimensional ARRAYSIZE (array, number) Returns the given array s dimension s size, where array specifies the array and number specifies the dimension. The last parameter is optional and defaults to the first dimension if not specified. ARRAY myarray(10) var = ARRAYSIZE(myArray()) REM sets var to10 ARRAY myarr$(2,4) var = ARRAYSIZE(myArr$(), 2) REM sets var to4 ASC (string) Returns the first character s ASCII numerical representation. CHR$( ), converting a numerical value to the ASCII character, is the opposite function of ASC( ). 10 var = ASC( A ) REM sets var to 65 var$ = CHR$(65) REM sets var$ toa
13 ASIN (number) Returns the arc-sine value of the given number. var = ASIN(0) REM sets var to0 var = ASIN(1) REM sets var to (PI/2) ATAN (number) Returns the arc-tangent value of the given number. BREAK var = ATAN(0) REM sets var to 0 var = ATAN(1) REM sets var to (PI/4) Causes an immediate exit from a loop or SWITCH statement. CASE a = 0 WHILE (a < 10) a = a + 1 IF (a > 5) BREAK REM the while loop exits once a > 5 WEND REM variable a is now 6 Used with the SWITCH statement to list potential routes. a$ = Hi SWITCH a$ CASE Hello : response$ = And Hello to you BREAK CASE Hi : response$ = Hi! REM this case matches and is used BREAK END SWITCH REM response$ is now Hi! CEIL (number) Returns the ceiling or smallest integer not less than the given number. var = CEIL(1.2) REM sets var to 2 var = CEIL(4.7) REM sets var to5 11
14 COMMANDS AND FUNCTIONS CHR$ (number) Returns the number s ASCII character representation. ASC( ), converting a character to its ASCII numerical value, is the opposite function of CHR$( ). var$ = CHR$(65) REM sets var to A var = ASC( A ) REM sets var to 65 CLEARSDI ( ) Clears the SDI-12 cache. Prior to a Basic program running, the SDI-12 cache is empty. All Basic programs share the same SDI-12 cache. When an SDI-12 value is retrieved, a cache of the query and response is recorded. When a subsequent request is made, if the cache has the information available, the stored data is returned. To retrieve new measurements each scan, the cache should be cleared prior to retrieving fresh SDI-12 readings. CLEARSDI() REM Clear any cached SDI values GETVALUE SDI01, a1$ REM request a new measurement (address 0, param 1) GETVALUE SDI02, a2$ REM retrieve the second parameter (from the cache) CLEARSDI() REM Force our next request to be a new measurement GETVALUE SDI01, b1$ REM request a new measurement (address 0, param 1) CLOSE Closes a file or serial port that has been previously opened with the OPEN command. OPEN RS-232 COM AS #9 CLOSE #9 OPEN RS-485 AS #6 CLOSE #6 CONTINUE Used to begin the next iteration of a FOR, WHILE, REPEAT, or DO loop, skipping over the remainder of the loop. sum = 0 FOR var = 1 TO 5 IF (var = 3) CONTINUE REM when var = 3, skip the next statement sum = sum + var REM sets sum to 12 ( ) NEXT var 12
15 Commands and Functions COS (number) Returns the cosine value of the given number. DATETIME var = COS(0) REM sets var to 1 var = COS(PI) REM sets var to -1 Used to retrieve parts of the current date and time. Available arguments are DATE, DATE$, TIME, TIME$, DAY, JDAY, MONTH, YEAR, SECONDS, MINUTES, HOURS, EPOCH, EPOCHDAY. DATE and TIME return integer values of the current date and time formatted as YYMMDD and HHMMSS respectively. The DATE$ and TIME$ arguments return a similar format as string values, specifically MM/DD/YYYY according to the Storm s Date Format setting and HH:MM:SS respectively. SECONDS, MINUTES, HOURS, DAY, MONTH, and YEAR each return a two-digit integer value of the specified current date or time subsection. JDAY returns a three-digit integer value of the Julian Day. EPOCH returns an integer value of the number of seconds since 00:00:00 Jan 1, 1970 while EPOCHDAY returns the number of seconds from 00:00:00 Jan 1, 1970 until the start of today s date at 00:00:00. DEFAULT REM Presuming today s date and time are Sept 3, 2013 at 08:30:58 var = DATETIME(DATE) var$ = DATETIME(TIME$) var = DATETIME(TIME) var$ = DATETIME(TIME$) var = DATETIME(DAY) var = DATETIME(JDAY) var = DATETIME(MONTH) var = DATETIME(YEAR) var = DATETIME(SECONDS) var = DATETIME(MINUTES) var = DATETIME(HOURS) var = DATETIME(EPOCH) var = DATETIME(EPOCHDAY) REM sets var to REM sets var$ to 09/03/2013 REM sets var to REM sets var$ to 08:30:58 REM sets var to 3 REM sets var to 246 REM sets var to 9 REM sets var to 13 REM sets var to 58 REM sets var to 30 REM sets var to 8 REM sets var to REM sets var to Used within a SWITCH-CASE statement to mark the default route if no other CASE statements are matched. var = DATETIME(MINUTES) path = 0 SWITCH var CASE 0: path = 1 BREAK 13
16 COMMANDS AND FUNCTIONS DELAY CASE 15: path = 2 BREAK CASE 30: path = 3 BREAK CASE 45: path = 4 BREAK DEFAULT: path = -1 BREAK END SWITCH Causes the program to pause execution for the specified number of seconds. A decimal number may be used to specify more specific and smaller time increments (e.g. milliseconds). SLEEP and DELAY are identical commands. SLEEP 2.5 DELAY 0.25 REM pauses the program for 2.5 seconds REM pauses the program for 0.25 seconds DO Begins an infinite loop encompassed by DO and LOOP. A BREAK or GOTO statement should be used to leave the loop. DO REM Break out of the loop when our seconds are greater than 30 x = DATETIME(SECONDS) IF (x > 30) BREAK LOOP ELSE Optionally used as part of an IF statement to indicate a default branch if no other conditions are evaluated as TRUE. 14 var = DATETIME(MINUTES) sync = 0 IF (var == 0) THEN sync = 1 ELSE sync = -1 ENDIF
17 Commands and Functions ELSEIF Optionally used as part of an IF statement to indicate another condition to evaluate. The option is evaluated if all previous options have resulted in FALSE. Multiple ELSEIF conditions may be tested If the condition evaluates to TRUE, all following conditions will not be tested. END var = DATETIME(MINUTES) sync = 0 IF (var == 0) THEN sync = 1 ELSEIF (var == 15) THEN sync = 2 ELSEIF (var == 30) THEN sync = 3 ELSEIF (var == 45) THEN sync = 4 ELSE sync = -1 ENDIF Immediately ends the Basic program. Optional if used as the last statement. ENDIF var = DATETIME(MINUTES) IF (var == 0) THEN REM if top of the hour, end the program Declares the end of a multi-line IF-THEN statement. Not required on single-line if statements. var = DATETIME(MINUTES) sync = 0 IF (var == 0) THEN sync = 1 ELSEIF (var == 30) THEN sync = 2 ELSE sync = -1 ENDIF 15
18 COMMANDS AND FUNCTIONS END SUB Declares the end of a subroutine (begun with the SUB statement). volume = calc_volume(3, 4, 5) REM sets volume to 60 SUB calc_volume(h, w, d) vol = h * w * d RETURN vol END SUB END WHILE Marks the end of a conditional WHILE-WEND loop. END WHILE may also be used instead of WEND. x = 0 WHILE (x < 30) REM Break out of the loop when our seconds are greater than 30 x = DATETIME(SECONDS) END WHILE EOF (filenumber) Returns TRUE if the given filenumber has reached the end of the file, FALSE if there is still data available to be read from the current position. ERROR OPEN SiteID.csv FOR READING AS #1 WHILE (NOT EOF(#1)) LINE INPUT #1, var$ REM reads each line of the log file WEND CLOSE #1 Ends the Basic program with a custom error message. Primarily intended for troubleshooting Basic programs. var = 12 IF (var > 10) THEN ERROR Number too large! ENDIF REM program ends here 16
19 Commands and Functions EULER A read-only constant containing the number var = EULER REM sets var to the euler constant EXP (number) Returnseuler raised to the power of the given number. Identical to EULER^number. FALSE var = EXP(0) REM sets var to 1, equivalent to EULER^0 var = EXP(1) REM sets var to , equivalent to EULER^1 var = EULER^2 REM sets var to , equivalent to EXP(2) A read-only constant containing the number 0. FLOOR FLUSH var = DATETIME(MINUTES) top_of_hour = FALSE IF (var ==0) THEN top_of_hour = TRUE ENDIF Returns the floor or largest integer not greater than the given number. var = FLOOR(1.2) REM sets var to 1 var = FLOOR(4.7) REM sets var to 4 For files, writes any remaining unwritten (buffered) data to the specified file. For serial connections, removes any extra data on the given line. Closing a file or serial connection causes an automatic flush to occur. OPEN RS-232 COM AS #2 INPUT #2, a$ REM retrieves from RS-232 COM and stores in string a$ PRINT #2 a1 FLUSH #2 INPUT #2, b$ REM retrieves from RS-232 COM and stores in string b$ CLOSE #2 val1 = 12.5 val2 = 32.6 OPEN SiteID.csv FOR WRITING AS #1 PRINT #1, Appened values: FLUSH #1 PRINT #1, val1,,, val2 CLOSE #1 17
20 COMMANDS AND FUNCTIONS FOR Begins a loop encompassed by FOR and NEXT with an optional STEP command. The default STEP is 1, meaning each iteration of the loop will increase the variable by 1. Negative STEPs may be used to count backwards. FOR x = 1 TO 3 REM retrieve the past 3 values of the Sensor named Analog GETVALUE SENSOR Analog x, var$ NEXT x FOR x = 6 TO 1 STEP -2 REM retrieve every other past value of the Sensor named Analog GETVALUE SENSOR Analog x, var$ NEXT x FRAC (number) Returns the fractional portion of the given number. GETVALUE var = FRAC(26.245) REM sets var to Used in conjunction with an identifier to request a new measurement or stored value on the Storm. Available identifiers are listed below. Astring or number variable must be specified after a comma to store the result. If an error is encountered or a value is not available, the Storm s Error Value (default is ) is returned. 12VSWD Returns the voltage reading of the switched +12 volt.see SetValue to turn on or off the +12Vswd reference. GETVALUE 12VSWD, v12$ REM sets v12$ to the voltage of +12Vswd 5VREF Returns the voltage reading of the +5V reference.see SetValue to turn on or off the +5V reference. GETVALUE 5VREF, v5$ REM sets v5$ to the voltage on +5Vref ANALOGX Returns a new measurement from the specified Analog channel.thexfollowing the identifier specifies which analog channelis measured. 18 GETVALUE ANALOG1, a1$ REM sets a1$ to the voltage on Analog channel 1 GETVALUE ANALOG2, a2$ REM sets a2$ to the voltage on Analog channel 2
21 Commands and Functions COUNTERX Returns a new counter measurement from the specified Digital port.thexfollowing the identifier specifies which digital portis measured.see SetValue to change the counter value of a specific digital port. DIGITALX GETVALUE COUNTER1, c1$ REM sets c1$ to the Digital port s count GETVALUE COUNTER2, c2$ REM sets c1$ to the Digital port s count Returns a new measurement from the specified Digital port.a 1 or 0 will be returned based on the port s level, 1 indicating the port is high (>3.5V), 0 indicating the port is low (<0.08V). TheXfollowing the identifier specifies which digital portis measured. See SetValue to change the level measurement of a specific digital port. GETVALUE DIGITAL1, d1$ GETVALUE DIGITAL2, d2$ REM sets d1$ to 1 or 0, based on port level REM sets d2$ to 1 or 0, based on port level SDIXN or SDIXNN Returns a specified parameter from a connected SDI-12 sensor. The X following the identifier specifies the SDI-12 sensor s address. The N or NN denotes the parameter to return. For example, to request the 3rd parameter from an SDI-12 sensor on address 0, the identifier SDI03 would be used. SDI-12 requests and responses are cached to allow quick retrieval of subsequent parameter requests. To force a new measurement to be made for a sensor, the CLEARSDI( ) function should be used to clear the SDI-12 cache. Prior to making SDI-12 requests in a Basic program, the CLEARSDI( ) function should probably be called to force new measurements. SENSOR CLEARSDI() GETVALUE SDI01, sdi1$ REM sets sdi1$ to parameter 1 from sensor 0 GETVALUE SDI312, sdi2$ REM sets sdi12$ to parameter 12 from sensor 3 Returns a sensor s most recent processed value. If an unknown sensor is specified, the Error String (default is ) is returned. Prior processed values can be returned by adding an additional numerical parameter. The number 1 indicates the most recent measurement, 2 the previous measurement, 3 the value processed three scans prior, etc. Values from SDI- 12 or Basic programs are retrieved by specifying the name of the sensor followed by the parameter s name surrounded by parentheses. GETVALUE SENSOR H-377, temp$ GETVALUE SENSOR H-340SDI(Rainfall), stage$ GETVALUE SENSOR H-340SDI(Rainfall) 2, previous_stage$ 19
22 COMMANDS AND FUNCTIONS SENSORRAW Returns a sensor s most recent raw/unprocessed value. A raw value is the value of a measurement prior to slope, offset, function or digits are applied to it. If an unknown sensor is specified, the Error String (default is ) is returned. Prior raw values can be returned by adding an additional numerical parameter. The number 1 indicates the most recent measurement, 2 the previous measurement, 3 the value processed three scans prior, etc. Values from SDI-12 or Basic programs are retrieved by specifying the name of the sensor followed by the parameter s name surrounded by parentheses. GETVALUE SENSORRAW H-377, temp$ GETVALUE SENSORRAW H-340SDI(Rainfall), stage$ GETVALUE SENSORRAW H-340SDI(Rainfall) 2, previous_stage$ SENSORFUNCTION Returns a sensor s function, specified by the Use Function option under the Processing section of the Storm s Sensor Setup screen. If an unknown sensor is specified, an N/A is returned. Functions from SDI-12 or Basic programs are retrieved by specifying the name of the sensor followed by the parameter s name surrounded by parentheses. See SetValue to change the function of a sensor. SYSBATT GETVALUE SENSORFUNCTION H-377, temp$ GETVALUE SENSORFUNCTION H-340SDI(Rainfall), stage$ Returns a new voltage measurement of the attached battery. GETVALUE SYSBATT, b$ REM sets b$ to the voltage of +12V SYSTEMP Returns a temperature reading of the internal temperature sensor. The value is returned in degrees Celsius. GETVALUE SYSTEMP, t$ REM sets t$ to the internal temperature 20
23 Commands and Functions GOSUB Branches to the specified LABEL or line number within the program. Once a RETURN statement is reached, execution is passed back to the statement immediately following GOSUB. Subroutines, defined with the SUB command, provide a much more flexible method of executing and running portions of code and should be used instead of GOSUB. GOTO h = 3 w = 4 d = 5 GOSUB 100 REM sets volume to 60 GOSUB ComputeArea REM sets area to 12 END LABEL ComputeArea area = h * w RETURN 100 volume = h * w * d RETURN Jumps to the specified label or line number within the program. GOTO statements never return back to the point origin and thus have no RETURN statement. Subroutines, defined with the SUB command, cannot be exited with the GOTO statement. h = 3 w = 4 d = 5 GOTO 100 REM sets volume to 60 GOSUB ComputeArea REM is never run as above GOTO jumped below END LABEL ComputeArea area = h * w RETURN 100 volume = h * w * d 21
24 COMMANDS AND FUNCTIONS H377C (number) Returns the temperature, in degrees Celsius, of the given number (expecting a 0-5V analog voltage reading) based on the math equation for the WaterLog model H-377 temperature probe. var = H377C(3.25) REM sets var to H377F (number) Returns the temperature, in degrees Fahrenheit, of the given number (expecting a 0-5V analog voltage reading) based on the math equation for the WaterLog model H-377 temperature probe. var = H377F(3.25) REM sets var to HEX$ (number) Returns the hexadecimal string representation of the given number. IF 22 var$ = HEX$(32) REM sets var$ to 20 Used to take actions based on the evaluation of given conditional statements. True is determined as anything non-zero; false is zero. The short form of the IF statement does not include a THEN and must remain on one line. Multiline IF statements contain the THEN keyword as well as ENDIF to mark the ending of the IF statement. IF statements may also contain the keywords ELSEIF to introduce alternative conditional statements as well as the ELSE keyword to provide a default path if no other conditions evaluate to true. Single-line IF statement: var = 250 IF (var > 200) var = 200 REM sets var to 200 Multi-line IF statement: var = 40 IF (var >60) THEN var = 60 ELSEIF (var >30) THEN var = 30 REM sets var to 30 ELSE var = 0 ENDIF
25 Commands and Functions INPUT Read from a file or serial port that has been previously opened with the OPEN command. An optional delimiter (stop character) may be specified for retrieving data. The default delimiter for files is a space; the end of transmission EOT (0x04) character is used for serial communication. When used with a serial port, an additional variable may be specified to set the timeout, in milliseconds, for reading from the port (default is 100ms). Note that files will not return the stop character whereas serial communication returns all characters (including the delimiter). Entire lines of files can be retrieved using the LINE INPUT command. OPEN RS-232 COM AS #3 INPUT #3 250, a$ REM timeout is set to 250ms INPUT #3, b$ REM reads again with default 100ms timeout INPUT #3, 250, c$ REM read until a comma or 250ms passes CLOSE #3 OPEN RS-485 AS #2 INPUT #2 250, a$ REM timeout is set to 250ms INPUT #2, b$ REM reads again with default 100ms timeout INPUT #2, 250, c$ REM read until a comma or 250ms passes CLOSE #2 OPEN SiteID.csv FOR READING AS #1 INPUT #1, d$ REM retrieves characters until a space is found INPUT #1 \t, e$ REM retrieves characters until a tab is found INPUT #1,, f$ REM retrieves characters until a comma is found INSTR (string, string, number) Returns the position, starting at the position given by the third optional parameter (default is 1), of the first occurrence of the second given string within the first given string beginning at the left. If the string is not found, zero is returned. RINSTR may be used to begin searching for a string from the right, rather than the left. Zero is returned if the value is not found. var = INSTR( A1,B2,C3,D4, B2 ) REM sets var to 4 var = INSTR( A1,B2,C3,D4,A1,B2, B2, 5) REM sets var to 16 INT (number) Returns the integer portion of the given number. var = INT(26.245) REM sets var to 26 23
26 COMMANDS AND FUNCTIONS LABEL Identifies a specific location by name. Commands such as GOTO and GOSUB can refer to and send execution to named LABELs. Line numbers are a special case of LABELs and do not require the LABEL prefix to be named. h = 3 w = 4 d = 5 GOSUB 100 REM sets volume to 60 GOSUB ComputeArea REM sets area to 12 END LABEL ComputeArea area = h * w RETURN 100 volume = h * w * d RETURN LEFT$ (string, number) Returns a string, starting from the left side, containing the given number of characters from the given string. var$ = A1,B2,C3,D4 ab$ = LEFT$(var$, 5)REM sets ab$ to A1,B2 LEN (string) Returns the length of the given string. LINE INPUT var = LEN( A1,B2,C3,D4 ) REM sets var to 11 Reads an entire line from an open file. OPEN SiteID.csv FOR READING AS #1 LINE INPUT #1, b$ REM retrieves the first line and stores it in b$ CLOSE #1 24
27 Commands and Functions LN (number) Returns the natural logarithm of the given number. The LOG function should be used if a common (base-10) logarithm is required. var = LN(3) REM sets var to LOCAL Used within a subroutine, LOCAL marks the given variable as valid only within that subroutine. Variables within a subroutine are accessible anywhere within the program otherwise. LOG (number) Returns the common (base-10) logarithm of the given number. The LN function should be used if a natural logarithm is required. LOOP SUB change_var() LOCAL var var = 100 END SUB var = 10 change_var() REM var is still set to 10 var = LOG(5) REM sets var to var = LOG(10) REM sets var to1 Declares the end of a DO-LOOP statement. DO REM Break out of the loop when our seconds are greater than 30 x = DATETIME(SECONDS) IF (x > 30) BREAK LOOP LOWER$ (string) Returns the given string as all lowercase. var$ = LOWER$( A1,B2,C3,D4 ) REM sets var$ to a1,b2,c3,d4 25
28 COMMANDS AND FUNCTIONS LTRIM$ (string) Returns the given string with all whitespace removed from only the left side. 26 var$ = LTRIM$( A1,B2,C3,D4 ) REM sets var$ to A1,B2,C3,D4 MAX (number, number) Returns the maximum value of the two given numbers. a = RND() REM generates a random number between 0 and 1 b = RND() REM generates a random number between 0 and 1 c = MAX(a, b) REM sets c to the largest of the two numbers MID$ (string, number, number) 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, and the third optional parameter dictates how many characters to return. If the third parameter is omitted, all remaining characters are returned. var$ = MID$( A2: 12.5, VB: , 11) REM sets var$ to VB: mystr$ = A1: 15, A2: 18, D3: 0 var$ = MID$(myStr$, 9, 6) REM sets var$ toa2: 18 MIN (number, number) Returns the minimum value of the two given numbers. a = RND() REM generates a random number between 0 and 1 b = RND() REM generates a random number between 0 and 1 c = MIN(a, b) REM sets c to the smallest of the two numbers MOD (number, number) Returns the remainder of a division between the two given numbers. MOD performs floating-point division and returns the remainder. For integer-only division, use the % operator. NEXT a = b = 10 var = MOD(a, b) REM sets var to 2.5 (the remainder of 102.5/10) var = a % b REM sets var to 2 (the remainder of 102/10) Declares the end of a FOR loop. FOR x = 1 TO 10 STEP 2 REM retrieve the every other value for the Sensor named Analog GETVALUE SENSOR Analog x, var$ NEXT x
29 Commands and Functions NOT Negates the expression immediately following. The! operator may alternatively be used. OPEN SiteID.csv FOR READING AS #1 WHILE (NOT EOF(#1)) LINE INPUT #1, var$ REM reads each line of the log file WEND CLOSE #1 ON number GOSUBlabels Branches to one of a list of labels(with an expected RETURN) based on the given number. For example, if the given number is 1, the first GOSUB listed is used, if the number is 2, the second GOSUB, etc. REM iterate through each label height = 3 width = 4 depth = 5 FOR a = 1 TO 3 ON a GOSUB calc_area,calc_volume,200 NEXT a LABEL calc_area area = height * width RETURN LABEL calc_volume volume = area * depth RETURN 200 END ON number GOTO Jumps to one of a list of labels(without an expected RETURN) based on the given number/ argument. For example, if the given number is 1, the first GOTO listed is used, if the number is 2, the second GOTO, etc. Unlike GOSUB, GOTO statements never return back to the point of the GOTO. GETVALUE SYSTEMP, temp IF (temp > 40) THEN var = 1 ELSEIF (temp > 30) THEN var = 2 ELSE var = 3 27
30 COMMANDS AND FUNCTIONS OPEN ENDIF ON var GOTO critical,moderate,okay LABEL critical SETVALUE DIGITAL1, 1 SETVALUE DIGITAL2, 1 SETVALUE DIGITAL3, 1 END LABEL moderate SETVALUE DIGITAL1, 0 SETVALUE DIGITAL2, 1 SETVALUE DIGITAL3, 1 END LABEL okay SETVALUE DIGITAL1, 0 SETVALUE DIGITAL2, 0 SETVALUE DIGITAL3, 1 END Opens a file, serial port, or connects to a listening port.all files and non-listening ports will be automatically closed when a program ends. Files may be opened with one of three modes: READING, WRITING, or APPENDING. A file opened with WRITING mode will create a new file if the file doesn t exist, or erase the contents of an existing file. To prevent overwriting of an existing file, use APPENDING for write operations of an existing file. An alternativeopen syntax may be used to determine if a file exists, as shown below in the file example. Serial ports are opened with the following defaults: baud rate = 9600, data bits = 8, parity = none, stop bits = 1, flow control = none, transmit char delay = 0, transmit line delay = 0. If other port settings are desired, they must be specified prior to opening the port using the SETPORT command, as shown below in the serial port example. Listening ports are opened with settings specified in the interface under Outputs > Communication Ports Setup. The CLOSE command has no effect on a listening port. When communication occurs on a listening port, the assigned Basic program will be initiated. To send and receive data across the port, use the OPEN command as detailed in the example below. Subsequent INPUT and PRINT commands will read and write to the open port. 28
31 Commands and Functions File: OPEN SiteID.csv FOR APPENDING AS #1 PRINT #1, A1,B2,C3,D4 CLOSE #1 REM Check if file exists, OPEN #1 FOR READING will fail if it does not FileExists = 1 FileName$ = LogFile.csv IF (NOT OPEN(#1, FileName$)) THEN FileExists = 0 ELSE CLOSE #1 OPEN FileName$ FOR READING AS #1 LINE INPUT #1, line$ CLOSE #1 ENDIF Serial Ports (RS-232 and RS-485): SETPORT 300, 8, none, 1, none, 50, 0 REM port settings OPEN RS-232 COM AS #5 REM open at 300 baud w/50ms tx char delay INPUT #5, var$ PRINT #5, 0M! ; REM sends 0M! CLOSE #5 SETPORT , 8, none, 1, none, 00, 0 REM port settings OPEN RS-485 AS #4 REM open at baud w/0ms tx line or char delay INPUT #4, var$ PRINT #5, 0M! ; REM sends 0M! CLOSE #4 Listening Port (RS-232 Com): OPEN LISTENER AS #1 REM settings specified in Storm interface PRINT #1 Please enter a number: INPUT #1 5000, num$ REM wait for 5 seconds for input PRINT #1 \r\n PRINT #1 You entered:, num$, \r\n CLOSE #1 29
32 COMMANDS AND FUNCTIONS OR A logical operator used between two expressions in conditional statements (e.g. IF, WHILE, etc.). Returns TRUE if the left, right, or both expressions are TRUE, FALSE if both are FALSE. PI var = 100 IF (var > 0 OR var < 50) var = 1 REM sets var to 1 IF (var > 0 OR var < 150) var = 1 REM sets var to 1 A read-only constant containing the number PRINT var = PI REM sets var to Writes characters to a file or serialport.an automatic carriage return and line feed (\r\n) are added to all PRINT statements used with file operations unless the statement is ended with a semicolon (;). PRINT statements used with serial operations send only the characters specified with no additional characters automatically appended. The USING statement may also be appended for added precision or to set the number of digits to print, specified with hashes #. Serial communication (RS-232 and RS-485): OPEN RS-232 COM AS #4 REM Wake up the H-3531 sensor by sending a character PRINT #4 W REM Wakes up our sensor with a W INPUT #4 6000, H3531$ REM retrieve our measurements (6 sec timeout) CLOSE #4 OPEN RS-485 AS #3 PRINT # REM Send command to our sensor INPUT #31000, var$ REM retrieve our measurements (6 sec timeout) CLOSE #3 File communication: 30 OPEN SiteID.csv FOR WRITING AS #1 PRINT #1 Digital2,AC-In REM \r\n automatically added var = 1 var2 = var3 = PRINT #1 var,,, var2,, ; REM saves 1,256.25, \r\n not added PRINT #1 var3 USING ##.## REM saves12.57 followed by \r\n PRINT #1 Done REM \r\n automatically added CLOSE #1
33 Commands and Functions REM Begins a comment extending to the end of the line. An apostrophe ( ) may alternatively be used to start a comment. REPEAT Begins a conditional loop encompassed by REPEAT and UNTIL. The condition is given after the UNTIL statement and while evaluated as TRUE, will continue to iterate through the loop. Once the UNTIL condition is evaluated as FALSE, the loop exits. RETURN REM This is a comment This is also a comment var = 1 REM This is a valid comment var = 2 This is also a valid comment REPEAT REM Break out of the loop when our seconds are greater than 30 x = DATETIME(SECONDS) UNTIL (x > 30) Returns control back to the calling line of a GOSUB call or a subroutine (SUB) call with an optional value. REM Calculate the Area of a Rectangle height = 3 width = 4 area = calc_area(height, width) REM stores 12 in area SUB calc_area(h, w) a = h * w RETURN a END SUB RIGHT$ (string, number) Returns a string, starting from the right side, containing the given number of characters from the given string. var$ = A1,B2,C3,D4 cd$ = RIGHT$(var$, 5)REM sets cd$ to C3,D4 31
34 COMMANDS AND FUNCTIONS RINSTR (string, string, number) Returns the position, starting at 1, of the first occurrence of the second given string within the first given string beginning at the right. If the string is not found, zero is returned. The third parameter is an optional number, defaulting to the last element of the string, indicating the starting position for the search. INSTR may be used to begin searching for a string from the left, rather than the right. var = RINSTR( A1,B2,C3,D4,A1,B2, B2 ) REM sets var to 16 var = RINSTR( A1,B2,C3,D4,A1,B2, B2, 5) REM sets var to 4 RND (number) Returns a random number. An optional number may be specified for the maximum range (from zero to, but not including, the given number). If no number is given, the default is 1. x = RND() REM sets x to a random number between 0 and y = RND(5) REM sets y to a random number between 0 and RTRIM$ (string) Returns the given string with all whitespace removed from only the right side. SEEK var$ = RTRIM$( A1,B2,C3,D4 ) REM sets var$ to A1,B2,C3,D4 Sets the position from which the next INPUT statement will read from within an open file. The first parameter is the open file, the second parameter tells where to set the next read position, and the third is an optional setting of either BEGINNING, CURRENT, or END. BEGINNING sets the count from the beginning of the file (and is the default if not specified), CURRENT counts from the current read position from within the file, and END counts from the end of the file. The TELL command retrieves the current read position of the given file. REM Presuming SiteID.csv contains: REM Digital1,Analog2,WindSpeed REM 56.23,2.25,126.5 OPEN SiteID.csv FOR READING AS #1 SEEK #1, LEN( Digital1 ) + 1 REM sets our position to Analog2 INPUT #1,, var$ REM sets var$ to Analog2 SEEK #1, -11, END REM sets our position to the Analog2 measurement INPUT #1,, var2$rem sets var2$ to 2.25 CLOSE #1 32
35 Commands and Functions SETPORT Sets the serial port settings for unopened communication ports. Serial ports are opened with the following defaults: baud rate = 9600, data bits = 8, parity = none, stop bits = 1, flow control = none, transmit char delay = 0, transmit line delay = 0. If other port settings are desired, they must be specified prior to opening the port. Parity can be set to None, Even, or Odd. Flow Control can be set to None, Software, Hardware, or Both. Transmit delays are specified in milliseconds. Port settings only need to be set once and will affect all future port openings. SETVALUE SETPORT 300, 8, none, 1, none, 50, 0 REM port settings OPEN COM 1 AS #5 REM open the COM at 300 baud w/50ms tx char delay CLOSE #5 Used in conjunction with an identifier to change settings on the Storm. Available identifiers are listed below. 12VSWD Turns the +12Vswd referenceon or off.a 0 will turn it off, a value greater than zero will turn it on. See GetValue to retrieve +12Vswd voltage. SETVALUE 12VSWD, 1 REM sets v12$ to the voltage of +12Vswd 5VREF Turns the +5V referenceon or off. A 0 will turn it off, a value greater than zero will turn it on. See GetValue to retrieve +5Vref voltage. DIGITALX SETVALUE 5VREF, 1 REM turns on the +5Vref SETVALUE 5VREF, 0 REM turns off the +5Vref COUNTERX Sets a digital port counter value. SETVALUE COUNTER1, 20 REM sets digital port 1 counter to 20 SETVALUE COUNTER2, 0 REM sets digital port 2 counter to 0 Sets a digital port high (5V) or low (0V).A 0 set the port low, a value greater than zero will set it high.see GetValue to retrieve digital port s status. SETVALUE DIGITAL1, 1 SETVALUE DIGITAL2, 0 REM sets digital port 1 high REM sets digital port 2 low 33
36 COMMANDS AND FUNCTIONS SENSORFUNCTION Sets a sensor s function, specified by the Use Function option under the Processing section of the Storm s Sensor Setup screen. Setting a sensor s function will automatically enable the function for use as well. If an unknown sensor is specified, an N/A is returned. Functions from SDI-12 or Basic programs are retrieved by specifying the name of the sensor followed by the parameter s name surrounded by parentheses. SGN (number) SETVALUE SENSORFUNCTION H-377, H377C(X) SETVALUE SENSORFUNCTION H-340SDI(Rainfall), 0 Returns -1, 0, or 1 indicating the sign (negative, zero, or positive respectively) of the given number. SIN ( ) var = SGN( ) REM sets var to -1 var = SGN( ) REM sets var to 1 Returns the sine value of the given number. SLEEP var = SIN(PI/2) REM sets var to 1 var = SIN(0) REM sets var to 0 Causes the program to pause execution for the specified number of seconds. A decimal number may be used to specify more specific and smaller time increments (e.g. milliseconds). SLEEP and DELAY are identical commands. SLEEP 2.5 DELAY 0.25 REM pauses the program for 2.5 seconds REM pauses the program for 0.25 seconds SPLIT (string, array, string) Splits apart a string into an array of strings. The first parameter provides the string to split apart. The second parameter provides the array which the new substrings will fill. The optional third parameter provides the delimiters or characters that determine where to split the primary string. If more than one delimiter is specified, splitting will occur at each character given. For example, if a comma and hyphen are given,-, content will be split on any commas or hyphens found as in the example below. If no delimiter is specified, whitespace will be used as the delimiter (e.g. spaces and tabs). The number of strings found is returned. 34
37 Commands and Functions Empty elements in the array are created if two delimiters are next to each other. The TOKEN function, on the other hand, does not add empty elements if two or more delimiters are in sequence. The array will be automatically sized (larger or smaller) based on the number of strings that are produced by the split. The number of strings produced will also be returned by the function. var$ = A1,B2,C3,D4,-A1,-B2 ARRAY arr$(1) array_num = SPLIT(var$, arr$(),,- ) REM split on commas, returns 8 REM array arr$ now contains [A1][B2][C3][D4][][A1][][B2] SQR (number) Returns the squared value of the given number. The caret ( ^ ) may also be used to raise a number to a power, such as 2. var = SQR(5) REM sets var to 25 var = 4^2 REM sets var to 16 SQRT (number) Returns the square root value of the given number. The caret ( ^ ) may also be used to raise a number to a power, having the same effect by using a fraction such as 1/2. STEP var = SQRT(25) REM stores 5 in the var variable var = 16^(1/2) REM sets var to 4 Specifies an optional increment in a FOR loop. Positive or negative numbers may be used. FOR a = 10 TO 1 STEP -2 var = a REM sets var to NEXT a STR$ (number, string) Returns the string equivalent of the given number. An optional second parameter string may be specified to declare the format to be used. Formats are specified using the hash character ( # ). If not enough hashes are specified, the format will be returned. See VAL( ) for converting a string to a number. var$= STR$(18.265) REM sets var$ to var$ = STR$(18.265, #.##### ) REM sets var$ to #.##### var$ = STR$(18.265, ##.#### ) REM sets var$ to var$ = STR$(18.265, ####### ) REM sets var$ to 18 35
38 COMMANDS AND FUNCTIONS SUB Declares a user-defined subroutine. Subroutines can specify and accept multiple parameters and can return a number or string value using the RETURN statement. The END SUB statement marks the end of a subroutine. Though not required, it is recommended that any subroutine returning a string value should name routine with a trailing dollar-sign ( $ ). SWITCH Declares the beginning of a SWITCH-CASE clause. The single variable given after the SWITCH keyword specifies the character or characters to match. Once a CASE match is made, the program will continue until a BREAK statement is seen, at which point the program will continue execution at the END SWITCH statement. An optional DEFAULT route is followed if no other CASE statements cause a match to occur. 36 area$ = calc_area$(3, 4) REM sets area$to 12 volume = calc_volume(3, 4, 5) REM sets volume to 60 SUB calc_area$(h, w) area = h * w RETURN STR$(area) END SUB SUB calc_volume(h, w, d) vol = h * w * d RETURN vol END SUB var = 1 SWITCH var CASE 0: response$ = Too low BREAK CASE 1: CASE 2: response$ = Low BREAK CASE 3: CASE 4: response$ = Mid BREAK CASE 5: CASE 6: response$ = High BREAK DEFAULT: response$ = Unknown number END SWITCH
39 Commands and Functions TAN (number) Returns the tangent value of the given number. var = TAN(PI/4) REM sets var to 1 var = TAN(0) REM sets var to 0 TELL (filenumber) Returns the current read position of the given file number. THEN REM Presuming SiteID.csv contains: REM Digital1,Analog2,WindSpeed REM 56.23,2.25,126.5 OPEN SiteID.csv FOR READING AS #1 INPUT #1, var$ REM sets var$ to Digital1,Analog2,WindSpeed var = TELL(#1) REM sets var to 27 SEEK #1, -6, CURRENT var = TELL(#1) REM sets var to 21 INPUT #1, var$ REM sets var$ to Speed CLOSE #1 Used with the IF statement to specify a multi-line IF-THEN clause. TO var = 40 IF (var >60) THEN var = 60 ELSEIF (var >30) THEN var = 30 REM sets var to 30 ELSE var = 0 ENDIF Used with the FOR statement to specify the range of the loop. FOR x = 1 TO 3 REM retrieve the past 3 values of the Sensor named Analog GETVALUE SENSOR Analog x, var$ NEXT x 37
40 COMMANDS AND FUNCTIONS TOKEN (string, array, string) Splits apart a string into an array of strings. The first parameter provides the string to split apart. The second parameter provides the array which the new substrings will fill. The optional third parameter provides the delimiters or characters that determine where to split the primary string. If more than one delimiter is specified, splitting will occur at each character given. For example, if a comma and hyphen are given,-, content will be split on any commas or hyphens found as in the example below. If no delimiter is specified, whitespace will be used as the delimiter (e.g. spaces and tabs).the number of strings found is returned. Empty elements in the array are not created if two delimiters are next to each other. The SPLIT function, on the other hand, does add empty elements if two or more delimiters are in sequence. The array will be automatically sized (larger or smaller) based on the number of strings that are produced by the split. The number of strings produced will also be returned by the function. var$ = A1,B2,C3,D4,-A1,-B2 ARRAY arr$(1) array_num = TOKEN(var$, arr$(),,- ) REM split on commas, returns 6 REM array arr$ now contains [A1][B2][C3][D4][A1][B2] TRIM$ (string) Returns the given string with all whitespace removed from both the left and right side. TRUE var$ = TRIM$( A1,B2,C3,D4 ) REM sets var$ to A1,B2,C3,D4 A read-only constant containing the number 1. UNTIL var = DATETIME(MINUTES) top_of_hour = FALSE IF (var ==0) THEN top_of_hour = TRUE ENDIF Marks the end of a conditional loop encompassed by REPEAT and UNTIL. The condition is given after the UNTIL statement and while evaluated as TRUE, will continue to iterate through the loop. Once the UNTIL condition is evaluated as FALSE, the loop exits. 38 REPEAT REM Break out of the loop when our seconds are greater than 30 x = DATETIME(SECONDS) UNTIL (x > 30)
41 Commands and Functions UPPER$ (string) Returns the given string as all uppercase. USING var$ =UPPER$( a1,b2,c3,d4 ) REM sets var$ to A1,B2,C3,D4 Used with the PRINT statement to specify the format of the given number. Format is specified using hashes ( # ). If more hashes are provided than needed, the beginning is space-filledand the end zero-padded. If not enough hashes are given before the decimal, the hash format is returned. var = OPEN SiteID.csv FOR WRITING AS #2 PRINT #2, var USING ####.### REM prints PRINT #2, var USING ###.#### REM prints PRINT #2, var USING ###.## REM prints PRINT #2, var USING ##.## REM prints ##.## PRINT #2, var USING ### REM prints 128 CLOSE #2 VAL (string) Returns a number equivalent for the given string. Whitespace is ignored. See STR$( ) for converting a number to a string. WEND var = VAL( ) REM sets var to var = VAL( 22 ) REM sets var to 22 Marks the end of a conditional WHILE-WEND loop. END WHILE may also be used instead of WEND. x = 0 WHILE (x < 30) REM Break out of the loop when our seconds are greater than 30 x = DATETIME(SECONDS) WEND 39
42 COMMANDS AND FUNCTIONS WHILE Marks the beginning of a conditional WHILE-WEND loop. The condition is specified after the WHILE keyword. As long as the condition evaluates to TRUE, the loop will continue to iterate. Once the condition evaluates to FALSE, the loop will exit. REM Presuming SiteID.csv contains: REM Digital1,Analog2,WindSpeed REM 56.23,2.25,126.5 OPEN SiteID.csv FOR READING AS #1 WHILE (!EOF(#1)) INPUT #1,, var$ REM reads each name and value from the file WEND CLOSE #1 XOR (number, number) Returns the bitwise exclusive or (as a number) of the two numeric parameters. var = XOR(6, 2) REM sets var to XOR: 4 40
43 03 / EXAMPLE PROGRAMS 41
44 EXAMPLE PROGRAMS The following programs are provided for reference when creating and using the Basic interpreter. AutoPrint.bas REM REM Prints out the last line of the log file to the RS-232 Com port When set up to run with the sensors, prints out their values every scan LogFile$ = SiteID.csv OPEN LogFile$ FOR READING AS #1 SEEK #1, 0, END filesize = TELL(#1) fileposition = TELL(#1) fileerror = 0 foundend = 0 IF (fileposition < 150) THEN REM The first search should begin at the start SEEK #1, 0, BEGINNING ELSE REM Note that this is presuming that each log line is less than 150 characters long SEEK #1, -150, END END IF WHILE (foundend == 0 and fileerror == 0) LINE INPUT #1, LastLogLine$ fileposition = TELL(#1) IF (fileposition == filesize) THEN foundend = 1 END IF WEND CLOSE #1 SETPORT 9600, 8, none, 1, none, 50, 0 OPEN RS-232 Com AS #2 PRINT #2 LastLogLine$, \r\n CLOSE #2 42
45 Example Programs CompassCorrection.bas REM Determines true wind direction as a bouy rotates, REM based off recorded compass and wind direction GETVALUE SENSOR Compass, WindDirVal GETVALUE SENSOR WD, CompassVal TrueWindDirVal = WindDirVal + CompassVal IF (TrueWindDirVal >= 360) THEN TrueWindDirVal = TrueWindDirVal END IF SensorAvg.bas REM Calculates the running average for a specific sensor SensorName$ = SystemTemperature Measurements = 4 CombinedValue = 0 FOR n = 1 TO Measurements GETVALUE SENSOR SensorName$ n, SensorValue CombinedValue = CombinedValue + SensorValue NEXT n AverageValue = CombinedValue / Measurements SensorMax.bas REM Finds the maximum measurement of the given sensor s last n values SensorName$ = TempC Measurements = 4 MaximumValue = FOR n = 1 TO Measurements GETVALUE SensorName$ n, SensorValue IF (SensorValue > MaximumValue) THEN MaximumValue = SensorValue END IF NEXT n 43
46 EXAMPLE PROGRAMS Listener.bas REM Respond to simple commands on the RS-232 Com port as a Listener program OPEN LISTENER AS #3 PRINT #3 Enter Command > 50 REM Ten seconds of inactivity causes the program to exit INPUT #3 \n 10000, reply$ IF (reply$ == ) THEN END ELSE REM Trim trailing carriage return or line feed DO last_char$ = RIGHT$(reply$, 1) IF (last_char$ == \n ) OR (last_char$ == \r ) THEN reply$ = LEFT$(reply$, LEN(reply$) - 1) ELSE BREAK END IF LOOP ENDIF REM remove case sensitivity from command reply$ = UPPER$(reply$) SWITCH reply$ CASE BATTERY? : GETVALUE SYSBATT, var PRINT #3 Battery =, var USING ##.#, \r\n BREAK CASE LASTSTAGE? : GETVALUE SENSOR Stage, var PRINT #3 Stage =, var, \r\n BREAK CASE ANALOG1? : GETVALUE ANALOG1, var PRINT #3 Analog 1 =, var USING ##.###, \r\n BREAK DEFAULT: PRINT #3 Unknown command \, reply$, \ \r\n BREAK END SWITCH GOTO 50 44
47 Example Programs VR2C.bas REM Communicate with and retrieve data from an RS-232 sensor SerialNum$ = SETPORT 9600,8,None,1,None,0,0 OPEN RS-232 COM AS #4 PRINT #4 \r REM Wake up sensor SLEEP REM Wait for sensor to fully wake up REM COMMAND FORMAT: *SSSSSS.P#CC,command\r REM SSSSSS = serial number of device (passed in) REM P = 0 REM CC = decimal summation of SSSSSS and P SerialNumLength = LEN(SerialNum$) SerialNumSum = 0 SerialNumChar = 1 WHILE (SerialNumLength > 0) SerialNumSum = SerialNumSum + VAL(MID$(SerialNum$, SerialNumChar, 1)) SerialNumChar = SerialNumChar + 1 SerialNumLength = SerialNumLength - 1 WEND IF (SerialNumSum < 10) THEN SerialNumSum$ = 0 + STR$(SerialNumSum) ELSE SerialNumSum$ = STR$(SerialNumSum) END IF PRINT #4 *, SerialNum$,.0#, SerialNumSum$,,RTMNOW\r INPUT #4 \r 5000, ack$ REM retrieve the acknowledgement INPUT #4 \r 5000, status$ REM retrieve the status line INPUT #4 > 20000, reply$ CLOSE #4 REM Remove initial <CR><LF> from reply NLPosition = INSTR(reply$, \n ) IF (NLPosition < 3) THEN reply$ = MID$(reply$, NLPosition + 1) END IF REM Remove the trailing greater than symbol and <CR><LF> from reply GTPosition = INSTR(reply$, > ) IF (GTPosition > 0) THEN reply$ = MID$(reply$, 1, GTPosition - 3) END IF IF (LEN(reply$) > 5) THEN OPEN VR2CData.csv FOR APPENDING AS #3 PRINT #3, reply$ CLOSE #3 END IF 45
48 Xylem 1) The tissue in plants that brings water upward from the roots; 2) a leading global water technology company. We re 12,000 people unified in a common purpose: creating innovative solutions to meet our world s water needs. Developing new technologies that will improve the way water is used, conserved, and re-used in the future is central to our work. We move, treat, analyze, and return water to the environment, and we help people use water efficiently, in their homes, buildings, factories and farms. In more than 150 countries, we have strong, long-standing relationships with customers who know us for our powerful combination of leading product brands and applications expertise, backed by a legacy of innovation. For more information on how Xylem can help you, go to Xylem WaterLOG 95 W 100 S, Suite 150 Logan, UT Tel Fax Storm 3 is a trademark of Xylem Inc. or one of its subsidiaries Xylem, Inc. D
Virtual Integrated Design Getting started with RS232 Hex Com Tool v6.0
Virtual Integrated Design Getting started with RS232 Hex Com Tool v6.0 Copyright, 1999-2007 Virtual Integrated Design, All rights reserved. 1 Contents: 1. The Main Window. 2. The Port Setup Window. 3.
Introduction to Python
WEEK ONE Introduction to Python Python is such a simple language to learn that we can throw away the manual and start with an example. Traditionally, the first program to write in any programming language
TAP Interface Specifications
TAP Interface Specifications This Document is for those who want to develop their own paging control software or add an interface for the WaveWare v9 Series Paging Encoder to their existing software applications.
Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.
Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to
Chapter 2: Elements of Java
Chapter 2: Elements of Java Basic components of a Java program Primitive data types Arithmetic expressions Type casting. The String type (introduction) Basic I/O statements Importing packages. 1 Introduction
SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual
SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual Version 1.0 - January 20, 2015 CHANGE HISTORY Version Date Description of Changes 1.0 January 20, 2015 Initial Publication
The Answer to the 14 Most Frequently Asked Modbus Questions
Modbus Frequently Asked Questions WP-34-REV0-0609-1/7 The Answer to the 14 Most Frequently Asked Modbus Questions Exactly what is Modbus? Modbus is an open serial communications protocol widely used in
AIMMS Function Reference - Arithmetic Functions
AIMMS Function Reference - Arithmetic Functions This file contains only one chapter of the book. For a free download of the complete book in pdf format, please visit www.aimms.com Aimms 3.13 Part I Function
Hydras 3 LT Quick Start
Catalog Number 6234218 Hydras 3 LT Quick Start SOFTWARE MANUAL December 2005, Edition 2 Hach Company, 2005. All rights reserved. Printed in the U.S.A. Catalog Number 6234218 Hydras 3 LT SOFTWARE MANUAL
6.170 Tutorial 3 - Ruby Basics
6.170 Tutorial 3 - Ruby Basics Prerequisites 1. Have Ruby installed on your computer a. If you use Mac/Linux, Ruby should already be preinstalled on your machine. b. If you have a Windows Machine, you
VB.NET Programming Fundamentals
Chapter 3 Objectives Programming Fundamentals In this chapter, you will: Learn about the programming language Write a module definition Use variables and data types Compute with Write decision-making statements
So far we have considered only numeric processing, i.e. processing of numeric data represented
Chapter 4 Processing Character Data So far we have considered only numeric processing, i.e. processing of numeric data represented as integer and oating point types. Humans also use computers to manipulate
MATLAB Basics MATLAB numbers and numeric formats
MATLAB Basics MATLAB numbers and numeric formats All numerical variables are stored in MATLAB in double precision floating-point form. (In fact it is possible to force some variables to be of other types
OpenOffice.org 3.2 BASIC Guide
OpenOffice.org 3.2 BASIC Guide Copyright The contents of this document are subject to the Public Documentation License. You may only use this document if you comply with the terms of the license. See:
SOME EXCEL FORMULAS AND FUNCTIONS
SOME EXCEL FORMULAS AND FUNCTIONS About calculation operators Operators specify the type of calculation that you want to perform on the elements of a formula. Microsoft Excel includes four different types
CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals
CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals 1 Recall From Last Time: Java Program import java.util.scanner; public class EggBasket { public static void main(string[]
Part 3 Smart Script User Manual
Lab-LINKTM for Windows Part 3 Smart Script User Manual Top Team Technology Inc. SmartScript 使 用 手 冊 目 錄 Table of Content Chapter1 Introduction Chapter 2 Editor Features 1-1 Mode 1-2 Command Line 1-2 User
Perl in a nutshell. First CGI Script and Perl. Creating a Link to a Script. print Function. Parsing Data 4/27/2009. First CGI Script and Perl
First CGI Script and Perl Perl in a nutshell Prof. Rasley shebang line tells the operating system where the Perl interpreter is located necessary on UNIX comment line ignored by the Perl interpreter End
JavaScript: Introduction to Scripting. 2008 Pearson Education, Inc. All rights reserved.
1 6 JavaScript: Introduction to Scripting 2 Comment is free, but facts are sacred. C. P. Scott The creditor hath a better memory than the debtor. James Howell When faced with a decision, I always ask,
Data Integrator. Pervasive Software, Inc. 12365-B Riata Trace Parkway Austin, Texas 78727 USA
Data Integrator Event Management Guide Pervasive Software, Inc. 12365-B Riata Trace Parkway Austin, Texas 78727 USA Telephone: 888.296.5969 or 512.231.6000 Fax: 512.231.6010 Email: [email protected]
The string of digits 101101 in the binary number system represents the quantity
Data Representation Section 3.1 Data Types Registers contain either data or control information Control information is a bit or group of bits used to specify the sequence of command signals needed for
ESPResSo Summer School 2012
ESPResSo Summer School 2012 Introduction to Tcl Pedro A. Sánchez Institute for Computational Physics Allmandring 3 D-70569 Stuttgart Germany http://www.icp.uni-stuttgart.de 2/26 Outline History, Characteristics,
Python Lists and Loops
WEEK THREE Python Lists and Loops You ve made it to Week 3, well done! Most programs need to keep track of a list (or collection) of things (e.g. names) at one time or another, and this week we ll show
Variables, Constants, and Data Types
Variables, Constants, and Data Types Primitive Data Types Variables, Initialization, and Assignment Constants Characters Strings Reading for this class: L&L, 2.1-2.3, App C 1 Primitive Data There are eight
How to Obtain an OPC License--5. Creating a System Code 5 Entering an Authorization Code 6. Getting Started with SNMP Editor--7
Contents Introduction--1 Product definition 1 Implementing SNMP 2 Integrating SNMP into the user interface 3 Components of OPC SNMP Gateway 4 How to Obtain an OPC License--5 Creating a System Code 5 Entering
Visual Logic Instructions and Assignments
Visual Logic Instructions and Assignments Visual Logic can be installed from the CD that accompanies our textbook. It is a nifty tool for creating program flowcharts, but that is only half of the story.
Moving from CS 61A Scheme to CS 61B Java
Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you
ee-quipment.com ee203 RTCM USB Quick-Start Guide
ee-quipment.com ee203 RTCM USB Quick-Start Guide The ee203 USB interface consists of a flash drive and two virtual serial ports. The required drivers are built into Windows, but the serial ports require
PL / SQL Basics. Chapter 3
PL / SQL Basics Chapter 3 PL / SQL Basics PL / SQL block Lexical units Variable declarations PL / SQL types Expressions and operators PL / SQL control structures PL / SQL style guide 2 PL / SQL Block Basic
VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0
VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 UX Software - 2009 TABLE OF CONTENTS INTRODUCTION... ii What is this book about?... iii How to use this book... iii Time to start...
Portal Connector Fields and Widgets Technical Documentation
Portal Connector Fields and Widgets Technical Documentation 1 Form Fields 1.1 Content 1.1.1 CRM Form Configuration The CRM Form Configuration manages all the fields on the form and defines how the fields
Pemrograman Dasar. Basic Elements Of Java
Pemrograman Dasar Basic Elements Of Java Compiling and Running a Java Application 2 Portable Java Application 3 Java Platform Platform: hardware or software environment in which a program runs. Oracle
Exercise 4 Learning Python language fundamentals
Exercise 4 Learning Python language fundamentals Work with numbers Python can be used as a powerful calculator. Practicing math calculations in Python will help you not only perform these tasks, but also
Python Loops and String Manipulation
WEEK TWO Python Loops and String Manipulation Last week, we showed you some basic Python programming and gave you some intriguing problems to solve. But it is hard to do anything really exciting until
C++ Language Tutorial
cplusplus.com C++ Language Tutorial Written by: Juan Soulié Last revision: June, 2007 Available online at: http://www.cplusplus.com/doc/tutorial/ The online version is constantly revised and may contain
CS106A, Stanford Handout #38. Strings and Chars
CS106A, Stanford Handout #38 Fall, 2004-05 Nick Parlante Strings and Chars The char type (pronounced "car") represents a single character. A char literal value can be written in the code using single quotes
grep, awk and sed three VERY useful command-line utilities Matt Probert, Uni of York grep = global regular expression print
grep, awk and sed three VERY useful command-line utilities Matt Probert, Uni of York grep = global regular expression print In the simplest terms, grep (global regular expression print) will search input
CONCEPT1 RS232 COMMUNICATION
Concept 1 RS-232 Communication Communication with Concept 1 via RS-232 is done with simple ASCII Commands and Replies. The port settings are 19200Baud, 8bits, no parity and 1 stop bit. The physical connection
WA Manager Alarming System Management Software Windows 98, NT, XP, 2000 User Guide
WA Manager Alarming System Management Software Windows 98, NT, XP, 2000 User Guide Version 2.1, 4/2010 Disclaimer While every effort has been made to ensure that the information in this guide is accurate
Chapter 3. Input and output. 3.1 The System class
Chapter 3 Input and output The programs we ve looked at so far just display messages, which doesn t involve a lot of real computation. This chapter will show you how to read input from the keyboard, use
Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C
Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection
TruePort Windows 2000/Server 2003/XP User Guide Chapter
TruePort Windows 2000/Server 2003/XP User Guide Chapter 0 This document provides the procedure for installing and using TruePort on Windows 2000/Server 2003/XP. Table of Contents What is TruePort?...3
Unix Shell Scripts. Contents. 1 Introduction. Norman Matloff. July 30, 2008. 1 Introduction 1. 2 Invoking Shell Scripts 2
Unix Shell Scripts Norman Matloff July 30, 2008 Contents 1 Introduction 1 2 Invoking Shell Scripts 2 2.1 Direct Interpretation....................................... 2 2.2 Indirect Interpretation......................................
Technical Support Bulletin Nr.18 Modbus Tips
Technical Support Bulletin Nr.18 Modbus Tips Contents! Definitions! Implemented commands! Examples of commands or frames! Calculating the logical area! Reading a signed variable! Example of commands supported
.NET Standard DateTime Format Strings
.NET Standard DateTime Format Strings Specifier Name Description d Short date pattern Represents a custom DateTime format string defined by the current ShortDatePattern property. D Long date pattern Represents
20 Using Scripts. (Programming without Parts) 20-1
20 Using Scripts (Programming without Parts) This chapter explains the basics of creating and using programming scripts in GP-Pro EX. Please start by reading 20.1 Settings Menu (page 20-2) and then turn
Object Oriented Software Design
Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa September 14, 2011 G. Lipari (Scuola Superiore Sant Anna) Introduction
Modbus Communications for PanelView Terminals
User Guide Modbus Communications for PanelView Terminals Introduction This document describes how to connect and configure communications for the Modbus versions of the PanelView terminals. This document
Unique Micro Design Advanced Thinking Products. Model S151 UMD Transfer Utility for the Nippondenso BHT Series User Manual
S151 User Manual Advanced Thinking Products Unique Micro Design Advanced Thinking Products Model S151 UMD Transfer Utility for the Nippondenso BHT Series User Manual Document Reference : DOC-S151-UM UMD
Xi2000 Series Configuration Guide
U.S. Default Settings Sequence Reset Scanner Xi2000 Series Configuration Guide Auto-Sense Mode ON UPC-A Convert to EAN-13 OFF UPC-E Lead Zero ON Save Changes POS-X, Inc. 2130 Grant St. Bellingham, WA 98225
Getting Graphic: Defining Custom LCD Characters
LCD Serial Backpack App Note No. 2 Getting Graphic: Defining Custom LCD Characters Block graphics add new symbols and enable animated effects ALPHANUMERIC LCD S are inexpensive and easy to use. But there
Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science
Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Fall 2005 Handout 7 Scanner Parser Project Wednesday, September 7 DUE: Wednesday, September 21 This
Introduction to Java Applications. 2005 Pearson Education, Inc. All rights reserved.
1 2 Introduction to Java Applications 2.2 First Program in Java: Printing a Line of Text 2 Application Executes when you use the java command to launch the Java Virtual Machine (JVM) Sample program Displays
Alarms & Events Plug-In Help. 2015 Kepware, Inc.
2015 Kepware, Inc. 2 Table of Contents Table of Contents 2 Alarms & Events Plug-In 3 Overview 3 OPC AE Plug-In Terminology 3 OPC AE Plug-In Conditions 4 The OPC AE Plug-In from the OPC AE Clients' Perspective
Version 1.5 Satlantic Inc.
SatCon Data Conversion Program Users Guide Version 1.5 Version: 1.5 (B) - March 09, 2011 i/i TABLE OF CONTENTS 1.0 Introduction... 1 2.0 Installation... 1 3.0 Glossary of terms... 1 4.0 Getting Started...
JavaScript: Control Statements I
1 7 JavaScript: Control Statements I 7.1 Introduction 2 The techniques you will learn here are applicable to most high-level languages, including JavaScript 1 7.2 Algorithms 3 Any computable problem can
Informatica e Sistemi in Tempo Reale
Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)
Parallax Serial LCD 2 rows x 16 characters Non-backlit (#27976) 2 rows x 16 characters Backlit (#27977) 4 rows x 20 characters Backlit (#27979)
599 Menlo Drive, Suite 100 Rocklin, California 95765, USA Office: (916) 624-8333 Fax: (916) 624-8003 General: [email protected] Technical: [email protected] Web Site: www.parallax.com Educational: www.stampsinclass.com
Fundamentals of Programming and Software Development Lesson Objectives
Lesson Unit 1: INTRODUCTION TO COMPUTERS Computer History Create a timeline illustrating the most significant contributions to computing technology Describe the history and evolution of the computer Identify
Programming Languages CIS 443
Course Objectives Programming Languages CIS 443 0.1 Lexical analysis Syntax Semantics Functional programming Variable lifetime and scoping Parameter passing Object-oriented programming Continuations Exception
Infor LN CRM User Guide for CRM
Infor LN CRM User Guide for CRM Copyright 2015 Infor Important Notices The material contained in this publication (including any supplementary information) constitutes and contains confidential and proprietary
WinHLLAPI Language Reference
Worldwide Technical Support WinHLLAPI Language Reference 2004 Attachmate Corporation. All Rights Reserved. If this document is distributed with software that includes an end user agreement, this document,
HOW TO USE YOUR INTELE-MODEM
HOW TO USE YOUR INTELE-MODEM 305-008800 Ultratec, Inc. 450 Science Drive Madison, WI 53711 (608) 238-5400 (Voice/TTY) Fax: (608) 238-3008 Email: [email protected] www.ultratec.com First Edition October
Process Control and Automation using Modbus Protocol
Process Control and Automation using Modbus Protocol Modbus is the fundamental network protocol used in most industrial applications today. It is universal, open and an easy to use protocol. Modbus has
PHP Tutorial From beginner to master
PHP Tutorial From beginner to master PHP is a powerful tool for making dynamic and interactive Web pages. PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
PageR Enterprise Monitored Objects - AS/400-5
PageR Enterprise Monitored Objects - AS/400-5 The AS/400 server is widely used by organizations around the world. It is well known for its stability and around the clock availability. PageR can help users
EXCEL FUNCTIONS MOST COMMON
EXCEL FUNCTIONS MOST COMMON This is a list of the most common Functions in Excel with a description. To see the syntax and a more in depth description, the function is a link to the Microsoft Excel site.
Microsoft Access 3: Understanding and Creating Queries
Microsoft Access 3: Understanding and Creating Queries In Access Level 2, we learned how to perform basic data retrievals by using Search & Replace functions and Sort & Filter functions. For more complex
TESTING CENTER SARAS USER MANUAL
Brigham Young University Idaho TESTING CENTER SARAS USER MANUAL EXCELSOFT 1 P a g e Contents Recent Updates... 4 TYPOGRAPHIC CONVENTIONS... 5 SARAS PROGRAM NAVIGATION... 6 MANAGE REPOSITORY... 6 MANAGE
Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.
Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement
Appendix B RCS11 Remote Communications
Appendix B RCS11 Remote Communications B.1 Host Computer Remote Communications Control and status messages are conveyed between the RCS11 and the host computer using packetized message blocks in accordance
BARCODE READER V 2.1 EN USER MANUAL
BARCODE READER V 2.1 EN USER MANUAL INSTALLATION OF YOUR DEVICE PS-2 Connection RS-232 Connection (need 5Volts power supply) 1 INSTALLATION OF YOUR DEVICE USB Connection 2 USING THIS MANUAL TO SETUP YOUR
SWIFT MT940 MT942 formats for exporting data from OfficeNet Direct
SWIFT MT940 MT942 formats for exporting data from OfficeNet Direct January 2008 2008 All rights reserved. With the exception of the conditions specified in or based on the 1912 Copyright Act, no part of
Experiments: Labview and RS232
Experiments: Labview and RS232 September 2013 Dušan Ponikvar Faculty of Mathematics and Physics Jadranska 19, Ljubljana, Slovenia There are many standards describing the connection between a PC and a microcontroller
Using Logix5000 Controllers as Masters or Slaves on Modbus
Application Solution Using Logix5000 Controllers as Masters or Slaves on Modbus Purpose of the Document This application solution, and the associated RSLogix 5000 project files, help you use Logix5000
Compiler Construction
Compiler Construction Regular expressions Scanning Görel Hedin Reviderad 2013 01 23.a 2013 Compiler Construction 2013 F02-1 Compiler overview source code lexical analysis tokens intermediate code generation
3.GETTING STARTED WITH ORACLE8i
Oracle For Beginners Page : 1 3.GETTING STARTED WITH ORACLE8i Creating a table Datatypes Displaying table definition using DESCRIBE Inserting rows into a table Selecting rows from a table Editing SQL buffer
Limitation of Liability
Limitation of Liability Information in this document is subject to change without notice. THE TRADING SIGNALS, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES,
6. Control Structures
- 35 - Control Structures: 6. Control Structures A program is usually not limited to a linear sequence of instructions. During its process it may bifurcate, repeat code or take decisions. For that purpose,
Ethernet. Customer Provided Equipment Configuring the Ethernet port.
Installing the RDSP-3000A-NIST Master Clock. Ethernet Connect the RJ-45 connector to a TCP/IP network. Equipment The following equipment comes with the clock system: RDSP-3000A-NIST Master Clock Module.
Command Line Interface User Guide for Intel Server Management Software
Command Line Interface User Guide for Intel Server Management Software Legal Information Information in this document is provided in connection with Intel products. No license, express or implied, by estoppel
EA-200. http://world.casio.com/edu/ Technical Reference. Contents. Sampling... 2 Analog Sampling... 3 Memory... 3 Pulse Sampling...
E Contents EA-200 Technical Reference Sampling... 2 Analog Sampling... 3 Memory... 3 Pulse Sampling... 4 Command Tables... 5 Command 1: Channel Settings... 9 Command 3: Sampling and Trigger Settings...
Introduction to Python
Caltech/LEAD Summer 2012 Computer Science Lecture 2: July 10, 2012 Introduction to Python The Python shell Outline Python as a calculator Arithmetic expressions Operator precedence Variables and assignment
Standard for Communication in Between VINTERMAN and Road Clearing Equipment
The Danish Road Directorate and Counties Standard for Communication in Between VINTERMAN and Road Clearing Equipment Version 1.40 - DRAFT 31-07-2003 Contents Page 1. Preface... 1 2. Update History... 2
MS Access: Advanced Tables and Queries. Lesson Notes Author: Pamela Schmidt
Lesson Notes Author: Pamela Schmidt Tables Text Fields (Default) Text or combinations of text and numbers, as well as numbers that don't require calculations, such as phone numbers. or the length set by
µtasker Document FTP Client
Embedding it better... µtasker Document FTP Client utaskerftp_client.doc/1.01 Copyright 2012 M.J.Butcher Consulting Table of Contents 1. Introduction...3 2. FTP Log-In...4 3. FTP Operation Modes...4 4.
Compiler Construction
Compiler Construction Lecture 1 - An Overview 2003 Robert M. Siegfried All rights reserved A few basic definitions Translate - v, a.to turn into one s own language or another. b. to transform or turn from
Data Tool Platform SQL Development Tools
Data Tool Platform SQL Development Tools ekapner Contents Setting SQL Development Preferences...5 Execution Plan View Options Preferences...5 General Preferences...5 Label Decorations Preferences...6
SQL Server An Overview
SQL Server An Overview SQL Server Microsoft SQL Server is designed to work effectively in a number of environments: As a two-tier or multi-tier client/server database system As a desktop database system
Using Casio Graphics Calculators
Using Casio Graphics Calculators (Some of this document is based on papers prepared by Donald Stover in January 2004.) This document summarizes calculation and programming operations with many contemporary
Getting Started with IntelleView POS Administrator Software
Getting Started with IntelleView POS Administrator Software Administrator s Guide for Software Version 1.2 About this Guide This administrator s guide explains how to start using your IntelleView POS (IntelleView)
IBM Emulation Mode Printer Commands
IBM Emulation Mode Printer Commands Section 3 This section provides a detailed description of IBM emulation mode commands you can use with your printer. Control Codes Control codes are one-character printer
Chapter 5 Functions. Introducing Functions
Chapter 5 Functions 1 Introducing Functions A function is a collection of statements that are grouped together to perform an operation Define a function Invoke a funciton return value type method name
Final Exam Review: VBA
Engineering Fundamentals ENG1100 - Session 14B Final Exam Review: VBA 1 //coe/dfs/home/engclasses/eng1101/f03/ethics/en1.e05.finalcoursewrapup.sxi Final Programming Exam Topics Flowcharts Assigning Variables
SAP BusinessObjects Business Intelligence platform Document Version: 4.1 Support Package 5-2014-11-06. Information Design Tool User Guide
SAP BusinessObjects Business Intelligence platform Document Version: 4.1 Support Package 5-2014-11-06 Table of Contents 1 What's new in the....14 2 Getting started with the information design tool....18
Netezza SQL Class Outline
Netezza SQL Class Outline CoffingDW education has been customized for every customer for the past 20 years. Our classes can be taught either on site or remotely via the internet. Education Contact: John
Command Scripts. 13.1 Running scripts: include and commands
13 Command Scripts You will probably find that your most intensive use of AMPL s command environment occurs during the initial development of a model, when the results are unfamiliar and changes are frequent.
SenseLink TM. End-Point Controller. Addendum
SenseLink TM End-Point Controller Addendum MKS Instruments, Inc. Control & Information Technology Products Group 3350 Scott Blvd Bldg 4 Santa Clara, CA 95054 Main: 408.235.7620 Fax: 408.235.7625 SenseLink
Web Programming Step by Step
Web Programming Step by Step Lecture 13 Introduction to JavaScript Reading: 7.1-7.4 Except where otherwise noted, the contents of this presentation are Copyright 2009 Marty Stepp and Jessica Miller. Client-side
