Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 67020

run vi from vba without compiling gets error 13 type mismatch

$
0
0

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,

 


Viewing all articles
Browse latest Browse all 67020

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>