cofestand does not return handle to command line

Topics which are not specific to any given application

Moderator: jasper

Post Reply
cocofan
Posts: 14
Joined: 24 March 2020, 02:36

cofestand does not return handle to command line

Post by cocofan »

Sorry if this section is not the most relevant to my question. I'm using cofestand to run coco files from the command line or Octave. However, after running and saving the file successfully by cofestand, it does not return the handle to the host application (e.g., Octave or cmd). Consequently, the next lines of my code cannot be executed and my program gets stuck there. I'd appreciate it if anyone has experienced the same issue or has a workaround for it.

Solve finished
Solve finished
Saved mysim.fsd
Saved mysim.fsd
SOLVE: OK
"THE CURSER KEEP BLINKING HERE"
User avatar
jasper
Posts: 1140
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: cofestand does not return handle to command line

Post by jasper »

I am not clear on your problem statement.

Can you first of all, when this happens, check with the task manager, or tasklist, whether COFE.exe and COFEStand.exe are still running at this point?

Secondly, which handle are you referring to? Presumably the STDOUT handle?
cocofan
Posts: 14
Joined: 24 March 2020, 02:36

Re: cofestand does not return handle to command line

Post by cocofan »

Thank you Jasper for your reply. I guess I didn't explain it well. I mean when I run cofestand on a coco file in cmd, the command prompt (>) is not returned until I press Ctrl+C. This causes issues when I want to run cofestand in a for loop inside MATLAB because each time I'd need to manually close the command prompt window or press ctril+C so the for loop goes to the next increment or the next line of the MATLAB code can be executed. I've added two cmd screenshots that show the issue. The coco file is also attached. I appreciate your time.
Attachments
cmd after ctrl+C
cmd after ctrl+C
cofestand2.PNG (13.1 KiB) Viewed 785 times
cmd
cmd
cofestand.PNG (36.97 KiB) Viewed 785 times
compressors.fsd
simulation file
(20.72 KiB) Downloaded 39 times
User avatar
jasper
Posts: 1140
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: cofestand does not return handle to command line

Post by jasper »

I cannot reproduce this. In both PowerShell and cmd the process returns normally:
Screenshot 2025-07-17 091721.png
Screenshot 2025-07-17 091721.png (111.92 KiB) Viewed 675 times
When this happens, can you check whether COFE.exe is still running? If so, when you close that (task manager) I presume COFEstand returns?

If this is the case, can you try again, now making sure COFE.exe is not running before you start?
cocofan
Posts: 14
Joined: 24 March 2020, 02:36

Re: cofestand does not return handle to command line

Post by cocofan »

Thanks for your reply. I checked the task manager. The issue is that upon running cofestand in cmd (COFEstand C:\Users\Guest1\Desktop\compressors.fsd), both cofe.exe and cofestand.exe start to appear in the task manager and neither goes away after the simulation run is competed. The prompt comes back if I end cofe.exe manually from the task manager. So, the question is why is cofe.exe run unintentionally when the user runs cofestand. I'm using cofe 3.9.0.5 x64. Thanks.
User avatar
jasper
Posts: 1140
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: cofestand does not return handle to command line

Post by jasper »

COFE does not run unintentionally - COFEstand is just a small wrapper around COFE; it runs COFE to do the work.

So the problem is that COFE does not exit.

Can you reproduce this without COFEstand? If you just run the document in COFE, and the close COFE, does COFE remain active in the task manager?
Post Reply

Return to “Process modelling and simulation”