Changes for command scripts for Vensim 8+?

Use this forum to post Vensim related questions.
Post Reply
kleemax
Senior Member
Posts: 125
Joined: Tue Jan 26, 2016 3:50 pm
Vensim version: PRO

Changes for command scripts for Vensim 8+?

Post by kleemax »

I have some commmand scripts that run fine in Vensim 6.4 (x32) but that do not run in Vensim 8+
Have there been any changes to syntax? Or the way that the syntax is interpreted by Vensim?
Is there a documentation on these changes available?
I am attaching an example.
In Vensim 8.2.1 I get an error message "Unable to read commands from .cmd."
Note that I had not loaded a model. If I load a model, the error message is:
"Unable to read commands from ModelFileName.cmd."
Attachments
HDV-EV-Data_XLS2VDF.zip
(271 Bytes) Downloaded 266 times
Administrator
Super Administrator
Posts: 4626
Joined: Wed Mar 05, 2003 3:10 am

Re: Changes for command scripts for Vensim 8+?

Post by Administrator »

Do you have the VDF and XLS files so we can test?
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
tomfid
Administrator
Posts: 3816
Joined: Wed May 24, 2006 4:54 am

Re: Changes for command scripts for Vensim 8+?

Post by tomfid »

There haven't been any changes (other than a few additions that wouldn't affect this). Syntax checking might have become more picky somewhere.
tomfid
Administrator
Posts: 3816
Joined: Wed May 24, 2006 4:54 am

Re: Changes for command scripts for Vensim 8+?

Post by tomfid »

In the current v9 beta, this can be run (but fails because I don't have the source xls files). There's no indication of a syntax problem. I get the same result in 8.2.1 x64 and x32. I think we need the xls for further testing - you can email if sensitive.
erstring
Junior Member
Posts: 5
Joined: Thu Oct 27, 2022 1:59 pm
Vensim version: DSS

Re: Changes for command scripts for Vensim 8+?

Post by erstring »

Hi! I'm having the same problem - though let me know if I should start a new post. The .cmd file was working fine yesterday morning, and by afternoon I was getting the same message as above, with two separate .cmd files. This is one we always run when the mdl file is closed.

In an attempt to fix this, I upgraded from DSS 9.3.3 to 9.3.4 but that didn't help. I haven't yet been able to see if it happens to anyone else on our team (all traveling/out of office), but they are unfamiliar with this particular error.

We run a sensitivity analysis, then use a cmd file to create a tab file, to convert into csv for analysis in RStudio. The files aren't sensitive per se (they'll all be available publicly eventually), but several are needed if you wanted to run the mdl separately (not sure if that's necessary) so I'm not sure attaching them all here makes sense. Emailing a zip folder might be easiest.

Also, it might be relevant to know that BEFORE the "Unable to read commands from .cmd" message, I was getting "unable to open...\vensimdp.ini to read/record initilization [sic] information." I'd get that popup, but it would create the .tab file anyway. Now it just goes straight to the .cmd error.
Administrator
Super Administrator
Posts: 4626
Joined: Wed Mar 05, 2003 3:10 am

Re: Changes for command scripts for Vensim 8+?

Post by Administrator »

We need to see the command script.
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
erstring
Junior Member
Posts: 5
Joined: Thu Oct 27, 2022 1:59 pm
Vensim version: DSS

Re: Changes for command scripts for Vensim 8+?

Post by erstring »

I'm trying to attach it but being told it's an invalid file extension
erstring
Junior Member
Posts: 5
Joined: Thu Oct 27, 2022 1:59 pm
Vensim version: DSS

Re: Changes for command scripts for Vensim 8+?

Post by erstring »

I also tried uploading as a .txt file but got the same message. Best I can do is copy-paste the code unless there's someone I can email.

I'm using Notepad++ to edit - which, I just remembered I also updated yesterday so don't know if that could have changed something.

SPECIAL>NOINTERACTION
SPECIAL>LOADMODEL|OSM_Master_CURRENT_PULSE_policy.mdl
SPECIAL>LOADRUN|Treatment analysis pulse.vdfx

MENU>SENS2FILE|Treatment analysis pulse|export_manual_control_tx_analysis_pulse|T

SPECIAL>CLEARRUNS
MENU>EXIT
Administrator
Super Administrator
Posts: 4626
Joined: Wed Mar 05, 2003 3:10 am

Re: Changes for command scripts for Vensim 8+?

Post by Administrator »

The script does not report any errors for me.

What happens if you comment out the first and last lines so you can see what it's failing on?
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
erstring
Junior Member
Posts: 5
Joined: Thu Oct 27, 2022 1:59 pm
Vensim version: DSS

Re: Changes for command scripts for Vensim 8+?

Post by erstring »

I get the exact same popup - Unable to read commands from .cmd.
Administrator
Super Administrator
Posts: 4626
Joined: Wed Mar 05, 2003 3:10 am

Re: Changes for command scripts for Vensim 8+?

Post by Administrator »

Can you email the files to us? Make sure you include your licence details.

You will probably need to rename the command script so it has a txt extension.
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
erstring
Junior Member
Posts: 5
Joined: Thu Oct 27, 2022 1:59 pm
Vensim version: DSS

Re: Changes for command scripts for Vensim 8+?

Post by erstring »

Sure, what email address should I send it to?
tomfid
Administrator
Posts: 3816
Joined: Wed May 24, 2006 4:54 am

Re: Changes for command scripts for Vensim 8+?

Post by tomfid »

vensim at vensim.com

If you .zip things, the cmd scipts usually come across OK.
aliakhavan89
Senior Member
Posts: 108
Joined: Sun Oct 21, 2018 7:09 am
Vensim version: DSS

Re: Changes for command scripts for Vensim 8+?

Post by aliakhavan89 »

I am facing a similar issue, and since the solution was not discussed here, I'm bringing up this post. I have been running a script over the past few months to run a cmd file, but now (I think after updating Vensim or macOS), I get the same error. I can run Vensim (not even the model) to run the cmd below manually using the file menu:

SPECIAL>NOINTERACTION
SPECIAL>LOADMODEL|randomWalk.mdl
SIMULATE>payoff|
SIMULATE>sensitivity|Sens.vsc
SIMULATE>optparm|
SIMULATE>savelist|
SIMULATE>senssavelist|sens.lst
SIMULATE>DATA|""
SIMULATE>SETVAL|Final Time=99

SIMULATE>RUNNAME|SIMS
SIMULATE>REPORT|1
MENU>RUN_SENSITIVITY|o
MENU>SENS2FILE|!|!|T|
SPECIAL>CLEARRUNS


But through the script, I get the Unable to read commands from cmd. error.

When I run (/Applications/VensimDSS.app/Contents/MacOS/VensimDSS "/path/SIMS.cmd") in the terminal, Vensim opens, but nothing happens (and instead of the white model window, I see a grayed out, like deactivated environment).

As I said, I can manually, using trackpad, open the cmd and run it.
Screenshot 2024-05-22 at 2.44.04 PM.png
Screenshot 2024-05-22 at 2.44.04 PM.png (155.31 KiB) Viewed 686 times
Screenshot 2024-05-22 at 3.28.23 PM.png
Screenshot 2024-05-22 at 3.28.23 PM.png (1.41 MiB) Viewed 686 times
Administrator
Super Administrator
Posts: 4626
Joined: Wed Mar 05, 2003 3:10 am

Re: Changes for command scripts for Vensim 8+?

Post by Administrator »

I'm back in the office next Wednesday, so will take a look then (I don't have my Mac with me at the moment).
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
Post Reply