Reference Manual
748384-C
September 2003
Rosemount Analytical Inc. A Division of Emerson Process Management
Introduction 1-41
NGA2000 Reference
Spreadsheet Cell Formula
=NGDDESRVInetvar!Node_name
VARIABLE_TAG
The TAG can be used as the node name, or
the node number.
=NGDDESRVlnetvar!TAG
VARIABLE_TAG
The TAG MUST NOT contain spaces.
Using the node number:
=NGDDESRVInetvar!’”n"
VARIABLE_TAG
n is the node number. Note the " ' " before
and after the address variable string.
To Get An Array Element
+NGDDESRVlnetvar!TAG
VARIABLE_TAG [n]
n is the array element
The DDE server does not check for out-of-
bounds arrays.
Reading A Variable
Start a DDE conversation
Dim DDE_Channel as Integer
DDE_Channel = DDEInitiate(DDESRVR,
netvar)
Setup to read a variable
Dim Variable-return as variant
Dim LON_Address, Analyzer_tag, Vari-
able_name as string
Establish what ANALYZER_TAG and VARI-
ABLE_NAME are here. The Chr(34)
expression inserts a quote ("), used to han-
dle the case where the TAG variable con-
tains non-alphanumeric characters, such as
#, &, +, or - . You can't write “’” in an at-
tempt to persuade VBA to insert a quote,
you have to use the Chr(34) function. 34 is
the ASCII decimal code for a quote.
LON_Address = Chr(34) & Analyzer_tag
& Chr(34) & "" & Variable_name
Variable_return = DDERe-
quest(DDE_Channel, LON_Address)
Write it into a spreadsheet cell
Work-
sheets(Worksheet).Cells(Row_number,
Column_number).value=Variable_return
Worksheet, Row - number and Column=
number are variables or expressions that
determine which spreadsheet, and which
address you are using.
Establishing Analyzers Present
The DDE server provides a list of the ana-
lyzers and their types present on the LON.
This can be obtained by opening a conver-
sation with the topic "Nodelist". Asking for
"number" will tell you the number of nodes
found, and asking for “get" will return a list
of them and their types.
In a macro, open a DDE conversation with
the expression
Dim DDE_Channel as Integer
DDE_Channel = DDEIniti-
ate(NGDDESRV, nodelist)
Get the number of nodes present:
Dim Number_of_nodes as String
the return from the DDE server
Dim Integer_number_of_nodes as integer
the result we want.
Dim Variable_return as variant