Defining User Variables
Writing and Modifying ComputeList Files
Using the LI-6400
15-9
program from putting a ÒU102 =Ò in front of our equation, so weÕll have to do
it ourselves, and we did. Alternatively, we could write the expression in post-
fix as
##102 "Flag" "1 if photo, 0 if resp"
" NOASSIGN
$ #30 0 > if 1 else 0 then &u102 =
Another example would be making a variable that never gets assigned. In-
stead, we use the equation to do something totally unrelated, such as write a
message to the RS-232 port.
##999 "dummy" "nothing"
"NOASSIGN
PRINT( tair_c, "Tair = %6.2f\n", comm) "
This will cause
"Tair = 23.34"
(or whatever the air temperature really is),
followed by a line feed to be written to the comm port every time user vari-
ables are computed.
NOASSIGN has a second effect: it prevents the equation from being Òtest
compiledÓ when the ComputeList is processed. (Test compiling is when it
lists each variable followed by an ÒokÓ or an error.) If you make a syntax error
in an equation string with a NOASSIGN, you wonÕt know it until the LPL
module that is being generated fails to link, and your entire ComputeList is
not accepted.
¥
The ASSIGN() function
The Assign() function allows user variables to be computed during New Mea-
surements mode, but allows them to be skipped during recomputations. For
example, suppose we are measuring external air temperature with a 6400-13
Thermocouple Adapter. The air temperature channel is defined something
like this:
##1001 "TxAir" "External air"
"NOASSIGN
Assign( &u1001, chan21_mv / -10) "
Notice that the NOASSIGN keeps ÒU1001 =Ó from being prefixed to the
equation, but then we assign
u1001
to the value by using
Assign
(). The first
argument of Assign() must be the address of the thing being assigned
(&
u1001
means the address of
u1001
), and the second argument is the value.
What good is that? Well, you can log
TxAir
by itself, and not have to log
chan21_mv. If you recompute,
TxAir
will not get recomputed (unless you ask
it to be), so itÕs value wonÕt be changed. And you probably wouldnÕt want its
Summary of Contents for LI-6400
Page 1: ...Using the LI 6400 Portable Photosynthesis System ...
Page 15: ...Part I The Basics ...
Page 16: ......
Page 174: ...Making Measurements Answers to Questions 4 56 Using the LI 6400 4 ...
Page 175: ...Part II Useful Details ...
Page 176: ......
Page 200: ...Standard Tools Power ON Hooks 5 24 Using the LI 6400 5 ...
Page 214: ...Real Time Data Real Time Graphics 6 14 Using the LI 6400 6 ...
Page 234: ...Environmental Control Light Control 7 20 Using the LI 6400 7 ...
Page 244: ...Light Sensor Considerations Gallium Arsenide Phosphide GaAsP Sensor 8 10 Using the LI 6400 8 ...
Page 288: ...Data Logging Making Your Own AutoPrograms 9 44 Using the LI 6400 9 ...
Page 289: ...Part III Working With Files ...
Page 290: ......
Page 312: ...The LPL File System Troubleshooting 10 22 Using the LI 6400 10 ...
Page 340: ...Downloading Files Using a Data Capture Program 11 28 Using the LI 6400 11 ...
Page 375: ...Part IV Configuration Issues ...
Page 376: ......
Page 420: ...Defining User Variables Old Style vs New Style 15 18 Using the LI 6400 15 ...
Page 454: ...Using an Energy Balance Further Reading 17 12 Using the LI 6400 17 ...
Page 455: ...Part V Maintenance Troubleshooting ...
Page 456: ......
Page 572: ...Troubleshooting Useful Information 20 46 Using the LI 6400 20 ...
Page 593: ...Part VI Programming ...
Page 594: ......
Page 622: ...Programming with LPL Compiler Directives 22 28 Using the LI 6400 22 ...
Page 846: ...Index I 16 Using the LI 6400 ...