I am trying to use PCSU1000 calls within a MS Excel 2003 file. For starters, I am keeping things very simple:
[code]Option Explicit
Private Declare Sub Voltage1 Lib “PCSU1000D.dll” (ByVal Volts As Long)
Private Declare Sub Time Lib “PCSU1000D.dll” (ByVal Rate As Long)
Private Declare Sub Start_PCSU1000 Lib “PCSU1000D.dll” ()
Private Declare Sub Stop_PCSU1000 Lib “PCSU1000D.dll” ()
Private Declare Function GetSettings Lib “PCSU1000D.dll” (SettingsArray As Long) As Boolean
Private Declare Sub Sleep Lib “Kernel32” (ByVal dwMilliseconds As Long)
Sub Read_Scope()
Dim bFunc As Boolean
Start_PCSU1000
Sleep 2000
Voltage1 1
Time 9
bFunc = GetSettings(SettingsArray(0))
Stop_PCSU1000
End Sub[/code]
Every time I try running this, I get “I/O error 103”. Let me also note that GetSettings is returning values, but the returned value fo SettingsArray(2) is not correct. The value is being reported as 14 regardless of the value I try setting.
Based on some others posts that I saw, I copied pcsu1000.bit into the folder with the excel file. I also copied in WinDso.ini, Calibration.log and a folder named ‘data’.
Would you please suggest a fix for this problem? (This probably goes without saying, but I am using a PCSU1000 scope that connects to my Windows XP machine via USB.) As a final note, the example VB program provided does function properly.