AT S
S
ERIES
ERVER
Once the results have been placed into cells in the spreadsheet, standard
Excel functions may be used to perform further analysis on the data, or to
present the data in different ways. As an example, you may wish to use the
Excel Chart Wizard to produce a graph of the results. Alternatively, you may
wish to add further code to the example shown above, as another way of
extending the functionality. For guidance of what may be possible, please
refer to the Microsoft Excel user manuals.
In the code example shown above, it is worth noting the following points:
The line
Do
vntResult(nTest) =
objServerResult.GetVariantResult(sComPort, nTest)
Loop Until (vntResult(nTest) <> "NO RESULT") And _
(vntResult(nTest) <> "INVALID RESULT NUMBER")
two tests for 'No Result' and 'Invalid Result Number' are included.
The GetVariant method will normally read back 'No Result', until a
measurement has occurred. The next time it is executed after a new result
has been sent to the server, GetVariant will read back the actual result value.
The act of doing this will set a flag in the Server to say that the data has been
read, so that any further executions of the GetVariant statement before
another result has been transferred to the server will then return the 'No
Result' reply.
Although the test number is fixed (=3) in this example, the 'Invalid Result
Number' test is also included. This is because the GetVariant method can be
P
4-44
AGE
vntResult(1 To 99) is declared as a variant type because the
GetVariantResult method can return either a numerical value
corresponding to a valid result, or a string corresponding to an error
message.
Set objServerResult = CreateObject("Server.Results")
creates the server.Results automation object within Visual Basic.
When trying to read the result with
V
AT
U
OLTECH
I
SER
M
ANUAL
Need help?
Do you have a question about the ATi and is the answer not in the manual?
Questions and answers