Path: news.mathworks.com!not-for-mail
From: "Atrish Mukherjee" <atrish@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: exchange data betwwen matlab and VB2005
Date: Fri, 15 Feb 2008 10:12:01 +0000 (UTC)
Organization: Bengal Engineering and Scienc university,Shibpur.
Lines: 51
Message-ID: <fp3ohh$rsc$1@fred.mathworks.com>
References: <fee0o4$qqm$1@fred.mathworks.com> <fp31vl$mfp$1@fred.mathworks.com>
Reply-To: "Atrish Mukherjee" <atrish@mathworks.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1203070321 28556 172.30.248.37 (15 Feb 2008 10:12:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 15 Feb 2008 10:12:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1199177
Xref: news.mathworks.com comp.soft-sys.matlab:451596



"Vincent " <nospan.vincent.himpe@st.com> wrote in message
<fp31vl$mfp$1@fred.mathworks.com>...
> Sorry, that's not what i am looking for.
> Let me detail.
> 
> on the SAME computer 2 programs are running
> - Matlab
> - A program written in VB 2005 and COMPILED to an 
> executable.
> 
> I want to be able to write a script in matlab that can send 
> information to the running VB program.
> 
> The MAtlab script is in control !
> 
> My question are the following
> 
> - how do i expose internal functions and procedures from 
> the VB program to matlab ?
> 
> For eaxmple the VBprogram has the following 2 functions
> 
> Public sub Write (address as data32,data as int32)
> public function Read(address as int32) as int32
> 
> What do i need to specify so these functions become visible 
> to the outside world ?
> 
> Then the other part is : What do i write in matlab to 'call 
> these functions ?
> 
> Keep in mind that the VB program is running on the machine.
> The matlab script needs to be able to detect that the 
> program is running ( if its not running the matlab script 
> should stop and give a warning ), hook into it and call the 
> functions and pass data ( mostly int32 int64 , double and 
> single. i don't pass complex constructions like arrays. its 
> all simple, single values.

first of all you have to write matlab functions instead of
script. then use matlab combuilder to build the com
files(dll) for that function or functions. Then add the com
file as a reference in your vb project. you will be able to
call the matlab functions from visual basic as simple
functions. You can pass parameter to those functions and can
receive their output to use further in visual basic project.
You need to run MCR installer running on the machine if you
dont have matlab installed on that machine wher you want to
run that application.
I think this information will help you..