Voltech AT5600 User Manual page 415

Wound component tester
Hide thumbs Also See for AT5600:
Table of Contents

Advertisement

C H A P T E R
1 6
-
C H A N G E
From the Excel top level menu bar, select: Tools > Macro > Macros
Enter the name 'OLE_Demo' and then create.
Excel will then bring up a module sheet labeled 'Module 1'. Type the following
code into this module sheet:
'*************************************************************************
'OLE_Demo Sub
'
'Procedure to demonstrate linking AT results into an Excel spreadsheet
'in real time using OLE.
'
'The procedure will read the third test in the program and put the result
'into a cell on the third row of the spreadsheet.
'
'The procedure will do this for a total of 3 program runs, and then exit.
Sub OLE_Demo ()
Dim objServerResult As Object
Dim vntResult(1 To 99) As Variant
Set objServerResult = CreateObject("Server.Results")
nTest = 3
nNumRuns = 3
sComPort = "COM2"
vntResult(nTest) = objServerResult.GetVariantResult(sComPort, nTest)
MsgBox ("Press the RUN key on the AT5600")
For nRun = 1 To nNumRuns
Do
vntResult(nTest) = objServerResult.GetVariantResult(sComPort, nTest)
Loop Until (vntResult(nTest) <> "NO RESULT") And _
(vntResult(nTest) <> "INVALID RESULT NUMBER")
Cells(3, 5 + nRun) = vntResult(nTest)
Next nRun
MsgBox ("Done")
End Sub
When you have finished typing the code, return to the 'Sheet 1' of the
spreadsheet.
To run the code, again from the Excel top-level menu bar, select:
AT5600 User Manual 98-119 issue 14
L O G
'Dummy read to clear any previous result
'Get the results
'Put result in spreadsheet
Page 415

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AT5600 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF