How can a Labview VI be run as a background task through an ActiveX call ? (without keeping ActiveX busy)

后端 未结 2 402
轻奢々
轻奢々 2021-01-23 16:27

I would like to execute a Labview VI through ActiveX in Matlab.

I use the following commands:

e=actxserver(\'LabVIEW.Application\');
vipath=\'C:\\DATA\\L         


        
2条回答
  •  温柔的废话
    2021-01-23 16:47

    I finally found the answer (thanks to smercurio_fc on the NI forum):

    To run the VI in the background (without waiting until done):
    vi.Run(1);

    To run it and wait until its execution is complete:
    vi.Run(0);
    or
    vi.Run;

    In the background execution mode with vi.Run(1), execution can be interrupted with vi.Abort. During execution, input and output values can be changed with vi.SetControlValue and vi.GetControlValue.
    For instance, to get the value of a numerical control 'z' during execution:
    vi.GetControlValue('z')

提交回复
热议问题