Section 7. Installation
133
works best in practice. CRBasic example
Flag Declaration and Use
(p. 133)
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 CR800, 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 CR800 Series
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 34: ......
Page 54: ......
Page 92: ......
Page 310: ......
Page 446: ...Section 8 Operation 446 8 11 2 Data Display FIGURE 100 CR1000KD Displaying Data ...
Page 448: ...Section 8 Operation 448 FIGURE 102 CR1000KD Real Time Custom ...
Page 449: ...Section 8 Operation 449 8 11 2 3 Final Storage Data FIGURE 103 CR1000KD Final Storage Data ...
Page 450: ...Section 8 Operation 450 8 11 3 Run Stop Program FIGURE 104 CR1000KD Run Stop Program ...
Page 452: ...Section 8 Operation 452 FIGURE 106 CR1000KD File Edit ...
Page 456: ......
Page 462: ......
Page 523: ...Section 11 Glossary 523 FIGURE 116 Relationships of Accuracy Precision and Resolution ...
Page 524: ......
Page 526: ......
Page 556: ......
Page 558: ......
Page 560: ......
Page 597: ......