Make a connection between MATLAB-VISUAL BASIC via ActiveX as a bridge,
11 views (last 30 days)
Show older comments
Hi,
I am trying to control LabSpec6 using external software, MATLAB. LabSpec6 is the specific software of Raman instrument (Horiba Corp.) and it has a Visual Basic (VB)-based script option. I think I have succeeded to make a connection between LabSpec6 – MATLAB (R2014a 32-bit) via ActiveX as a bridge, however, it seems that LabSpec6 does not respond to MATLAB commands.
In detail; 1. I could see the functions (methods) which are similar to those used at LabSpec6 VB script. This makes me think that I have succeeded to make a connection between LabSpec and MATLAB.
2. For the test, I ordered simple commands;
>> LabSpec=actxserver('NFACTIVEX.NFActiveXCtrl.1');
>> LabSpec.Acq(0,1,1,0,0)
However, nothing happened and MATLAB fell into a dumb status (in endless ‘Busy’ condition).
3. Moreover, there was a flaky result when I made a command;
>> get(LabSpec)
struct with no fields.
Do you guys have any sense on this?
Thanks in advance! :-)
0 Comments
Accepted Answer
Iain
on 25 Sep 2014
Using activeX is a bit of a pain. HOWEVER, if you look at the code for xlsread/xlswrite, you'll see that there is a whole load of activeX stuff where matlab tells excel to do things that look remarkably like visual basic (for applications) commands. You can use that code as a leaping off point.
To explain #2 - Your command was issued to LabSpec, but labspec never finished doing whatever you asked of it. This made Matlab just simply wait.
0 Comments
More Answers (2)
KANG
on 1 Oct 2014
Edited: KANG
on 1 Oct 2014
1 Comment
Iain
on 1 Oct 2014
That shouldn't need to be fixed. Windows maintains a "short" filename which is in the old DOS 8.3 format.
LABSPEC_6_2_69 is longer than the 8, so it got shortened to "LABSPE~1"
NFACTIVEX.OCX is longer than the 8, so it got shortened to "NFACTI~1.OCX"
See Also
Categories
Find more on ActiveX in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!