Date: Nov 30, 2013 12:48 AM
Author: Ahmed Hakim
Subject: Re: how to use labview in matlab with activex?

yoon <yoon@me.udel.edu> wrote in message <3650A5ED.9A2E6E77@me.udel.edu>...
> Hi Everyone.
> Is there anyone have a experience
> to use labview vi program in matlab ?
>
> I'd like to popup Labview vi program in matlab with activex control.
>
> I can excute the following program in VisualBasic without error,
> but not in matlab.
>
> I tried it with actxserver function in matlab
> but only 'dispatch error' accurred.
> Is there any method to use labview in matlab with activex?
>
> /*-----------------------------------------------------*/
> Private Sub cmdLab_Click()
>
> Dim lvapp As Object
> Dim vi As Object
> Dim paramNames(1), paramVals(1)
>
> Set lvapp = CreateObject("LabVIEW.Application")
> viPath = "c:\user\test.vi"
>
> Set vi = lvapp.GetVIReference(viPath) 'Load the vi into memory
> vi.FPWinOpen = True 'Open front panel
>
> '
> paramNames(0) = "In"
> paramNames(1) = "Out"
>
> 'initialize input values to the vi
> paramVals(0) = 30
>
> 'run the vi
> Call vi.Call(paramNames, paramVals)
> End Sub
> /*-----------------------------------------------*/
>
>

Try to use ActiveX


e=actxserver('LabVIEW.Application');
vipath='C:\DATA\Labview\test.vi';
vi=invoke(e,'GetVIReference',vipath);
vi.Run;