vensim link matlab
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
Thank you all dear friends
Yes ,you are right. Because I thought the modified hfile never works.Now I tried:
>> vendll=['C:\Windows\SysWOW64\venDLL32.dll']
vendll =
C:\Windows\SysWOW64\venDLL32.dll
>> hfile = ['C:\Users\mrj\Desktop\New folder (3)\vendll.h']
hfile =
C:\Users\mrj\Desktop\New folder (3)\vendll.h
>> loadlibrary(vendll,hfile);
??? Error using ==> loadlibrary at 480
There was an error loading the library "C:\Windows\SysWOW64\venDLL32.dll"
C:\Windows\SysWOW64\venDLL32.dll is not a valid Win32 application.
Caused by:
Error using ==> loaddefinedlibrary
C:\Windows\SysWOW64\venDLL32.dll is not a valid Win32 application.
Yes ,you are right. Because I thought the modified hfile never works.Now I tried:
>> vendll=['C:\Windows\SysWOW64\venDLL32.dll']
vendll =
C:\Windows\SysWOW64\venDLL32.dll
>> hfile = ['C:\Users\mrj\Desktop\New folder (3)\vendll.h']
hfile =
C:\Users\mrj\Desktop\New folder (3)\vendll.h
>> loadlibrary(vendll,hfile);
??? Error using ==> loadlibrary at 480
There was an error loading the library "C:\Windows\SysWOW64\venDLL32.dll"
C:\Windows\SysWOW64\venDLL32.dll is not a valid Win32 application.
Caused by:
Error using ==> loaddefinedlibrary
C:\Windows\SysWOW64\venDLL32.dll is not a valid Win32 application.
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
You should try one of the sample files that installs with Vensim to see if that works - probably the Excel example is the easiest to try. If you have files installed in Program Files(x86) that also means you must have an old version of Vensim - you should probably update that. The dll files should install to Users\Public\Vensim\DLL on Win 7.
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
Excuse me bob ;
I can't understand what you mean exactly. before I never works with Java.
you mean I change the path of vendll32.dll, or try it on computer with win(xp), or write any program in Java or Excel program!!!!!!!!
and again Vensim Dss(Vensim 5.9b) is very old version of vensim that dosen't work with matlab?
I can't understand what you mean exactly. before I never works with Java.
you mean I change the path of vendll32.dll, or try it on computer with win(xp), or write any program in Java or Excel program!!!!!!!!
and again Vensim Dss(Vensim 5.9b) is very old version of vensim that dosen't work with matlab?
5.9b is not particularly old, but evidently uses paths that don't work with Win7. I think what Bob is suggesting is that you should copy your C:\Program Files (x86)\Vensim\dll to another location, i.e. your user documents directory, because Win7 won't let them run where they are. No need to do any programming.
However, it may also be the case that your vendll32.dll is in the wrong place. I don't know where it belongs though as I don't use Win7. If you have an XP machine to try, that is much more likely to work with 5.9b.
Tom
However, it may also be the case that your vendll32.dll is in the wrong place. I don't know where it belongs though as I don't use Win7. If you have an XP machine to try, that is much more likely to work with 5.9b.
Tom
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
Thank you Bob,
I couldn’t work with Ecxel Ex.It gives me error for Example I see this:
result=vensim_command("SIMULATE>LOADMODEL|c:\............)
I don't know how should I change this in matlab.
I write very simple model in vensim.
G=A*X, A=5,8,10,16,X=5, initial for G=0,
After I run the matlab:
It's response is :
str =
SPECIAL>LOADMODEL| .vpm
lp =
libpointer
ans =
0
Dose it correct?
Could anyone please help me to resolve this issue?
And for simulating the model?
How can I see amount of G, A, and X in matlab?
[Edited on 9-25-2010 by ahmadi2010]
[Edited on 9-25-2010 by ahmadi2010]
[Edited on 9-25-2010 by ahmadi2010]
I couldn’t work with Ecxel Ex.It gives me error for Example I see this:
result=vensim_command("SIMULATE>LOADMODEL|c:\............)
I don't know how should I change this in matlab.
I write very simple model in vensim.
G=A*X, A=5,8,10,16,X=5, initial for G=0,
After I run the matlab:
It's response is :
str =
SPECIAL>LOADMODEL| .vpm
lp =
libpointer
ans =
0
Dose it correct?
Could anyone please help me to resolve this issue?
And for simulating the model?
How can I see amount of G, A, and X in matlab?
[Edited on 9-25-2010 by ahmadi2010]
[Edited on 9-25-2010 by ahmadi2010]
[Edited on 9-25-2010 by ahmadi2010]
It looks like you have some stray single-quote marks in your code.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
I correct them but again give error!!! I
and thise time I use fullpath.
str=['SPECIAL>LOADMODEL|D:\Documents and Settings\m\Desktop\vensim practice\1.vpm']
lp=libpointer('voidPtr',[int8(str) 1])
calllib('vendll32','vensim_command',lp)
……………………………
It’s response is:
str =SPECIAL>LOADMODEL|D:\Documents and Settings\m\Desktop\vensim practice\1.vpm
lp =libpointer
ans = 0
…………………….
Again Can any one help me?
I want simulate very simple model in matlab:(vensime model is: G=A*X, A=5,8,10,16,X=5, initial for G(level)=0)
what I should write in matlab?
another question: I attached error file but I can't see it here!!!!!
[Edited on 9-26-2010 by ahmadi2010]
[Edited on 9-26-2010 by ahmadi2010]
and thise time I use fullpath.
str=['SPECIAL>LOADMODEL|D:\Documents and Settings\m\Desktop\vensim practice\1.vpm']
lp=libpointer('voidPtr',[int8(str) 1])
calllib('vendll32','vensim_command',lp)
……………………………
It’s response is:
str =SPECIAL>LOADMODEL|D:\Documents and Settings\m\Desktop\vensim practice\1.vpm
lp =libpointer
ans = 0
…………………….
Again Can any one help me?
I want simulate very simple model in matlab:(vensime model is: G=A*X, A=5,8,10,16,X=5, initial for G(level)=0)
what I should write in matlab?
another question: I attached error file but I can't see it here!!!!!
[Edited on 9-26-2010 by ahmadi2010]
[Edited on 9-26-2010 by ahmadi2010]
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
What happens if you try the following (I copied it from http://www.ventanasystems.co.uk/forum/v ... php?t=4181)?
str=['SPECIAL>LOADMODEL|D:\Documents and Settings\m\Desktop\vensim practice\1.vpm'];
lp=libpointer('voidPtr',[int8(str) 0]);
calllib('vendll32','vensim_command',lp);
str=['SPECIAL>LOADMODEL|D:\Documents and Settings\m\Desktop\vensim practice\1.vpm'];
lp=libpointer('voidPtr',[int8(str) 0]);
calllib('vendll32','vensim_command',lp);
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
Thank you dear Administrator for your quick response.
I try this:(I save m file as gg)
if not(libisloaded('vendll32'))
hfile = ['D:\Program Files\Vensim\dll\vendll.h'];
loadlibrary('vendll32', hfile);
end
libfunctionsview vendll32
..................................................
str=['SPECIAL>LOADMODEL|D:\Documents and Settings\m\Desktop\vensim practice\1.vpm'];
lp=libpointer('voidPtr',[int8(str) 0]);
calllib('vendll32','vensim_command',lp);
………………………
For first time it opens the functions in library vendll32 table & I see the vensim open & close rapidly
& in matlab it’s response is,
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 374
In gg at 7
Warning: The function 'VensimCGetSubstring' was not found in the library
> In loadlibrary at 435
In gg at 7
Warning: The function 'vensim_shutdown' was not found in the library
> In loadlibrary at 435
In gg at 7
>>
…………………….
And for second & third times it only open that table without any warning.
I try this:(I save m file as gg)
if not(libisloaded('vendll32'))
hfile = ['D:\Program Files\Vensim\dll\vendll.h'];
loadlibrary('vendll32', hfile);
end
libfunctionsview vendll32
..................................................
str=['SPECIAL>LOADMODEL|D:\Documents and Settings\m\Desktop\vensim practice\1.vpm'];
lp=libpointer('voidPtr',[int8(str) 0]);
calllib('vendll32','vensim_command',lp);
………………………
For first time it opens the functions in library vendll32 table & I see the vensim open & close rapidly
& in matlab it’s response is,
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 374
In gg at 7
Warning: The function 'VensimCGetSubstring' was not found in the library
> In loadlibrary at 435
In gg at 7
Warning: The function 'vensim_shutdown' was not found in the library
> In loadlibrary at 435
In gg at 7
>>
…………………….
And for second & third times it only open that table without any warning.
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Maybe it's best to try contacting someone who has successfully managed to get Matlab and Vensim communicating (try arraywanted or mrj.hoseini).
http://www.ventanasystems.co.uk/forum/m ... ile&u=1847
http://www.ventanasystems.co.uk/forum/m ... ile&u=1861
Most of us do not use Matlab so are only guessing about how to get it working.
Tony.
http://www.ventanasystems.co.uk/forum/m ... ile&u=1847
http://www.ventanasystems.co.uk/forum/m ... ile&u=1861
Most of us do not use Matlab so are only guessing about how to get it working.
Tony.
-
- Member
- Posts: 36
- Joined: Fri Aug 20, 2010 11:03 am
I've never had these warning messages before. Have you checked which functions are contained in the library you loaded? You can do so with "libfunctionsview('vendll32')".
My vendll32 does contain 'VensimCGetSubstring', but not vensim_shutdown. That one isn't even mentioned in the manual, so I have no idea what this warning means.
Neither do I know why these functions should be needed for loading a model. Do these warnings appear when you load the library without loading a model for starters?
Do you know if your model has been loaded correctly? The callib(...) command has to return 1 for that.
My vendll32 does contain 'VensimCGetSubstring', but not vensim_shutdown. That one isn't even mentioned in the manual, so I have no idea what this warning means.
Neither do I know why these functions should be needed for loading a model. Do these warnings appear when you load the library without loading a model for starters?
Do you know if your model has been loaded correctly? The callib(...) command has to return 1 for that.
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm