txtMatlabCommand.LinkMode = vbLinkNone
txtMatlabCommand.LinkTopic = "MATLAB|Engine"
txtMatlabCommand.LinkItem = "EngEvalString"
txtMatlabCommand.LinkMode = vbLinkManual
txtMatlabCommand.LinkExecute Command
where txtMatlabCommand is a text control on my form, and Command is a
string (in many cases it is something as simple as "x=5"). The problem
I have is that I will receive the following error:
Timeout while waiting for DDE response (Error 286)
Is it possible to start a DDE conversation with the Matlab Server? Any
help would be appreciated.
Curtis Ditz
Alliant Techsystems
Sent via Deja.com
http://www.deja.com/
Text1.LinkTimeout=5 'default
Also, you need to have Matlab running during your test.
-Chris
Hecker wrote:
> Curtis,
>
> This works for me:
>
> Private Sub Command1_Click()
> Static i ' Worksheet row number.
> i = i + 1 ' Increment Row.
> If i = 1 Then ' First time only.
> ' Make sure the link isn't active.
> Text1.LinkMode = 0
> ' Set the application name and topic name.
> Text1.LinkTopic = "Matlab|Engine"
> Text1.LinkItem = "EngEvalString" ' Set LinkItem.
> Text1.LinkMode = 2 ' Set LinkMode to Automatic.
> Text1.LinkExecute "x=1"
> Else
> Text1.LinkExecute "x=" & i
> End If
> End Sub
>
> Maybe in a loop you're killing the link?
>
> Using R12 and VB6SP3
>
> -Chris
This works for me:
Private Sub Command1_Click()
Static i ' Worksheet row number.
i = i + 1 ' Increment Row.
If i = 1 Then ' First time only.
' Make sure the link isn't active.
Text1.LinkMode = 0
' Set the application name and topic name.
Text1.LinkTopic = "Matlab|Engine"
Text1.LinkItem = "EngEvalString" ' Set LinkItem.
Text1.LinkMode = 2 ' Set LinkMode to Automatic.
Text1.LinkExecute "x=1"
Else
Text1.LinkExecute "x=" & i
End If
End Sub
Maybe in a loop you're killing the link?
Using R12 and VB6SP3
-Chris
Thanks for your response, and solution. The problem was that
I was not clear with my original message. I'm able to use the
DDE conversation with the original code that I posted. That
code, like yours, works well with Matlab running. The problem
that I'm having is setting up a conversation with the Matlab
Runtime Server.
I had contacted Mathworks and asked them if this could be done.
They responded stating they didn't see any reason why the runtime
server wouldn't work the same way. However, I haven't been able
to successfully get the code to work. I receive the timeout error
that I mentioned earlier.
If you have any insight on the runtime server I would appreciate
any thoughts.
Thanks again,
Good luck.
-Chris
Hi Curtis,
This is a shot in the dark, but it might be a reason why this is not
working.
Assumptions:
- On your development machine (that has a professional non-RunTime Server
MATLAB installed), the code runs fine.
- On a machine with just a Runtime versino of MATLAB installed (i.e., you
access it only with your application) it is timing out.
The possibility here is that the Runtime Server hasn't (yet) been registered
as an ActiveX Automation Server. You would need to run
matlab.exe /automation
just once on the machines you're installing to. THis sets up the application
as an ActiveX Autoamtion Server (and hence a DDE server).
Let me know if this works.
Regards
Dean
<cmd...@my-deja.com> wrote in message news:91baf8$cap$1...@nnrp1.deja.com...
Thanks for the reply. I have a Matlab version running on my PC, and
I'm attempting to run Matlab Runtime Server on the same PC as well.
I don't know if this helps or hurts.
Anyway, when I run my regular Matlab with my DDE code it works fine.
So I tried your suggestion with the Matlab Runtime Server and the
"Automation" switch, and I have been getting the same thing. I have
also tested some other code that starts ActiveX to Matlab, and this
works correctly. It's just that the Runtime Server does not seem
to be responding. I'm going to try your suggestion on a clean machine
and I'll let you know how it goes.
Thanks for your help.
Curtis Ditz
Alliant Techsystems
In article <91cjpe$2f6i$1...@nnrp01.ops.uunet.co.za>,