Using Commands in OCX library in Matlab

1.1k views Asked by At

Im trying to write a script in matlab which interfaces with an old piece of hardware. The serial I/O routines were written in BASIC and are contained in a .ocx file. Previously these were called in a VB6 script.

I would like to be able to call the scripts in the .ocx file from within matlab and do all the post processing from there. I have researched activex controls in matlab, but those seem focussed on GUIs and things like that.

Is there a way of importing these functions into matlab? or is it necessary to compile the functions as something else?

thanks for your time!

1

There are 1 answers

3
MusiGenesis On

You should be able to use the actxcontrol function for this. See:

http://www.mathworks.com/help/techdoc/ref/actxcontrol.html

ActiveX controls (aka *.ocx) were usually intended for GUI purposes, but they don't have to be. actxcontrol has a number of constructors - you only need the first, which takes only the control's progid (the other overloads specify position, which is for GUI-type controls).

You would then use the interfaces and invoke functions to call methods in your OCX.