Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: exchange data betwwen matlab and VB2005
Date: Fri, 15 Feb 2008 13:03:01 +0000 (UTC)
Organization: Barron Associates
Lines: 54
Message-ID: <fp42i5$fvh$1@fred.mathworks.com>
References: <fee0o4$qqm$1@fred.mathworks.com> <fp31vl$mfp$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1203080581 16369 172.30.248.37 (15 Feb 2008 13:03:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 15 Feb 2008 13:03:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 796958
Xref: news.mathworks.com comp.soft-sys.matlab:451625



Vincent,

Does your VB side need to be an executable?  You could write
yourself a little COM object in VB.NET, instantiate it in
your MATLAB code and just call the Read/Write methods.  I
did it in C# and it was fairly painless.

If it does need to be an executable, the only thing I can
suggest is a TCP or UDP socket.

hth.

reilly.


"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.