Campbell Scientific CR200 Operation Manual - Page 83

Programming

Page 83 highlights

Section 9. Programming 9.1 Inserting Comments into Program Comments are non-functioning text placed within the body of a program to document or clarify program algorithms. As shown in CRBASIC EXAMPLE. Inserting Comments (p. 69), comments are inserted into a program by preceding the comment with a single quote ('). Comments can be entered either as independent lines or following CR200(X) code. When the CR200(X) compiler sees a single quote ('), it ignores the rest of the line. CRBASIC EXAMPLE 1. Inserting Comments 'Declaration of variables starts here. Public Start(6) 'Declare the start time array 9.2 Sending Programs The CR200(X) requires a program be sent to its memory to direct measurement, processing, and data storage operations. Programs are sent with LoggerNet / PC400 / RTDAQ / PC200W datalogger support software. Programs can also be sent from Device Configuration Utility (DevConfig). A good practice is to always retrieve data from the CR200(X) before sending a program, otherwise, data may be lost. The CR200(X) does not have an on-board compiler to create the binary (.BIN) program file required by the datalogger. Instead, the datalogger support software creates a binary file using the appropriate compiler. The compiler is chosen to match the version of operating system found in the CR200(X) and a BIN file with the same filename as the selected CR2 file is created and sent to the datalogger. It is important that the compiler used match the operating system version in the datalogger. If a different compiler is used, the program send will fail. Compilers are typically stored at C:\Campbellsci\Lib\CR200(X)Compilers. The most current CR200(X) operating system along with compiler and CRBasic Editor support files may be obtained at www.campbellsci.com/downloads. 9.3 Writing Programs Programs are created with either Short Cut or CRBASIC Editor. Short Cut is available at no charge at www.campbellsci.com. CRBASIC Editor is a program 69

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210

Section 9. Programming
9.1
Inserting Comments into Program
Comments are non-functioning text placed within the body of a program to
document or clarify program algorithms.
As shown in
CRBASIC EXAMPLE. Inserting Comments
(p. 69), comments are
inserted into a program by preceding the comment with a single quote (
'
).
Comments can be entered either as independent lines or following CR200(X)
code. When the CR200(X) compiler sees a single quote (
'
), it ignores the rest of
the line.
CRBASIC EXAMPLE 1.
Inserting Comments
'Declaration of variables starts here.
Public Start(6)
'Declare the start time array
9.2
Sending Programs
The CR200(X) requires a program be sent to its memory to direct measurement,
processing, and data storage operations. Programs are sent with LoggerNet /
PC400 / RTDAQ / PC200W datalogger support software.
Programs can also be sent from Device Configuration Utility (DevConfig). A
good practice is to always retrieve data from the CR200(X) before sending a
program, otherwise, data may be lost.
The CR200(X) does not have an on-board compiler to create the binary (.BIN)
program file required by the datalogger.
Instead, the datalogger support
software creates a binary file using the appropriate compiler.
The compiler is
chosen to match the version of operating system found in the CR200(X) and a
BIN file with the same filename as the selected CR2 file is created and sent to
the datalogger.
It is important that the compiler used match the operating system version in the
datalogger.
If a different compiler is used, the program send will fail.
Compilers are typically stored at C:\Campbellsci\Lib\CR200(X)Compilers.
The most current CR200(X) operating system along with compiler and CRBasic
Editor support files may be obtained at www.campbellsci.com/downloads.
9.3
Writing Programs
Programs are created with either Short Cut or CRBASIC Editor. Short Cut is
available at no charge at
www.campbellsci.com
. CRBASIC Editor is a program
69