Reference Manual
748384-C
September 2003
1-42 Introduction
Rosemount Analytical Inc. A Division of Emerson Process Management
NGA2000 Reference
(You don't need to do this twice if it has
been defined before)
Variable_return = DDERe-
quest(DDE_Channel, "number")
Number_of_nodes =
LON_into_string(Variable_return)
LON_into_string is a function you can find in
the demo spreadsheets. It converts the ar-
ray returned by the DDE link into a string.
Integer_number_of_nodes =
Right(Number_of_nodes,
Len(Number_of_nodes) -1)
Number_of_nodes is a string "An", where n
is the number of nodes. The above expres-
sion strips off the "A" from the front of this,
and converts the "n" into an integer.
Now get the list of nodes
Dim Node_list_array as variant
Dim Node_list as string
Node_list_array = DDERe-
quest(DDE_Channel, "get")
Node_list =
LON_into_string(Node_list_array)
NODE_LIST will be a set of triplets, ar-
ranged as NODE_NUMBER, NODE_TYPE,
and NODE_TAG. The series repeats for
each node.
See the spreadsheet "NGCHECK.XLS" for
an example of how to extract node names
from this string.
Writing To A Variable
The only way to write to a variable is to use
a macro expression.
Using the variables defined above, suppos-
ing that you want to write the contents of the
cell defined by ROW_NUMBER, COL-
UMN_NUMBER to the variable LON_VAR:
Use the following format.
LON_Address = Chr(34) & Node_tag &
Chr(34) & "" & LON_VAR
DDEPoke DDE_Channel, LON_Address,
Work-
sheets(Worksheet).cells(Row_number,
Column_number)
This will write the contents of cell;
Row_number, Column_number in work-
sheet whose name is stored in the variable
Worksheet, into the LON variable
LON_VAR.
NOTE
The worksheet cell MUST be formatted
as text! Also note the absence of paren-
theses.