Section 7. Creating and Editing Datalogger Programs
TABLE 7-3. Synonyms for True and False
Predefined Constant
True (-1)
False (0)
Synonym High
Low
Synonym On
Off
Synonym Yes
No
Synonym
Trigger
Do Not Trigger
Number
≠
0
0
Digital port
5 Volts
0 Volts
7.3.4.11.2 Expression Evaluation
Conditional tests require the datalogger to evaluate an expression and take one
path if the expression is true and another if the expression is false. For
example:
If X>=5 then Y=0
will set the variable Y to 0 if X is greater than or equal to 5.
The datalogger will also evaluate multiple expressions linked with
and
or
or
.
For example:
If X>=5 and Z=2 then Y=0
will set Y=0 only if both X>=5 and Z=2 are true.
If X>=5 or Z=2 then Y=0
will set Y=0 if either X>=5 or Z=2 is true (see And and Or in the help). A
condition can include multiple
and
and
or
links.
7.3.4.11.3 Numeric Results of Expression Evaluation
The datalogger’s expression evaluator evaluates an expression and returns a
number. A conditional statement uses the number to decide which way to
branch. The conditional statement is false if the number is 0 and true if the
number is not 0. For example:
If 6 then Y=0,
is always true, Y will be set to 0 any time the conditional statement is executed.
If 0 then Y=0
is always false, Y will never be set to 0 by this conditional statement.
The expression evaluator evaluates the expression, X>=5, and returns -1, if the
expression is true, and 0, if the expression is false.
W=(X>Y)
will set W equal to -1 if X>Y or will set W equal to 0 if X<=Y.
The datalogger uses -1 rather than some other non-zero number because the
and
and
or
operators are the same for logical statements and binary bitwise
comparisons. The number -1 is expressed in binary with all bits equal to 1, the
number 0 has all bits equal to 0. When -1 is anded with any other number the
result is the other number, ensuring that if the other number is non-zero (true),
the result will be non-zero.
7-48
Содержание LoggerNet
Страница 2: ......
Страница 30: ...Preface What s New in LoggerNet 4 xxvi...
Страница 32: ...Section 1 System Requirements 1 2...
Страница 44: ...Section 2 Installation Operation and Backup Procedures 2 12...
Страница 136: ...Section 4 Setting up Datalogger Networks 4 80...
Страница 227: ...Section 7 Creating and Editing Datalogger Programs 7 9...
Страница 298: ...Section 7 Creating and Editing Datalogger Programs 7 80...
Страница 402: ...Section 9 Automating Tasks with Task Master 9 12...
Страница 406: ...Section 9 Automating Tasks with Task Master 9 16...
Страница 450: ...Section 11 Utilities Installed with LoggerNet Admin and LoggerNet Remote 11 22...
Страница 454: ...Section 12 Optional Client Applications Available for LoggerNet 12 4...
Страница 462: ...Section 13 Implementing Advanced Communications Links 13 8...
Страница 482: ...Section 14 Troubleshooting Guide 14 20...
Страница 570: ...Appendix F Calibration and Zeroing F 16...
Страница 578: ...Appendix G Importing Files into Excel G 8...
Страница 579: ......