Make a connection between MATLAB-VISUAL BASIC via ActiveX as a bridge,
11 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Iain
2014-9-25
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 个评论
更多回答(2 个)
KANG
2014-10-1
编辑:KANG
2014-10-1
1 个评论
Iain
2014-10-1
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"
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 ActiveX 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!