Section 7. Installation
143
works best in practice. CRBasic example Flag Declaration and Use
(p. 143)
demonstrates changing words in a string based on a flag.
Flag Declaration and Use
'This program example demonstrates the declaration and use of flags as Boolean variables,
'and the use of strings to report flag status. To run the demonstration, send this program
'to the CR3000, then toggle variables Flag(1) and Flag(2) to true or false to see how the
'program logic sets the words "High" or "Low" in variables FlagReport(1) and FlagReport(2).
'To set a flag to true when using LoggerNet Connect Numeric Monitor, simply click on the
'forest green dot adjacent to the word "false." If using a keyboard, a choice of "True" or
'"False" is made available.
Public
Flag(2)
As Boolean
Public
FlagReport(2)
As String
BeginProg
Scan
(1,Sec,0,0)
If
Flag(1) = True
Then
FlagReport(1) = "High"
Else
FlagReport(1) = "Low"
EndIf
If
Flag(2) = True
Then
FlagReport(2) = "High"
Else
FlagReport(2) = "Low"
EndIf
NextScan
EndProg
7.6.3.4 Using Variable Pointers
A pointer is the memory address of a variable. Use a pointer as a convenient way
to reference the memory location of a variable rather than referencing it by name.
This is useful in a Function() instruction function when parameters are local to the
function and changes to them have no effect on original arguments.
Define a pointer variable using the @ operator. For example:
PTR = @X
Use the ! operator to de-reference a pointer (return the value at the pointer). For
example:
!PTR = Myvar
Use the @ operatore to return the name of the variable stored in a memory
location. For example:
Name=(@)X
Pointer variables must be of type LONG and initialized by the @ operator, or a
variable out-of-bounds error will occur.
Summary of Contents for CR3000 Micrologger
Page 2: ......
Page 3: ......
Page 4: ......
Page 6: ......
Page 30: ......
Page 34: ......
Page 36: ......
Page 96: ......
Page 485: ...Section 8 Operation 485 8 11 2 Data Display FIGURE 110 Keyboard and Display Displaying Data ...
Page 487: ...Section 8 Operation 487 FIGURE 112 CR1000KD Real Time Custom ...
Page 491: ...Section 8 Operation 491 FIGURE 116 Keyboard and Display File Edit ...
Page 496: ......
Page 502: ......
Page 564: ...Section 11 Glossary 564 FIGURE 126 Relationships of Accuracy Precision and Resolution ...
Page 566: ......
Page 594: ......
Page 598: ......
Page 600: ......
Page 602: ......
Page 624: ......
Page 642: ......
Page 643: ......