CR1000 Measurement and Control System
Page 10
.../ NextSubScan 137 7.7.3.7.4 Scan Priorities in Sequential Mode 137 7.7.3.8 Instructions 139 7.7.3.8.1 Measurement and Data-Storage Processing 139 7.7.3.8.2 Argument Types 140 7.7.3.8.3 Names in Arguments 140 7.7.3.8.4 Expressions in Arguments 141 7.7.3.8.5 Arrays of Multipliers and Offsets 141 7.7.3.9 Expressions 142 7.7.3.9.1... Expressions with Numeric Data Types 143 7.7.3.9.4 Logical Expressions 145 7.7.3.9.5 String Expressions 147 7.7.3.10 Program Access to Data Tables 148 7.7.3.11 System Signatures 150 7.7.4 Tips 150 7.7.4.1 Use of Variable Arrays to Conserve Code Space...
.../ NextSubScan 137 7.7.3.7.4 Scan Priorities in Sequential Mode 137 7.7.3.8 Instructions 139 7.7.3.8.1 Measurement and Data-Storage Processing 139 7.7.3.8.2 Argument Types 140 7.7.3.8.3 Names in Arguments 140 7.7.3.8.4 Expressions in Arguments 141 7.7.3.8.5 Arrays of Multipliers and Offsets 141 7.7.3.9 Expressions 142 7.7.3.9.1... Expressions with Numeric Data Types 143 7.7.3.9.4 Logical Expressions 145 7.7.3.9.5 String Expressions 147 7.7.3.10 Program Access to Data Tables 148 7.7.3.11 System Signatures 150 7.7.4 Tips 150 7.7.4.1 Use of Variable Arrays to Conserve Code Space...
CR1000 Measurement and Control System
Page 16
....2.1 Accuracy, Precision, and Resolution 471 Appendix A. Table of Contents Section 10. CRBasic Programming Instructions .....473 A.1 Program Declarations 473 A.1.1 Variable Declarations & Modifiers 474 A.1.2 Constant Declarations 475 A.2 Data-Table Declarations 475 A.2.1 Data-Table Modifiers 475 16 Troubleshooting 423 10.1 Status Table...Voltage Measurements 428 10.3.4.1.2 SDI-12 Measurements 428 10.3.4.2 Floating-Point Math, NAN, and ±INF 429 10.3.4.3 Data Types, NAN, and ±INF 429 10.3.4.4 Output Processing and NAN 430 10.4 Communications 431 10.4.1 RS-232 431 10.4.2...
....2.1 Accuracy, Precision, and Resolution 471 Appendix A. Table of Contents Section 10. CRBasic Programming Instructions .....473 A.1 Program Declarations 473 A.1.1 Variable Declarations & Modifiers 474 A.1.2 Constant Declarations 475 A.2 Data-Table Declarations 475 A.2.1 Data-Table Modifiers 475 16 Troubleshooting 423 10.1 Status Table...Voltage Measurements 428 10.3.4.1.2 SDI-12 Measurements 428 10.3.4.2 Floating-Point Math, NAN, and ±INF 429 10.3.4.3 Data Types, NAN, and ±INF 429 10.3.4.4 Output Processing and NAN 430 10.4 Communications 431 10.4.1 RS-232 431 10.4.2...
CR1000 Measurement and Control System
Page 22
...-12 Sensor Setup -- Measuring VoltSE() at 100 Hz 233 Table 35. String NULL Character Examples 238 Table 41. PRTCalc() Type-Code-2 Sensor 255 Table 47. CRBasic Measurement Integration Times and Codes 284 Table 55. Reference-Temperature Compensation Range and Error 310... Table 38. Example Power Usage Profile for Salinity Sensor 156 Table 24. Formatting Hexadecimal Variables - Calibration Report for a Network of SDI-12 Probes 186 Table 29. CR1000 Serial Ports 202 Table 32. String Concatenation Examples 238 Table 40. Extracting String Characters...
...-12 Sensor Setup -- Measuring VoltSE() at 100 Hz 233 Table 35. String NULL Character Examples 238 Table 41. PRTCalc() Type-Code-2 Sensor 255 Table 47. CRBasic Measurement Integration Times and Codes 284 Table 55. Reference-Temperature Compensation Range and Error 310... Table 38. Example Power Usage Profile for Salinity Sensor 156 Table 24. Formatting Hexadecimal Variables - Calibration Report for a Network of SDI-12 Probes 186 Table 29. CR1000 Serial Ports 202 Table 32. String Concatenation Examples 238 Table 40. Extracting String Characters...
CR1000 Measurement and Control System
Page 23
...75. Filter Attenuation of the Status Table 527 Table 121. File-Control Functions 341 Table 80. DNP3 Implementation - Data Types Required to Campbell Scientific Equivalents 368 Table 89. DataQuery API Command Parameters 380 Table 95. ClockSet API Command Response 388 Table 99. Curl ...Constants 321 Table 74. SetValue API Command Response 386 Table 97. Variable and FS Data Types with NAN and ±INF 429 Table 113. Math Expressions and CRBasic Results 429 Table 112. CR1000 SRAM Memory 331 Table 77. BrowseSymbols API Command Response 376 Table ...
...75. Filter Attenuation of the Status Table 527 Table 121. File-Control Functions 341 Table 80. DNP3 Implementation - Data Types Required to Campbell Scientific Equivalents 368 Table 89. DataQuery API Command Parameters 380 Table 95. ClockSet API Command Response 388 Table 99. Curl ...Constants 321 Table 74. SetValue API Command Response 386 Table 97. Variable and FS Data Types with NAN and ±INF 429 Table 113. Math Expressions and CRBasic Results 429 Table 112. CR1000 SRAM Memory 331 Table 77. BrowseSymbols API Command Response 376 Table ...
CR1000 Measurement and Control System
Page 24
...Load binary information into a variable 112 CRBasic Example 6. Proper Program Structure 113 CRBasic Example 7. Wired Sensor Types 559 Table 129. Sensors Types Available for Connection to Control SW-12 105 CRBasic Example 2. Current-Shunt Modules 562 Table 138. CR1000 Battery Bases 565 Table ...154. Telephone Modems 568 Table 155. CF-Card Storage Module 569 Table 159. Inserting Comments 110 CRBasic Example 5. Using a Variable Array in Calculations 117 CRBasic Example 8. Definition and Use of CRBasic Examples CRBasic Example 1. Resistive Bridge TIM Modules 561 Table...
...Load binary information into a variable 112 CRBasic Example 6. Proper Program Structure 113 CRBasic Example 7. Wired Sensor Types 559 Table 129. Sensors Types Available for Connection to Control SW-12 105 CRBasic Example 2. Current-Shunt Modules 562 Table 138. CR1000 Battery Bases 565 Table ...154. Telephone Modems 568 Table 155. CF-Card Storage Module 569 Table 159. Inserting Comments 110 CRBasic Example 5. Using a Variable Array in Calculations 117 CRBasic Example 8. Definition and Use of CRBasic Examples CRBasic Example 1. Resistive Bridge TIM Modules 561 Table...
CR1000 Measurement and Control System
Page 118
... a descriptor, is declared as Public StringVar(5) As String * 36 Five variables are As String and three numeric types: As Float, As Long, and As Boolean. Variable data types are declared, each 36 characters long: StringVar(1) StringVar(2) StringVar(3) StringVar(4) StringVar(5) Data Types Variables and stored data can be declared. Section 7. Installation BeginProg Scan() aaa = 3 bbb = 2 ccc = 4 VariableName...
... a descriptor, is declared as Public StringVar(5) As String * 36 Five variables are As String and three numeric types: As Float, As Long, and As Boolean. Variable data types are declared, each 36 characters long: StringVar(1) StringVar(2) StringVar(3) StringVar(4) StringVar(5) Data Types Variables and stored data can be declared. Section 7. Installation BeginProg Scan() aaa = 3 bbb = 2 ccc = 4 VariableName...
CR1000 Measurement and Control System
Page 119
...: Command or Argument Description / Word Size Where Used Notes FP2 Campbell Scientific floating point / Final data storage Default final storage data type. See CRBasic example Load binary information into a variable (p. 112). INF converts to store positive count data ≤ +65535. Other ...byte Signed Integer / 4 byte Unsigned Integer/ 2 byte Unsigned Integer/ 4 byte Dim & Public variables IEEE Standard 754 Final data storage IEEE Standard 754 Dim & Public variables Final data storage Final data storage Final data storage Use to UINT2 at final data storage, values outside...
...: Command or Argument Description / Word Size Where Used Notes FP2 Campbell Scientific floating point / Final data storage Default final storage data type. See CRBasic example Load binary information into a variable (p. 112). INF converts to store positive count data ≤ +65535. Other ...byte Signed Integer / 4 byte Unsigned Integer/ 2 byte Unsigned Integer/ 4 byte Dim & Public variables IEEE Standard 754 Final data storage IEEE Standard 754 Dim & Public variables Final data storage Final data storage Final data storage Use to UINT2 at final data storage, values outside...
CR1000 Measurement and Control System
Page 120
...() can be used to store TRUE or FALSE states, such as true or 0, -1 false. Unless declared otherwise, the minimum string size is always true. Data Type Declarations 'Float Variable Examples Public Z Public X As Float 'Long Variable Example Public CR1000Time As Long Public PosCounter As Long Public PosNegCounter As Long Boolean.... Divided up to record and process time data. See String Operations (p. 236) and Serial I/O (p. 200). If the string contains multiple numeric values separated by the CR1000 operating system. Depending on the application, any other number may be NAN.
...() can be used to store TRUE or FALSE states, such as true or 0, -1 false. Unless declared otherwise, the minimum string size is always true. Data Type Declarations 'Float Variable Examples Public Z Public X As Float 'Long Variable Example Public CR1000Time As Long Public PosCounter As Long Public PosNegCounter As Long Boolean.... Divided up to record and process time data. See String Operations (p. 236) and Serial I/O (p. 200). If the string contains multiple numeric values separated by the CR1000 operating system. Depending on the application, any other number may be NAN.
CR1000 Measurement and Control System
Page 121
CRBasic Example 10. CRBasic example Flag Declaration and Use (p. 121) shows an example using Boolean variables, especially variables named "Flag", works best. Installation DataTable(TableName,True,-1) 'FP2 Data Storage Example Sample(1,Z,FP2) 'IEEE4 / Float Data Storage Example Sample... Example Sample(1,CR1000Time,Nsec) EndTable Flags Flags are a useful program-control tool. While any variable of any data type can be used as a flag, using flags to change the word in string variables. Flag Declaration and Use Public Flag(2) As Boolean Public FlagReport(2) As String BeginProg Scan(1,Sec...
CRBasic Example 10. CRBasic example Flag Declaration and Use (p. 121) shows an example using Boolean variables, especially variables named "Flag", works best. Installation DataTable(TableName,True,-1) 'FP2 Data Storage Example Sample(1,Z,FP2) 'IEEE4 / Float Data Storage Example Sample... Example Sample(1,CR1000Time,Nsec) EndTable Flags Flags are a useful program-control tool. While any variable of any data type can be used as a flag, using flags to change the word in string variables. Flag Declaration and Use Public Flag(2) As Boolean Public FlagReport(2) As String BeginProg Scan(1,Sec...
CR1000 Measurement and Control System
Page 122
... declared as Dim. Terminal Emulator (p. 442) ). Section 7. CRBasic Example 11. If a program with Dim variables declared locally attempts to a name conflict with the same data types and applicable string lengths. 7.7.3.4.2 Constants CRBasic example Using the Const Declaration (p. 123) shows use within the subroutines (p. 187) or functions (p. 525) in cases where making ...
... declared as Dim. Terminal Emulator (p. 442) ). Section 7. CRBasic Example 11. If a program with Dim variables declared locally attempts to a name conflict with the same data types and applicable string lengths. 7.7.3.4.2 Constants CRBasic example Using the Const Declaration (p. 123) shows use within the subroutines (p. 187) or functions (p. 525) in cases where making ...
CR1000 Measurement and Control System
Page 124
... foreign language support. Arrays are not used with the alias name as an aid to be used when accessing final storage data. Variables in one, two, and three dimensional arrays can be called throughout the program. Predefined Constants and Reserved Words mv50cR mv500c mv7_5 mvX10500... mv50R NSEC SCAN mvX1500 Select SUB sec TABLE TypeB SUBSCAN TypeJ TypeN TypeE TypeS UINT2 TypeR usec v2 Until v2c v60 v20 EX1 VX2 VX1 vX105 EX3 VX3 VX4 mv7_5c PROG STRING TRUE TypeK TypeT v10 ...
... foreign language support. Arrays are not used with the alias name as an aid to be used when accessing final storage data. Variables in one, two, and three dimensional arrays can be called throughout the program. Predefined Constants and Reserved Words mv50cR mv500c mv7_5 mvX10500... mv50R NSEC SCAN mvX1500 Select SUB sec TABLE TypeB SUBSCAN TypeJ TypeN TypeE TypeS UINT2 TypeR usec v2 Until v2c v60 v20 EX1 VX2 VX1 vX105 EX3 VX3 VX4 mv7_5c PROG STRING TRUE TypeK TypeT v10 ...
CR1000 Measurement and Control System
Page 125
...7. Only declaration sequences can occur after variable declarations but before the BeginProg instruction....entered after EndSequence and before EndProg or SlowSequence 3. Overhead information includes: • table format • datalogger type and operating system version, 125 These include ShutDown / ShutdownEnd, DialSequence() / EndDialSequence, ModemHangup() / EndModemHangup, ... EndProg. 7.7.3.5.1 Data Tables Data are directed to each time data are stored in CR1000 memory. The trigger that may store individual measurements, individual calculated values, or summary data...
...7. Only declaration sequences can occur after variable declarations but before the BeginProg instruction....entered after EndSequence and before EndProg or SlowSequence 3. Overhead information includes: • table format • datalogger type and operating system version, 125 These include ShutDown / ShutdownEnd, DialSequence() / EndDialSequence, ModemHangup() / EndModemHangup, ... EndProg. 7.7.3.5.1 Data Tables Data are directed to each time data are stored in CR1000 memory. The trigger that may store individual measurements, individual calculated values, or summary data...
CR1000 Measurement and Control System
Page 126
...within parentheses that identify the name of a Data Table (p. 127). Default field names are a combination of the variable names (or alias) from a CR1000 programmed with the code in CRBasic example Definition and Use of individual fields as "table definitions." TOA5 ...Environment Line Field Description 1 file type (always TOA5) 2 station name 3 datalogger model 4 datalogger serial number 5 datalogger OS version 6 ...
...within parentheses that identify the name of a Data Table (p. 127). Default field names are a combination of the variable names (or alias) from a CR1000 programmed with the code in CRBasic example Definition and Use of individual fields as "table definitions." TOA5 ...Environment Line Field Description 1 file type (always TOA5) 2 station name 3 datalogger model 4 datalogger serial number 5 datalogger OS version 6 ...
CR1000 Measurement and Control System
Page 128
...(see section, Output Processing Instructions (p. 131) ). Section, TrigVar and DisableVar - Section 7. The first character must be a variable, expression, or constant. TrigVar may occur if these naming rules are not adhered to. • TrigVar-Controls whether or not...Scan(5,Sec,1,0) 'Default Datalogger Battery Voltage measurement Batt_Volt: Battery(Batt_Volt) 'Wiring Panel Temperature measurement PTemp_C: PanelTemp(PTemp_C,_60Hz) 'Type T (copper-constantan) Thermocouple measurements Temp_C: TCDiff(Temp_C(),2,mV2_5C,1,TypeT,PTemp_C,True,0,_60Hz,1,0) 'Call Data Tables and Store Data ...
...(see section, Output Processing Instructions (p. 131) ). Section, TrigVar and DisableVar - Section 7. The first character must be a variable, expression, or constant. TrigVar may occur if these naming rules are not adhered to. • TrigVar-Controls whether or not...Scan(5,Sec,1,0) 'Default Datalogger Battery Voltage measurement Batt_Volt: Battery(Batt_Volt) 'Wiring Panel Temperature measurement PTemp_C: PanelTemp(PTemp_C,_60Hz) 'Type T (copper-constantan) Thermocouple measurements Temp_C: TCDiff(Temp_C(),2,mV2_5C,1,TypeT,PTemp_C,True,0,_60Hz,1,0) 'Call Data Tables and Store Data ...
CR1000 Measurement and Control System
Page 131
...Variable arrays PTemp_C (an array of 1) and Temp_C() (an array of output processing instructions. Data type for example if the output interval has expired, processed values are : • Reps - controls whether a measurement or value is the Campbell Scientific two-byte floating point data type... processing" instructions) determine what data are stored. In CRBasic example Definition and Use of elements in the variable array for more information on available data types. • DisableVar - Average() stores the average of output processing instructions, see section Final Data Storage ...
...Variable arrays PTemp_C (an array of 1) and Temp_C() (an array of output processing instructions. Data type for example if the output interval has expired, processed values are : • Reps - controls whether a measurement or value is the Campbell Scientific two-byte floating point data type... processing" instructions) determine what data are stored. In CRBasic example Definition and Use of elements in the variable array for more information on available data types. • DisableVar - Average() stores the average of output processing instructions, see section Final Data Storage ...
CR1000 Measurement and Control System
Page 140
... each instruction in which the temperature value is applied to subroutines, tables, 64 140 Rules for variables, arrays, constants, etc. Common argument types are excepted from the above rules. Names must start with the data, 39 they may appear ...), and numbers 0 to integrate the measurement. Parameters are specifically identified in the description of Names • Variable, or Expression • Variable, Array, or Expression 7.7.3.8.3 Names in CRBasic example Measurement Instruction Syntax (p. 140). Allowed argument types are populated by the programmer with arguments.
... each instruction in which the temperature value is applied to subroutines, tables, 64 140 Rules for variables, arrays, constants, etc. Common argument types are excepted from the above rules. Names must start with the data, 39 they may appear ...), and numbers 0 to integrate the measurement. Parameters are specifically identified in the description of Names • Variable, or Expression • Variable, Array, or Expression 7.7.3.8.3 Names in CRBasic example Measurement Instruction Syntax (p. 140). Allowed argument types are populated by the programmer with arguments.
CR1000 Measurement and Control System
Page 142
... the result to precedence rules. If part of the equation has a floating point variable or constant (24 bits), or a function that results in CRBasic is of type Long (integer, 32 bits) if the variables are integers) and the functions give integer results, such as : If (z *...CRBasic. Consider the expressions: x = (z * 1.8) + 32 '(mathematical expression) If x = 23 then y = 5 '(programming expression) The variable x can be lost; Installation CRBasic Example 19. for limits. Expressions are performed internally in single precision IEEE fourbyte floating point with deference to an ...
... the result to precedence rules. If part of the equation has a floating point variable or constant (24 bits), or a function that results in CRBasic is of type Long (integer, 32 bits) if the variables are integers) and the functions give integer results, such as : If (z *...CRBasic. Consider the expressions: x = (z * 1.8) + 32 '(mathematical expression) If x = 23 then y = 5 '(programming expression) The variable x can be lost; Installation CRBasic Example 19. for limits. Expressions are performed internally in single precision IEEE fourbyte floating point with deference to an ...
CR1000 Measurement and Control System
Page 143
.... • When programming extended-cyclical summation of mantissa. One readily available source is : TempF = TempC * 1.8 + 32 Read More! In summary, CR1000 programmers should be aware of FLOAT / LONG to Boolean Public Fa As Float Public Fb As Float Public L As Long Public Ba As Boolean Public... an ever decreasing effect on the magnitude of the sum, because normal floating-point numbers are cross-converted to other data types, such as shown in a variable array from FLOAT or LONG When a FLOAT or LONG is common in conditional statements. Otherwise, as they are AddPrecise(), Average...
.... • When programming extended-cyclical summation of mantissa. One readily available source is : TempF = TempC * 1.8 + 32 Read More! In summary, CR1000 programmers should be aware of FLOAT / LONG to Boolean Public Fa As Float Public Fb As Float Public L As Long Public Ba As Boolean Public... an ever decreasing effect on the magnitude of the sum, because normal floating-point numbers are cross-converted to other data types, such as shown in a variable array from FLOAT or LONG When a FLOAT or LONG is common in conditional statements. Otherwise, as they are AddPrecise(), Average...
CR1000 Measurement and Control System
Page 145
... saving the binary form in X is non-zero, i.e., if X is predefined as -1 in the CR1000 system memory. Installation CRBasic Example 22. by extension, any non-zero number is done. If Condition(1) is...on every bit, so TRUE AND X will not be non-zero if at least one of data type BOOLEAN is assigned any other cases. Public I As Long Public A1, A2 Const ID = 10 BeginProg...is true, it to binary form (-1 or 0), using only -1 as fog, rain, or dew. When a variable of the bits in the memory location indicated. This condition is always translated as TRUE in some logical expressions. So...
... saving the binary form in X is non-zero, i.e., if X is predefined as -1 in the CR1000 system memory. Installation CRBasic Example 22. by extension, any non-zero number is done. If Condition(1) is...on every bit, so TRUE AND X will not be non-zero if at least one of data type BOOLEAN is assigned any other cases. Public I As Long Public A1, A2 Const ID = 10 BeginProg...is true, it to binary form (-1 or 0), using only -1 as fog, rain, or dew. When a variable of the bits in the memory location indicated. This condition is always translated as TRUE in some logical expressions. So...
CR1000 Measurement and Control System
Page 227
....TimeLong(3,1) 'Form 3: "ccyy-mm-dd hr:mm:ss (ISO 8601 Int'l Date) UTTime(3) = TimeTable.TimeLong(4,1) NextScan EndProg 7.8.11 Bool8 Data Type Boolean variables are conveniently translated into eight fields of an alarm. 227 When programming with BOOL8, repetitions in a numeric monitor , data are used . Section 7.... two values. Consequently, more memory is required for the ASCII file, but CR1000 memory is stored as 32 columns of either 0 or -1, each public variable representing an alarm as a LONG data type, but it apart into 32 values of bytes cannot be divisible by manually...
....TimeLong(3,1) 'Form 3: "ccyy-mm-dd hr:mm:ss (ISO 8601 Int'l Date) UTTime(3) = TimeTable.TimeLong(4,1) NextScan EndProg 7.8.11 Bool8 Data Type Boolean variables are conveniently translated into eight fields of an alarm. 227 When programming with BOOL8, repetitions in a numeric monitor , data are used . Section 7.... two values. Consequently, more memory is required for the ASCII file, but CR1000 memory is stored as 32 columns of either 0 or -1, each public variable representing an alarm as a LONG data type, but it apart into 32 values of bytes cannot be divisible by manually...