question

Roxanne T2 avatar image
0 Likes"
Roxanne T2 asked Joshua S converted comment to answer

runprogram(str commandline) for .exe requiring .csv inputs and outputs .csv

Hello,

We want to use the runprogram(str commandline) to run an external program. The function works very well to run an "independant" .exe. Thank you for that.

However, we want to run an .exe which takes multiple .csv as inputs and outputs multiple .csv (these .csv are stored in the same directory than the .exe). For some reason (maybe a path modification when executing the runprogram() function), the .exe cannot access the .csv anymore when it is executed by the FlexSim function and thus cannot run.

Could you please help me with this issue ?

Thank you very much for your answers.

Roxanne

runprogram.exe
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

@Roxanne T2, can you be a bit more precise when the csv file are opened and closed by which program. Perhaps it has something to do with the right management. You can try to run FlexSim as an administrator.

0 Likes 0 ·

1 Answer

Roxanne T2 avatar image
0 Likes"
Roxanne T2 answered

Thank you for your answer. Unfortunately, the run as an administrator does not resolve the problem. Sorry, if my question was not very clear. It was indeed a path issue.

Finally, we solve the problem by saving the FlexSim model in the same directory as the .exe. This way, the .exe is able to access the .csv required even after "being change of location" by the runprogram() function. Another solution that should work would be to put a path relative to the FlexSim model location and the not the .exe location in the original code of the .exe.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.