Warnings and external functions

Use this forum to post Vensim related questions.
Post Reply
AurelienP
Junior Member
Posts: 7
Joined: Wed Jun 12, 2019 9:14 am
Vensim version: DSS

Warnings and external functions

Post by AurelienP »

Hello,

I am currently devloping an external function library for a Vensim model.
One of the external functions used creates warnings, to be displayed in the normal vensim log (not in a special message box).
I use a syntax like the following :
(*VENGV->error_message)(WARNING, warning_txt);

Since the external function often sends warnings to Vensim, after a fixed number (I don't know exactly) of warnings, the log stops writing all warnings and instead displays something like :
"further warning suppressed"

1st question : is there any way to prevent that from happening ?

Then, I need to display messages during the termination routine (named simulation_shutdown) :
- when the flag is equal to 0 (simulation finished)
- then, when the flag is equal to 1 (results saved)
For those messages, i use the following syntax :
(*VENGV->error_message)(NOT_ERROR, message);

As of now, due to the amount of warnings of my external function, that leads to this "further warnings suppressed", I only get the second message (i.e. when final flag = 1), but not the first one.

hence my 2nd question :
Is this "warnings suppressed" functionnality active only until final_flag = 1 ?
Is there a way to make sure I can pass both messages ?

Any help about this would be much appreciated !
Thanks,
Aurelien
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Warnings and external functions

Post by Administrator »

I'll raise these as bug tickets to be looked into.

A better option might be to use your own log file. Open it during simulation_setup and close during simulation_shutdown.
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
AurelienP
Junior Member
Posts: 7
Joined: Wed Jun 12, 2019 9:14 am
Vensim version: DSS

Re: Warnings and external functions

Post by AurelienP »

Thanks a lot for the answer.

I will either try to create my own log, or to limit the number of warnings from my external function somehow.

In case this is of any help when looking into the issue, I manage to display 54 warnings before getting this message :
WARNING: ... further warning suppressed ....
And of course, if I disable those warnings, I am able to display both my simulation_shutdown messages (when flag = 0 and flag = 1).
AurelienP
Junior Member
Posts: 7
Joined: Wed Jun 12, 2019 9:14 am
Vensim version: DSS

Re: Warnings and external functions

Post by AurelienP »

Also, I guess from your answer that there is no way to force further warnings to be displayed anyways (even if there are more than 54) ?
Post Reply