
UM-0085-B09
DT80 Range User Manual
Page 69
RG
If you need a CV to count beyond 16,777,216 then you will need to use two CVs to hold the count value, e.g.:
1CV=1CV+1 IF(1CV>1000000){2CV=2CV+1 1CV=0}
Naming Channel Variables
As with any other channel type,
CV
channels can be given name and units strings using the
"
CVname
~
Units
"
channel
option.
The command
NAMEDCVS
will return a summary of all CVs that have been explicitly named, e.g.:
CV S CV Name Value Units
==========================================
5 A Temp 89.1 Deg C
1 A Speed 23.4 m/s
(The "S" column is the schedule identifier)
Calculation Only Channels
If you need to return a calculated value then a channel variable is often used, e.g.
9CV("sum")=1CV+2CV+3CV
However, if you are just logging the result of this expression, and are not going to do any further calculations with it, then
there is no point storing the result in
9CV
.
The
CALC
channel type is a better choice here. An expression can be assigned to it, and the result will be logged in
exactly the same way as a CV. The only difference is that it does not actually copy the result to any particular channel
variable.
For example:
CALC("sum")=1CV+2CV+3CV
Reference Channels
A reference channel is used to reference the value of another channel, which is identified by name. In this way a
measurement can be used is multiple places without having to assign it to a channel variable.
To define a reference, use an ampersand followed by the name of the channel whose value you wish to reference, i.e.
&
channel
. For example:
RA1S 1V &1V
In this (not very useful) example a voltage is measured once but reported twice – once by the original channel and once
by the reference to the channel.
Names
If the "source" channel has a user-defined name then it must be used when defining a reference, e.g.
RA1S 1V("Voltage12") &Voltage12
If the source channel's name has spaces or special characters (anything other than A-Z, 0-9, or _) then it should be
enclosed in quotes, e.g.
RA1S 1V("Voltage no. 12") 1+TK &"Voltage no. 12" &"1+TK"
Note:
name comparisons are not case sensitive, so
&BIG
is a valid reference to
1R("big")
.
If there is more than one source channel with the same name (a practice that is not recommended) then the reference
will refer to the first one defined. e.g.
RA1S 1V("a") 1R("a") &a
defines a reference to the voltage, not the resistance.