0
Create Xcos block with string parameter

Hi,

I'm developing a toolbox for Xcos using C source code (using the xcos toolbox squeleton in the source code of scilab as a reference). The code for one block needs a configuration file. I tried to access this configuration file with a relative path in the source code. The problem is that the execution path depends on the folder that the console shows, i.e., if I use cd [path] in the console, the execution path of the block in the simulation changes and the c code in the block will fail to open the configuration file with the relative path.

In other block I was able to overcome this issue using some functions in the library code to get the path of the library itself. This way the configuration file, that is in the same folder as the library, will be open without a problem. The thing is that this solution is not possible in the new block I want to create. I though about using a parameter of the block to get the path for the configuration file but there is no way to use strings in the parameters.

┬┐Any suggestion about a workaround or idea to solve this problem?


Scilab 14-02-19, 2:53 p.m. dagomar

Answers:

Log-in to answer to this question.