Page 1 of 1

Getting and setting variables at a given time

Posted: Fri Jun 06, 2014 3:21 pm
by Herve - IPSIS
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é

Re: Getting and setting variables at a given time

Posted: Tue Jun 10, 2014 9:22 am
by Administrator
There is a new version uploaded that will allow "parameter@time" now. Let me know if it works ok for you.

Re: Getting and setting variables at a given time

Posted: Fri Jun 13, 2014 12:28 pm
by Herve - IPSIS
Thank you a lot

This works now.

Hervé

Re: Getting and setting variables at a given time

Posted: Wed Jul 16, 2014 7:19 am
by cphan
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"?

Re: Getting and setting variables at a given time

Posted: Wed Jul 16, 2014 12:26 pm
by Administrator
What errors are you getting? It should work, but only if a data point exists at the specific time you are asking for.

Re: Getting and setting variables at a given time

Posted: Wed Jul 16, 2014 2:09 pm
by cphan
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.

Re: Getting and setting variables at a given time

Posted: Thu Jul 17, 2014 11:52 am
by Administrator
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?

Re: Getting and setting variables at a given time

Posted: Thu Jul 17, 2014 12:09 pm
by cphan
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.

Re: Getting and setting variables at a given time

Posted: Fri Jul 18, 2014 9:48 am
by Administrator
I'll have to raise this as a Vensim bug, I have no workaround for now. Sorry.