I am using Excel VBA to capture voltage data from an Agilent 34410A voltmeter. The meter connects by USB.
Using Win 7 and Excel 2010.
I need to collect 40,000 samples at around 600/sec.
Excel seems to limit me to about 300/sec.
I have been using the following in a For/next loop to grab the data:
Saving to an array instead of cells does not seem to be any faster.
The speed capability of the data from the voltmeter at the resolution I am using is much faster.
If I load the computer with a lot of open windows, the data rate does not slow from the 300/sec until the CPU is more than ~50% busy.
Question:
Is there a better way or command to gather this data so it is faster?
Thanks!
------------------------------------------------------------------------------------------------------
Other setup parameters are:
Using Win 7 and Excel 2010.
I need to collect 40,000 samples at around 600/sec.
Excel seems to limit me to about 300/sec.
I have been using the following in a For/next loop to grab the data:
Code:
instrany.WriteString ("Read?") 'This sends the read? command to the voltmeter
idn = instrany.ReadString() ' this reads the resulting number from the voltmeter.
ActiveSheet.Cells(i, 1) = idn
Saving to an array instead of cells does not seem to be any faster.
The speed capability of the data from the voltmeter at the resolution I am using is much faster.
If I load the computer with a lot of open windows, the data rate does not slow from the 300/sec until the CPU is more than ~50% busy.
Question:
Is there a better way or command to gather this data so it is faster?
Thanks!
------------------------------------------------------------------------------------------------------
Other setup parameters are:
Code:
Dim ioMgr As VisaComLib.ResourceManager
Dim instrany As VisaComLib.FormattedIO488
Dim instrquery As String
Dim instrAddress As String
Dim idn As String
Dim i As Integer
Application.ScreenUpdating = False
Set ioMgr = New VisaComLib.ResourceManager
Set instrany = New VisaComLib.FormattedIO488
Set instrany.IO = ioMgr.Open("USB0::0x0957::0x0607::MY47008722::0::INSTR")
instrany.WriteString ("*cls")
'These should make it faster to gather voltage data:
instrany.WriteString ("display off")
instrany.WriteString ("volt:zero:auto off")
instrany.WriteString ("sense:volt:dc:rang:auto OFF")
instrany.WriteString ("sense:volt:dc:rang 10")
instrany.WriteString ("sense:volt:DC:aper:enabled on")
instrany.WriteString ("sense:volt:DC:aper 2E-04")