From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview as automation server in MATLAB

Does anybody know how to use the ActiveX server capability of Labview from
MATLAB?

I'm able to activate a VI at a certain path (e.g. "c:\test.vi") by the folowing MATLAB statements:

lvserv = actxserver('LabVIEW.Application');
vi = invoke(lvserv,'GetViReference','c:\test.vi');
vi.FPWinOpen=1;
vi.run=1;
....

But then I'm stuck because I don't understand how to access the controls and
indicators of the VI....


thanks in advance for your help

Wilfried

--
Posted from mail1.zeiss.de [194.175.223.19]
via Mailgate.ORG Server - http://www.Mailgate.ORG
0 Kudos
Message 1 of 2
(2,919 Views)
You can invoke a SetControlValue method of the Virtual Instrument class in order to set the values of the vi's controls/indicator. If you intend to mine data from the control/indicator then the GetControlValue method needs to be invoked. Below is the official prototype and explanations of each of these functions.


object.SetControlValue(controlName, value)
Purpose

Sets the value of a front panel control.

Applies To

Virtual Instrument object

Parameters

Name Type Description
controlName string Name of the front panel control.
value variant New value of the front panel control. This value can be numeric, Boolean, string, or array. A cluster in LabVIEW is represented as an array of variants in ActiveX.
Return Value

None


object.GetControlValue(controlName)
Purpose

Re
turns the value of a front panel control.

Applies To

Virtual Instrument object

Parameters

Name Type Description
controlName String Name of the front panel control.
Return Value

variant
0 Kudos
Message 2 of 2
(2,919 Views)