Hi,
I'm trying to use VBA code to access Agilent 33250A vi driver. I follow examples in the forums but I'm not quite sure why I'm getting 'Run Time error 13' type mismatch.
Sub LabVIEW()
Dim filepath As String
Dim lvapp As Application
Dim vi As VirtualInstrument
Dim ParamNames(0 To 1) As String
Dim ParamVal(0 To 1) As Variant
Set lvapp = CreateObject("LabVIEW.Application") 'create connection to labview
filepath = "C:\Program Files\National Instruments\LabVIEW 2013\instr.lib\Agilent 33XXX Series\Public\Action-Status\Enable Output.vi"
Set vi = lvapp.GetVIReference(filepath) 'load vi
ParamNames(0) = "VISA resource name"
ParamNames(1) = "Enable Output (T: Enable)"
ParamVal(0) = "GPIB0::10::INSTR"
ParamVal(1) = True
vi.FPWinOpen = True
vi.Call ParamNames, ParamVal
lvapp.Quit
End Sub
Any suggestions?
Thanks,