10-03-2018 06:21 AM
Dear Friends,
I am trying to use Matlab to run and read/write some labview VI and subVI programs .
I am using this sample code below:
e=actxserver('LabVIEW.Application');
vipath='Cmd_G_OK.vi';
vi=invoke(e,'GetVIReference',vipath);
!start Cmd_G_OK.vi
invoke(vi,'SetControlValue','PortNumber','4');
vi.Run;
These code instructions above are sample from my code.
what I want to do is to use same methodology to access multiple subVIs from LabView at same time to read and write various parameters to each of them. this would be done through various for loops, and calling the various labels from various VIs is is happening simultaneously.
what I found is Matlab works fine when I am dealing with one VI at a time.however if i open one VI and try to call a parameter from another VI that I opened and ran previously in the matlab code, I get an error. because Matlab only can see the last opened VI that is running and ignores the previous ones. I attach a sample of the matlab code for reference.
I know this might be simple question but I could not find how to do it.
I also fail to find a webpage with all the functions to deal with active X server from Matlab. all functions I used are what I found in forums, can you help me with the list of all instructions and functions used by Matlab for running ActiveX server of labview.
Thanks in advance.
Best Regards,
Hossam