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.
Содержание CR800 Series
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 32: ......
Страница 34: ......
Страница 54: ......
Страница 92: ......
Страница 190: ...Section 7 Installation 190 FIGURE 40 Running Average Frequency Response FIGURE 41 Running Average Signal Attenuation ...
Страница 310: ......
Страница 446: ...Section 8 Operation 446 8 11 2 Data Display FIGURE 100 CR1000KD Displaying Data ...
Страница 448: ...Section 8 Operation 448 FIGURE 102 CR1000KD Real Time Custom ...
Страница 449: ...Section 8 Operation 449 8 11 2 3 Final Storage Data FIGURE 103 CR1000KD Final Storage Data ...
Страница 450: ...Section 8 Operation 450 8 11 3 Run Stop Program FIGURE 104 CR1000KD Run Stop Program ...
Страница 452: ...Section 8 Operation 452 FIGURE 106 CR1000KD File Edit ...
Страница 456: ......
Страница 462: ......
Страница 523: ...Section 11 Glossary 523 FIGURE 116 Relationships of Accuracy Precision and Resolution ...
Страница 524: ......
Страница 526: ......
Страница 556: ......
Страница 558: ......
Страница 560: ......
Страница 597: ......