LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a VI through ActiveX in the "background"

I would like to execute a Labview VI through ActiveX in Matlab. I use the following commands in Matlab (but they should be similar in other ActiveX-enabled languages such as VB): e=actxserver('LabVIEW.Application'); vipath='C:\DATA\Labview\test.vi'; vi=invoke(e,'GetVIReference',vipath); vi.Run; This works correctly and the VI is seen to execute on its front panel. However, Matlab keeps waiting until the VI has terminated. I want Labview to run the VI silently, without telling Matlab (through ActiveX) to wait. How can a VI be executed without keeping ActiveX busy ? Is there a standard way to do so ? (I assume there should be, given how multitask-oriented Labview is - which is not the case of Matlab in its standard form).
0 Kudos
Message 1 of 5
(3,035 Views)

if i have read your problem correctly you would like to have matlab and your vi running in parallel. To get two vis running in parallel i used a invoke node (run vi) with the wait until done set to false (default is true). 

 

Hope it helps 

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 2 of 5
(3,033 Views)
Yes, this is exactly what I need ! Do you know how to set 'Wait until done' to False through Matlab by any chance ? I tried something like vi.invoke('Run', 'Wait until done', 0) but this is apparently not the right syntax.. Matlab complains that the 'Run' method only takes one argument..
0 Kudos
Message 3 of 5
(3,029 Views)

Someone gave me the solution: you have to use vi.Run(1) (for async/background execution) or vi.Run(0) (if you want to wait until done).

0 Kudos
Message 4 of 5
(3,011 Views)

hello

 

when I tried this

 

e=actxserver('LabVIEW.Application');

 

I got the following error, although I have Labview 2012 and its activex server is enabled


Error using actxserver (line 91)
Server creation failed. Invalid ProgID 'LabVIEW.Application'

A.Hakim
0 Kudos
Message 5 of 5
(2,929 Views)