Make a connection between MATLAB-VISUAL BASIC via ActiveX as a bridge,
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Iain
am 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 Kommentare
Weitere Antworten (2)
KANG
am 1 Okt. 2014
Bearbeitet: KANG
am 1 Okt. 2014
1 Kommentar
Iain
am 1 Okt. 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"
Siehe auch
Kategorien
Mehr zu ActiveX finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!