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!
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'sprogid
(the other overloads specify position, which is for GUI-type controls).You would then use the
interfaces
andinvoke
functions to call methods in your OCX.