Hello Tony,
I would like to get and set model variables at a given time from an ActiveX component.
I tried to call OCX_SETVALUE and OCX_GETVALUE commands, using the following syntax for the variable name : "myvariable[mysubcriptelement]@mytime" (for example : C in Atmosphere[Deterministic]@2035)
Unfortunately, it looks like only the end time value is read and set, whatever time is written after the "@" character.
Could you please tell me how to read and update those values from an ActiveX component ?
Best regards,
Hervé
Getting and setting variables at a given time
Moderator: Administrator
-
- Junior Member
- Posts: 4
- Joined: Fri May 23, 2014 9:00 am
- Vensim version: DSS
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Getting and setting variables at a given time
There is a new version uploaded that will allow "parameter@time" now. Let me know if it works ok for you.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Junior Member
- Posts: 4
- Joined: Fri May 23, 2014 9:00 am
- Vensim version: DSS
Re: Getting and setting variables at a given time
Thank you a lot
This works now.
Hervé
This works now.
Hervé
Re: Getting and setting variables at a given time
I've tried "parameter@time" for a variable of type "data" but it did not work. Does it work for all types of variables or for only variable of type "auxiliary"?
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Getting and setting variables at a given time
What errors are you getting? It should work, but only if a data point exists at the specific time you are asking for.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Getting and setting variables at a given time
I've used your example DLL VBDemoControl in order to get the variable value.
Here is my test project. I try to get "Data Variable@2005", it does not work. But "Data Variable Auxiliary@2005" works fine.
Here is my test project. I try to get "Data Variable@2005", it does not work. But "Data Variable Auxiliary@2005" works fine.
- Attachments
-
- test.zip
- (260.94 KiB) Downloaded 664 times
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Getting and setting variables at a given time
I've tried this project, there is no call to get the data (or I cannot see it).
Can you give me step by step instructions please?
Can you give me step by step instructions please?
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Getting and setting variables at a given time
I open the project with Sable Developer, then run the DLL VBDemoControl in "External Dlls" folder. In DLL's window, I try to get data.
- Attachments
-
- get_data_variable.png (234.2 KiB) Viewed 13608 times
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Getting and setting variables at a given time
I'll have to raise this as a Vensim bug, I have no workaround for now. Sorry.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559