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

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

roxanne_t2
Not applicable
8 Views
2 Replies
Message 1 of 3

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

roxanne_t2
Not applicable

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

0 Likes
Accepted solutions (1)
9 Views
2 Replies
Replies (2)
Message 2 of 3

joerg_vogel_HsH
Mentor
Mentor

@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
Message 3 of 3

roxanne_t2
Not applicable
Accepted solution

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.

0 Likes